From 7f6284c2fcea9d543b0eec44ea0f3ad36bd0c0aa Mon Sep 17 00:00:00 2001 From: comex Date: Thu, 2 Oct 2014 02:20:46 -0400 Subject: Change a bunch of reference function arguments to pointers. Per the coding style and sanity. --- Source/Core/VideoBackends/Software/Rasterizer.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'Source/Core/VideoBackends/Software/Rasterizer.cpp') diff --git a/Source/Core/VideoBackends/Software/Rasterizer.cpp b/Source/Core/VideoBackends/Software/Rasterizer.cpp index 4220bbb005..5e8fdffd50 100644 --- a/Source/Core/VideoBackends/Software/Rasterizer.cpp +++ b/Source/Core/VideoBackends/Software/Rasterizer.cpp @@ -210,7 +210,7 @@ static void InitSlope(Slope *slope, float f1, float f2, float f3, float DX31, fl slope->f0 = f1; } -static inline void CalculateLOD(s32 &lod, bool &linear, u32 texmap, u32 texcoord) +static inline void CalculateLOD(s32* lodp, bool* linear, u32 texmap, u32 texcoord) { FourTexUnits& texUnit = bpmem.tex[(texmap >> 2) & 1]; u8 subTexmap = texmap & 3; @@ -240,20 +240,21 @@ static inline void CalculateLOD(s32 &lod, bool &linear, u32 texmap, u32 texcoord } // get LOD in s28.4 - lod = FixedLog2(std::max(sDelta, tDelta)); + s32 lod = FixedLog2(std::max(sDelta, tDelta)); // bias is s2.5 int bias = tm0.lod_bias; bias >>= 1; lod += bias; - linear = ((lod > 0 && (tm0.min_filter & 4)) || (lod <= 0 && tm0.mag_filter)); + *linear = ((lod > 0 && (tm0.min_filter & 4)) || (lod <= 0 && tm0.mag_filter)); // order of checks matters // should be: // if lod > max then max // else if lod < min then min lod = CLAMP(lod, (s32)tm1.min_lod, (s32)tm1.max_lod); + *lodp = lod; } static void BuildBlock(s32 blockX, s32 blockY) @@ -295,7 +296,7 @@ static void BuildBlock(s32 blockX, s32 blockY) u32 texcoord = indref & 3; indref >>= 3; - CalculateLOD(rasterBlock.IndirectLod[i], rasterBlock.IndirectLinear[i], texmap, texcoord); + CalculateLOD(&rasterBlock.IndirectLod[i], &rasterBlock.IndirectLinear[i], texmap, texcoord); } for (unsigned int i = 0; i <= bpmem.genMode.numtevstages; i++) @@ -307,7 +308,7 @@ static void BuildBlock(s32 blockX, s32 blockY) u32 texmap = order.getTexMap(stageOdd); u32 texcoord = order.getTexCoord(stageOdd); - CalculateLOD(rasterBlock.TextureLod[i], rasterBlock.TextureLinear[i], texmap, texcoord); + CalculateLOD(&rasterBlock.TextureLod[i], &rasterBlock.TextureLinear[i], texmap, texcoord); } } } -- cgit v1.2.3