summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Software/TextureSampler.cpp
diff options
context:
space:
mode:
authorcomex <comexk@gmail.com>2014-10-02 02:20:46 -0400
committercomex <comexk@gmail.com>2014-10-02 03:00:33 -0400
commit7f6284c2fcea9d543b0eec44ea0f3ad36bd0c0aa (patch)
treed73cbd161db505d2f2a03751a012790e4a832feb /Source/Core/VideoBackends/Software/TextureSampler.cpp
parentc98a3f62be12a7c6abaa0e1465382fdcb2efbab6 (diff)
Change a bunch of reference function arguments to pointers.
Per the coding style and sanity.
Diffstat (limited to 'Source/Core/VideoBackends/Software/TextureSampler.cpp')
-rw-r--r--Source/Core/VideoBackends/Software/TextureSampler.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/Source/Core/VideoBackends/Software/TextureSampler.cpp b/Source/Core/VideoBackends/Software/TextureSampler.cpp
index 5ac756cc5a..72b72531d6 100644
--- a/Source/Core/VideoBackends/Software/TextureSampler.cpp
+++ b/Source/Core/VideoBackends/Software/TextureSampler.cpp
@@ -16,8 +16,9 @@
namespace TextureSampler
{
-static inline void WrapCoord(int &coord, int wrapMode, int imageSize)
+static inline void WrapCoord(int* coordp, int wrapMode, int imageSize)
{
+ int coord = *coordp;
switch (wrapMode)
{
case 0: // clamp
@@ -37,6 +38,7 @@ static inline void WrapCoord(int &coord, int wrapMode, int imageSize)
}
break;
}
+ *coordp = coord;
}
static inline void SetTexel(u8 *inTexel, u32 *outTexel, u32 fract)
@@ -177,10 +179,10 @@ void SampleMip(s32 s, s32 t, s32 mip, bool linear, u8 texmap, u8 *sample)
u8 sampledTex[4];
u32 texel[4];
- WrapCoord(imageS, tm0.wrap_s, imageWidth);
- WrapCoord(imageT, tm0.wrap_t, imageHeight);
- WrapCoord(imageSPlus1, tm0.wrap_s, imageWidth);
- WrapCoord(imageTPlus1, tm0.wrap_t, imageHeight);
+ WrapCoord(&imageS, tm0.wrap_s, imageWidth);
+ WrapCoord(&imageT, tm0.wrap_t, imageHeight);
+ WrapCoord(&imageSPlus1, tm0.wrap_s, imageWidth);
+ WrapCoord(&imageTPlus1, tm0.wrap_t, imageHeight);
if (!(ti0.format == GX_TF_RGBA8 && texUnit.texImage1[subTexmap].image_type))
{
@@ -223,8 +225,8 @@ void SampleMip(s32 s, s32 t, s32 mip, bool linear, u8 texmap, u8 *sample)
int imageT = t >> 7;
// nearest neighbor sampling
- WrapCoord(imageS, tm0.wrap_s, imageWidth);
- WrapCoord(imageT, tm0.wrap_t, imageHeight);
+ WrapCoord(&imageS, tm0.wrap_s, imageWidth);
+ WrapCoord(&imageT, tm0.wrap_t, imageHeight);
if (!(ti0.format == GX_TF_RGBA8 && texUnit.texImage1[subTexmap].image_type))
TexDecoder_DecodeTexel(sample, imageSrc, imageS, imageT, imageWidth, ti0.format, tlut, tlutfmt);