diff options
| author | degasus <wickmarkus@web.de> | 2014-05-30 14:54:16 +0200 |
|---|---|---|
| committer | degasus <wickmarkus@web.de> | 2014-06-19 16:33:29 +0200 |
| commit | 027baad73ba17f0a5d6311b7abbefbcca7f9b6a5 (patch) | |
| tree | 167cb8a270b290d4bf570b2e72d43fe72ae26d7b /Source/Core/VideoBackends | |
| parent | e642c8d0c10a9a26b2ca518c833a35e1b30ad4ee (diff) | |
VideoCommon: use the Light struct in XF memory
Diffstat (limited to 'Source/Core/VideoBackends')
| -rw-r--r-- | Source/Core/VideoBackends/Software/TransformUnit.cpp | 6 | ||||
| -rw-r--r-- | Source/Core/VideoBackends/Software/XFMemLoader.cpp | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Source/Core/VideoBackends/Software/TransformUnit.cpp b/Source/Core/VideoBackends/Software/TransformUnit.cpp index 2c4c495087..f79c57be00 100644 --- a/Source/Core/VideoBackends/Software/TransformUnit.cpp +++ b/Source/Core/VideoBackends/Software/TransformUnit.cpp @@ -210,7 +210,7 @@ inline float SafeDivide(float n, float d) void LightColor(const Vec3 &pos, const Vec3 &normal, u8 lightNum, const LitChannel &chan, Vec3 &lightCol) { - const LightPointer *light = (const LightPointer*)&xfmem.lights[0x10*lightNum]; + const LightPointer *light = (const LightPointer*)&xfmem.lights[lightNum]; if (!(chan.attnfunc & 1)) { @@ -295,7 +295,7 @@ void LightColor(const Vec3 &pos, const Vec3 &normal, u8 lightNum, const LitChann void LightAlpha(const Vec3 &pos, const Vec3 &normal, u8 lightNum, const LitChannel &chan, float &lightCol) { - const LightPointer *light = (const LightPointer*)&xfmem.lights[0x10*lightNum]; + const LightPointer *light = (const LightPointer*)&xfmem.lights[lightNum]; if (!(chan.attnfunc & 1)) { @@ -476,7 +476,7 @@ void TransformTexCoord(const InputVertexData *src, OutputVertexData *dst, bool s break; case XF_TEXGEN_EMBOSS_MAP: { - const LightPointer *light = (const LightPointer*)&xfmem.lights[0x10*texinfo.embosslightshift]; + const LightPointer *light = (const LightPointer*)&xfmem.lights[texinfo.embosslightshift]; Vec3 ldir = (light->pos - dst->mvPosition).normalized(); float d1 = ldir * dst->normal[1]; diff --git a/Source/Core/VideoBackends/Software/XFMemLoader.cpp b/Source/Core/VideoBackends/Software/XFMemLoader.cpp index d175e6b6dc..bdf8967667 100644 --- a/Source/Core/VideoBackends/Software/XFMemLoader.cpp +++ b/Source/Core/VideoBackends/Software/XFMemLoader.cpp @@ -23,7 +23,7 @@ void XFWritten(u32 transferSize, u32 baseAddress) // fix lights so invalid values don't trash the lighting computations if (baseAddress <= 0x067f && topAddress >= 0x0604) { - u32* x = xfmem.lights; + u32* x = (u32*)xfmem.lights; // go through all lights for (int light = 0; light < 8; light++) |
