diff options
author | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2015-02-25 23:05:14 -0300 |
---|---|---|
committer | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2015-02-25 23:05:14 -0300 |
commit | ea3c99f3a2422c98f383df0881348b1b4a3c91d2 (patch) | |
tree | a159087da1d5d57754524150b265cdbbcc03aebc /src | |
parent | 1b5ee96797e7f3fb334ea60e0c37d356929638e8 (diff) |
Video core: Fix A4 texture decoding
It was trying to take the LSB from `coarse_x`, which would always be 0
and thus would always return the same texel from each byte. To add
insult to the injury, the conditional was actually the wrong way around
too.
Fixes blocky text in OoT.
Diffstat (limited to 'src')
-rw-r--r-- | src/video_core/debug_utils/debug_utils.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/video_core/debug_utils/debug_utils.cpp b/src/video_core/debug_utils/debug_utils.cpp index 7954494231..f436aa5410 100644 --- a/src/video_core/debug_utils/debug_utils.cpp +++ b/src/video_core/debug_utils/debug_utils.cpp @@ -436,9 +436,9 @@ const Math::Vec4<u8> LookupTexture(const u8* source, int x, int y, const Texture case Regs::TextureFormat::A4: { - const u8* source_ptr = source + offset / 2 + i / 2; + const u8* source_ptr = source + (offset + i) / 2; - u8 a = (coarse_x % 2) ? ((*source_ptr)&0xF) : (((*source_ptr) & 0xF0) >> 4); + u8 a = (i % 2) ? ((*source_ptr & 0xF0) >> 4) : (*source_ptr & 0xF); a = Color::Convert4To8(a); if (disable_alpha) { |