From 2918f46d8bcc033a0d89dc46bbdeb4fa893b3ed2 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 10 Aug 2014 21:34:34 -0400 Subject: Software: Fix the formatting and function casing in Vec3.h --- Source/Core/VideoBackends/Software/TransformUnit.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'Source/Core/VideoBackends/Software/TransformUnit.cpp') diff --git a/Source/Core/VideoBackends/Software/TransformUnit.cpp b/Source/Core/VideoBackends/Software/TransformUnit.cpp index e0907d7543..bb2b50ad41 100644 --- a/Source/Core/VideoBackends/Software/TransformUnit.cpp +++ b/Source/Core/VideoBackends/Software/TransformUnit.cpp @@ -95,12 +95,12 @@ void TransformNormal(const InputVertexData *src, bool nbt, OutputVertexData *dst MultiplyVec3Mat33(src->normal[0], mat, dst->normal[0]); MultiplyVec3Mat33(src->normal[1], mat, dst->normal[1]); MultiplyVec3Mat33(src->normal[2], mat, dst->normal[2]); - dst->normal[0].normalize(); + dst->normal[0].Normalize(); } else { MultiplyVec3Mat33(src->normal[0], mat, dst->normal[0]); - dst->normal[0].normalize(); + dst->normal[0].Normalize(); } } @@ -170,7 +170,7 @@ static void TransformTexCoordRegular(const TexMtxInfo &texinfo, int coordNum, bo else { if (postInfo.normalize) - tempCoord = dst->normalized(); + tempCoord = dst->Normalized(); else tempCoord = *dst; @@ -222,14 +222,14 @@ static void LightColor(const Vec3 &pos, const Vec3 &normal, u8 lightNum, const L break; case LIGHTDIF_SIGN: { - Vec3 ldir = (light->pos - pos).normalized(); + Vec3 ldir = (light->pos - pos).Normalized(); float diffuse = ldir * normal; AddScaledIntegerColor(light->color, diffuse, lightCol); } break; case LIGHTDIF_CLAMP: { - Vec3 ldir = (light->pos - pos).normalized(); + Vec3 ldir = (light->pos - pos).Normalized(); float diffuse = std::max(0.0f, ldir * normal); AddScaledIntegerColor(light->color, diffuse, lightCol); } @@ -245,7 +245,7 @@ static void LightColor(const Vec3 &pos, const Vec3 &normal, u8 lightNum, const L if (chan.attnfunc == 3) // spot { - float dist2 = ldir.length2(); + float dist2 = ldir.Length2(); float dist = sqrtf(dist2); ldir = ldir / dist; attn = std::max(0.0f, ldir * light->dir); @@ -307,14 +307,14 @@ static void LightAlpha(const Vec3 &pos, const Vec3 &normal, u8 lightNum, const L break; case LIGHTDIF_SIGN: { - Vec3 ldir = (light->pos - pos).normalized(); + Vec3 ldir = (light->pos - pos).Normalized(); float diffuse = ldir * normal; lightCol += light->color[0] * diffuse; } break; case LIGHTDIF_CLAMP: { - Vec3 ldir = (light->pos - pos).normalized(); + Vec3 ldir = (light->pos - pos).Normalized(); float diffuse = std::max(0.0f, ldir * normal); lightCol += light->color[0] * diffuse; } @@ -329,7 +329,7 @@ static void LightAlpha(const Vec3 &pos, const Vec3 &normal, u8 lightNum, const L if (chan.attnfunc == 3) // spot { - float dist2 = ldir.length2(); + float dist2 = ldir.Length2(); float dist = sqrtf(dist2); ldir = ldir / dist; attn = std::max(0.0f, ldir * light->dir); @@ -478,7 +478,7 @@ void TransformTexCoord(const InputVertexData *src, OutputVertexData *dst, bool s { const LightPointer *light = (const LightPointer*)&xfmem.lights[texinfo.embosslightshift]; - Vec3 ldir = (light->pos - dst->mvPosition).normalized(); + Vec3 ldir = (light->pos - dst->mvPosition).Normalized(); float d1 = ldir * dst->normal[1]; float d2 = ldir * dst->normal[2]; -- cgit v1.2.3 From 4129cdeb4d1e3969aba64cf2dad25b3864eedccb Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 10 Aug 2014 21:51:05 -0400 Subject: Software: Apply static to some functions --- Source/Core/VideoBackends/Software/TransformUnit.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Source/Core/VideoBackends/Software/TransformUnit.cpp') diff --git a/Source/Core/VideoBackends/Software/TransformUnit.cpp b/Source/Core/VideoBackends/Software/TransformUnit.cpp index bb2b50ad41..0c667313bc 100644 --- a/Source/Core/VideoBackends/Software/TransformUnit.cpp +++ b/Source/Core/VideoBackends/Software/TransformUnit.cpp @@ -189,21 +189,21 @@ struct LightPointer Vec3 dir; }; -inline void AddIntegerColor(const u8 *src, Vec3 &dst) +static inline void AddIntegerColor(const u8 *src, Vec3 &dst) { dst.x += src[1]; dst.y += src[2]; dst.z += src[3]; } -inline void AddScaledIntegerColor(const u8 *src, float scale, Vec3 &dst) +static inline void AddScaledIntegerColor(const u8 *src, float scale, Vec3 &dst) { dst.x += src[1] * scale; dst.y += src[2] * scale; dst.z += src[3] * scale; } -inline float SafeDivide(float n, float d) +static inline float SafeDivide(float n, float d) { return (d==0) ? (n>0?1:0) : n/d; } -- cgit v1.2.3