From 949b873dc8164a9cbfdb48d687263da95b4bfc66 Mon Sep 17 00:00:00 2001 From: Soren Jorvang Date: Fri, 23 Jul 2010 23:51:34 +0000 Subject: Further *BSD portability. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5958 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/VideoCommon/Src/PixelShaderGen.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Source/Core/VideoCommon') 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; -- cgit v1.2.3