summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Src/PixelShaderManager.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2013-04-24 09:21:54 -0400
committerLioncash <mathew1800@gmail.com>2013-04-24 09:21:54 -0400
commit8da425b008b46ef90d649e55c6c0d4a0bc2b556b (patch)
tree5b5fd33dc0274f35625a179adf0a7f93ebadeece /Source/Core/VideoCommon/Src/PixelShaderManager.cpp
parentc118c71eace1aef76687beb2e1fa6517498d84ed (diff)
Formatting cleanup for VideoCommon.
Block braces on new lines. Also killed off trailing whitespace and dangling elses. Spaced some things out to make them more readable (only in places where it looked like a bit of a clusterfuck).
Diffstat (limited to 'Source/Core/VideoCommon/Src/PixelShaderManager.cpp')
-rw-r--r--Source/Core/VideoCommon/Src/PixelShaderManager.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/Source/Core/VideoCommon/Src/PixelShaderManager.cpp b/Source/Core/VideoCommon/Src/PixelShaderManager.cpp
index 6c421856d3..1d1ac8f5c6 100644
--- a/Source/Core/VideoCommon/Src/PixelShaderManager.cpp
+++ b/Source/Core/VideoCommon/Src/PixelShaderManager.cpp
@@ -74,6 +74,7 @@ void PixelShaderManager::SetConstants()
{
if (g_ActiveConfig.backend_info.APIType == API_OPENGL && !g_ActiveConfig.backend_info.bSupportsGLSLUBO)
Dirty();
+
for (int i = 0; i < 2; ++i)
{
if (s_nColorsChanged[i])
@@ -158,8 +159,10 @@ void PixelShaderManager::SetConstants()
SetPSConstant4fv(C_INDTEXSCALE, f);
}
- if (s_nIndTexScaleChanged & 0x0c) {
- for (u32 i = 2; i < 4; ++i) {
+ if (s_nIndTexScaleChanged & 0x0c)
+ {
+ for (u32 i = 2; i < 4; ++i)
+ {
f[2 * i] = bpmem.texscale[1].getScaleS(i & 1);
f[2 * i + 1] = bpmem.texscale[1].getScaleT(i & 1);
PRIM_LOG("tex indscale%d: %f %f\n", i, f[2 * i], f[2 * i + 1]);
@@ -243,7 +246,9 @@ void PixelShaderManager::SetConstants()
SetPSConstant4f(C_FOG + 2, ScreenSpaceCenter, (float)Renderer::EFBToScaledX((int)(2.0f * xfregs.viewport.wd)), bpmem.fogRange.K[4].HI / 256.0f,0.0f);
}
else
+ {
SetPSConstant4f(C_FOG + 2, 0.0f, 1.0f, 1.0f, 0.0f); // Need to update these values for older hardware that fails to divide by zero in shaders.
+ }
s_bFogRangeAdjustChanged = false;
}
@@ -279,7 +284,9 @@ void PixelShaderManager::SetConstants()
SetPSConstant4f(C_PLIGHTS+5*i+j+1, 0.00001f, xfmemptr[1], xfmemptr[2], 0);
}
else
+ {
SetPSConstant4fv(C_PLIGHTS+5*i+j+1, xfmemptr);
+ }
}
}
@@ -347,17 +354,22 @@ void PixelShaderManager::SetPSTextureDims(int texid)
void PixelShaderManager::SetColorChanged(int type, int num, bool high)
{
float *pf = &lastRGBAfull[type][num][0];
- if (!high) {
+
+ 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 {
+ }
+ 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]);
}