summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Software/Rasterizer.cpp
diff options
context:
space:
mode:
authorskidau <skidau@gmail.com>2014-10-05 12:14:04 +1100
committerskidau <skidau@gmail.com>2014-10-05 12:14:04 +1100
commit871d308b88235c115e49267ca79e4f1d48fba0f7 (patch)
tree71073098f0902886bbe5271a9d725567de41f3f9 /Source/Core/VideoBackends/Software/Rasterizer.cpp
parent47bf698b70668f72f8495da209ffe68091d89bcf (diff)
parent7f6284c2fcea9d543b0eec44ea0f3ad36bd0c0aa (diff)
Merge pull request #1206 from comex/amperspocalypse
Change a bunch of reference function arguments to pointers.
Diffstat (limited to 'Source/Core/VideoBackends/Software/Rasterizer.cpp')
-rw-r--r--Source/Core/VideoBackends/Software/Rasterizer.cpp11
1 files changed, 6 insertions, 5 deletions
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);
}
}
}