From c2ac9be9b23cde55da95b088e39b5bc5ee65a9f7 Mon Sep 17 00:00:00 2001 From: donkopunchstania Date: Wed, 14 Apr 2010 03:27:45 +0000 Subject: Some video SW clean up and bug fixes. Did a hacky fix for bad light data. Add fog rendering. Add some offsets to make rasterized pixel locations and texture coordinates more accurate. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5361 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../Plugin_VideoSoftware/Src/TextureSampler.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'Source/Plugins/Plugin_VideoSoftware/Src/TextureSampler.cpp') 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); -- cgit v1.2.3