summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Src/TextureDecoder.cpp
diff options
context:
space:
mode:
authorhrydgard <hrydgard@gmail.com>2009-05-11 19:04:46 +0000
committerhrydgard <hrydgard@gmail.com>2009-05-11 19:04:46 +0000
commite7af5a31bdef782fd858bced85fab877c3afa5b3 (patch)
treec0e87da56048d49d847e2617b932eebcf0a10c24 /Source/Core/VideoCommon/Src/TextureDecoder.cpp
parent683a042ebc3d1550bcb24da4a2f95a834cf376ff (diff)
Disable PC-native DXT texturing. Too many problems for now.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3203 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/VideoCommon/Src/TextureDecoder.cpp')
-rw-r--r--Source/Core/VideoCommon/Src/TextureDecoder.cpp29
1 files changed, 26 insertions, 3 deletions
diff --git a/Source/Core/VideoCommon/Src/TextureDecoder.cpp b/Source/Core/VideoCommon/Src/TextureDecoder.cpp
index 79f1527f42..37a0aef0d9 100644
--- a/Source/Core/VideoCommon/Src/TextureDecoder.cpp
+++ b/Source/Core/VideoCommon/Src/TextureDecoder.cpp
@@ -470,8 +470,13 @@ PC_TexFormat TexDecoder_Decode_real(u8 *dst, const u8 *src, int width, int heigh
}
return PC_TEX_FMT_BGRA32;
case GX_TF_CMPR: // speed critical
+ // The metroid games use this format almost exclusively.
{
- for (int y = 0; y < height; y += 8)
+#if 0 // TODO - currently does not handle transparency correctly and causes problems when texture dimensions are not multiples of 8
+ // 11111111 22222222 55555555 66666666
+ // 33333333 44444444 77777777 88888888
+ for (int y = 0; y < height; y += 8)
+ {
for (int x = 0; x < width; x += 8)
{
copyDXTBlock(dst+(y/2)*width+x*2, src);
@@ -482,9 +487,27 @@ PC_TexFormat TexDecoder_Decode_real(u8 *dst, const u8 *src, int width, int heigh
src += 8;
copyDXTBlock(dst+(y/2+2)*width+x*2+8, src);
src += 8;
+ }
+ }
+ return PC_TEX_FMT_DXT1;
+#else
+ for (int y = 0; y < height; y += 8)
+ {
+ for (int x = 0; x < width; x += 8)
+ {
+ decodeDXTBlock((u32*)dst+y*width+x, (DXTBlock*)src, width);
+ src += sizeof(DXTBlock);
+ decodeDXTBlock((u32*)dst+y*width+x+4, (DXTBlock*)src, width);
+ src += sizeof(DXTBlock);
+ decodeDXTBlock((u32*)dst+(y+4)*width+x, (DXTBlock*)src, width);
+ src += sizeof(DXTBlock);
+ decodeDXTBlock((u32*)dst+(y+4)*width+x+4, (DXTBlock*)src, width);
+ src += sizeof(DXTBlock);
}
- }
- return PC_TEX_FMT_DXT1;
+ }
+#endif
+ return PC_TEX_FMT_BGRA32;
+ }
}
// The "copy" texture formats, too?