diff options
| author | Soren Jorvang <soren.jorvang@gmail.com> | 2010-07-23 23:51:34 +0000 |
|---|---|---|
| committer | Soren Jorvang <soren.jorvang@gmail.com> | 2010-07-23 23:51:34 +0000 |
| commit | 949b873dc8164a9cbfdb48d687263da95b4bfc66 (patch) | |
| tree | cb6e080b1f9fa3c92a123e4e094363ea9b01bee4 /Source/Core/VideoCommon/Src | |
| parent | 2d06b4114b11e637a735e919e622c46b261766fd (diff) | |
Further *BSD portability.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5958 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/VideoCommon/Src')
| -rw-r--r-- | Source/Core/VideoCommon/Src/PixelShaderGen.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp index 6cc3029ff2..1c5a615f8e 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp @@ -33,8 +33,9 @@ PIXELSHADERUID last_pixel_shader_uid; // are set... void GetPixelShaderId(PIXELSHADERUID *uid, u32 texturemask, u32 dstAlphaEnable) { + u32 numstages = bpmem.genMode.numtevstages + 1; u32 projtexcoords = 0; - for (u32 i = 0; i < (u32)bpmem.genMode.numtevstages + 1; i++) + for (u32 i = 0; i < numstages; i++) { if (bpmem.tevorders[i/2].getEnable(i & 1)) { @@ -66,7 +67,7 @@ void GetPixelShaderId(PIXELSHADERUID *uid, u32 texturemask, u32 dstAlphaEnable) int hdr = 4; u32 *pcurvalue = &uid->values[hdr]; - for (u32 i = 0; i < (u32)bpmem.genMode.numtevstages + 1; ++i) + for (u32 i = 0; i < numstages; ++i) { TevStageCombiner::ColorCombiner &cc = bpmem.combiners[i].colorC; TevStageCombiner::AlphaCombiner &ac = bpmem.combiners[i].alphaC; @@ -80,7 +81,7 @@ void GetPixelShaderId(PIXELSHADERUID *uid, u32 texturemask, u32 dstAlphaEnable) pcurvalue += 2; } - for (u32 i = 0; i < ((u32)bpmem.genMode.numtevstages+1) / 2; ++i) + for (u32 i = 0; i < numstages / 2; ++i) { u32 val0, val1; if (bpmem.tevorders[i].hex & 0x40) @@ -100,7 +101,7 @@ void GetPixelShaderId(PIXELSHADERUID *uid, u32 texturemask, u32 dstAlphaEnable) } } - if ((bpmem.genMode.numtevstages + 1) & 1) { // odd + if (numstages & 1) { // odd u32 val0; if (bpmem.tevorders[bpmem.genMode.numtevstages/2].hex & 0x40) val0 = bpmem.tevorders[bpmem.genMode.numtevstages/2].hex & 0x3ff; |
