diff options
| author | pierre <pierre@pirsoft.de> | 2011-07-04 13:49:40 +0000 |
|---|---|---|
| committer | pierre <pierre@pirsoft.de> | 2011-07-04 13:49:40 +0000 |
| commit | 1f2adf056300e12bcb8608b8a5dbfcbe4b53b3fd (patch) | |
| tree | cbdb3fa1165070e33ca7864ab19ab859e95b58f5 /Source/Core/VideoCommon/Src/PixelShaderManager.cpp | |
| parent | 951e20ae738d3241c9a8ea91aa5b26d642845e79 (diff) | |
VideoCommon: Always update pixel shader constants when tevregs change
This time, it doesn't break the games i tested, and still fixes
Metroid Prime 3 texts/colors.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7668 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/VideoCommon/Src/PixelShaderManager.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/Src/PixelShaderManager.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/Source/Core/VideoCommon/Src/PixelShaderManager.cpp b/Source/Core/VideoCommon/Src/PixelShaderManager.cpp index c8b8be412e..2521f80500 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderManager.cpp +++ b/Source/Core/VideoCommon/Src/PixelShaderManager.cpp @@ -340,17 +340,20 @@ void PixelShaderManager::SetPSTextureDims(int texid) // This one is high in profiles (0.5%). TODO: Move conversion out, only store the raw color value // and update it when the shader constant is set, only. -void PixelShaderManager::SetColorChanged(int type, int num) +void PixelShaderManager::SetColorChanged(int type, int num, bool high) { - int r = bpmem.tevregs[num].low.a; - int a = bpmem.tevregs[num].low.b; - int b = bpmem.tevregs[num].high.a; - int g = bpmem.tevregs[num].high.b; float *pf = &lastRGBAfull[type][num][0]; - pf[0] = (float)r * (1.0f / 255.0f); - pf[1] = (float)g * (1.0f / 255.0f); - pf[2] = (float)b * (1.0f / 255.0f); - pf[3] = (float)a * (1.0f / 255.0f); + if (!high) { + int r = bpmem.tevregs[num].low.a; + int a = bpmem.tevregs[num].low.b; + pf[0] = (float)r * (1.0f / 255.0f); + pf[3] = (float)a * (1.0f / 255.0f); + } else { + int b = bpmem.tevregs[num].high.a; + int g = bpmem.tevregs[num].high.b; + pf[1] = (float)g * (1.0f / 255.0f); + pf[2] = (float)b * (1.0f / 255.0f); + } s_nColorsChanged[type] |= 1 << num; PRIM_LOG("pixel %scolor%d: %f %f %f %f\n", type?"k":"", num, pf[0], pf[1], pf[2], pf[3]); } |
