summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/PixelShaderManager.cpp
diff options
context:
space:
mode:
authordegasus <wickmarkus@web.de>2014-05-30 14:54:16 +0200
committerdegasus <wickmarkus@web.de>2014-06-19 16:33:29 +0200
commit027baad73ba17f0a5d6311b7abbefbcca7f9b6a5 (patch)
tree167cb8a270b290d4bf570b2e72d43fe72ae26d7b /Source/Core/VideoCommon/PixelShaderManager.cpp
parente642c8d0c10a9a26b2ca518c833a35e1b30ad4ee (diff)
VideoCommon: use the Light struct in XF memory
Diffstat (limited to 'Source/Core/VideoCommon/PixelShaderManager.cpp')
-rw-r--r--Source/Core/VideoCommon/PixelShaderManager.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/Source/Core/VideoCommon/PixelShaderManager.cpp b/Source/Core/VideoCommon/PixelShaderManager.cpp
index 551f881c3e..bb1819eb76 100644
--- a/Source/Core/VideoCommon/PixelShaderManager.cpp
+++ b/Source/Core/VideoCommon/PixelShaderManager.cpp
@@ -108,16 +108,15 @@ void PixelShaderManager::SetConstants()
// lights don't have a 1 to 1 mapping, the color component needs to be converted to 4 floats
int istart = nLightsChanged[0] / 0x10;
int iend = (nLightsChanged[1] + 15) / 0x10;
- const float* xfmemptr = (const float*)&xfmem.lights[0x10 * istart];
for (int i = istart; i < iend; ++i)
{
- u32 color = *(const u32*)(xfmemptr + 3);
- constants.plight_colors[i][0] = (color >> 24) & 0xFF;
- constants.plight_colors[i][1] = (color >> 16) & 0xFF;
- constants.plight_colors[i][2] = (color >> 8) & 0xFF;
- constants.plight_colors[i][3] = (color) & 0xFF;
- xfmemptr += 4;
+ const Light& light = xfmem.lights[i];
+ constants.plight_colors[i][0] = light.color[3];
+ constants.plight_colors[i][1] = light.color[2];
+ constants.plight_colors[i][2] = light.color[1];
+ constants.plight_colors[i][3] = light.color[0];
+ const float* xfmemptr = light.cosatt;
for (int j = 0; j < 4; ++j, xfmemptr += 3)
{