summaryrefslogtreecommitdiff
path: root/Source/Plugins/Plugin_VideoSoftware/Src/TextureSampler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Plugins/Plugin_VideoSoftware/Src/TextureSampler.cpp')
-rw-r--r--Source/Plugins/Plugin_VideoSoftware/Src/TextureSampler.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/TextureSampler.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/TextureSampler.cpp
index 44878e262b..14b0b0a848 100644
--- a/Source/Plugins/Plugin_VideoSoftware/Src/TextureSampler.cpp
+++ b/Source/Plugins/Plugin_VideoSoftware/Src/TextureSampler.cpp
@@ -157,13 +157,17 @@ void SampleMip(s32 s, s32 t, s32 mip, bool linear, u8 texmap, u8 *sample)
}
}
- // integer part of sample location
- int imageS = s >> 7;
- int imageT = t >> 7;
-
if (linear)
{
- // linear sampling
+ // offset linear sampling
+ s -= 64;
+ t -= 64;
+
+ // integer part of sample location
+ int imageS = s >> 7;
+ int imageT = t >> 7;
+
+ // linear sampling
int imageSPlus1 = imageS + 1;
int fractS = s & 0x7f;
@@ -197,6 +201,10 @@ void SampleMip(s32 s, s32 t, s32 mip, bool linear, u8 texmap, u8 *sample)
}
else
{
+ // integer part of sample location
+ int imageS = s >> 7;
+ int imageT = t >> 7;
+
// nearest neighbor sampling
WrapCoord(imageS, tm0.wrap_s, imageWidth);
WrapCoord(imageT, tm0.wrap_t, imageHeight);