diff options
| author | donkopunchstania <donkopunchstania@gmail.com> | 2010-04-14 03:27:45 +0000 |
|---|---|---|
| committer | donkopunchstania <donkopunchstania@gmail.com> | 2010-04-14 03:27:45 +0000 |
| commit | c2ac9be9b23cde55da95b088e39b5bc5ee65a9f7 (patch) | |
| tree | 8524339b18baec4ad1d57e01201181bd23126851 /Source/Plugins/Plugin_VideoSoftware/Src/TextureSampler.cpp | |
| parent | bfe6e92c15ea4ebd25070d1a95f0eca380f2c92b (diff) | |
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
Diffstat (limited to 'Source/Plugins/Plugin_VideoSoftware/Src/TextureSampler.cpp')
| -rw-r--r-- | Source/Plugins/Plugin_VideoSoftware/Src/TextureSampler.cpp | 18 |
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);
|
