diff options
| author | XTra.KrazzY <XTra.KrazzY@gmail.com> | 2009-02-13 14:14:45 +0000 |
|---|---|---|
| committer | XTra.KrazzY <XTra.KrazzY@gmail.com> | 2009-02-13 14:14:45 +0000 |
| commit | acb3d1b23d54f9a1065008ba782629e1c3273863 (patch) | |
| tree | 233baa6e2997da552ddffedd16743b9f991399a6 /Source/Core/VideoCommon/Src/TextureDecoder.cpp | |
| parent | a55e672493956e9b6f36c91b5ae3b8aba1d16774 (diff) | |
New compact texture type for OGL/D3D: IA8
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2233 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/VideoCommon/Src/TextureDecoder.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/Src/TextureDecoder.cpp | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/Source/Core/VideoCommon/Src/TextureDecoder.cpp b/Source/Core/VideoCommon/Src/TextureDecoder.cpp index dbb1bad211..9c2daa3f8e 100644 --- a/Source/Core/VideoCommon/Src/TextureDecoder.cpp +++ b/Source/Core/VideoCommon/Src/TextureDecoder.cpp @@ -165,7 +165,7 @@ inline u32 decode5A3(u16 val) g=lut5to8[(val>>5 ) & 0x1f]; b=lut5to8[(val ) & 0x1f]; a=0xFF; - } + } else { a=lut3to8[(val>>12) & 0x7]; @@ -274,13 +274,6 @@ inline void decodebytesIA4(u32 *dst, const u8 *src) } } -//inline void decodebytesIA8(u32 *dst, const u16 *src, int numpixels) -inline void decodebytesIA8(u32 *dst, const u16 *src) -{ - for (int x = 0; x < 4; x++) - dst[x] = decodeIA8(Common::swap16(src[x])); -} - //inline void decodebytesRGB5A3(u32 *dst, const u16 *src, int numpixels) inline void decodebytesRGB5A3(u32 *dst, const u16 *src) { @@ -412,13 +405,17 @@ PC_TexFormat TexDecoder_Decode(u8 *dst, const u8 *src, int width, int height, in return PC_TEX_FMT_BGRA32; case GX_TF_IA8: { - for (int y = 0; y < height; y += 4) - for (int x = 0; x < width; x += 4) - for (int iy = 0; iy < 4; iy++, src += 8) - //decodebytesIA8((u32*)dst+(y+iy)*width+x, (u16*)src, 4); - decodebytesIA8((u32*)dst+(y+iy)*width+x, (u16*)src); + for (int y = 0; y < height; y += 4) + for (int x = 0; x < width; x += 4) + for (int iy = 0; iy < 4; iy++, src += 8) { + u16 *ptr = (u16 *)dst+(y+iy)*width+x; + u16 *s = (u16 *)src; + for(int j = 0; j < 4; j++) + *ptr++ = Common::swap16(*s++); + } + } - return PC_TEX_FMT_BGRA32; + return PC_TEX_FMT_IA8; case GX_TF_C14X2: { for (int y = 0; y < height; y += 4) @@ -463,7 +460,7 @@ PC_TexFormat TexDecoder_Decode(u8 *dst, const u8 *src, int width, int height, in } return PC_TEX_FMT_BGRA32; case GX_TF_CMPR: // speed critical - { + { // TODO: Shuffle to PC S3TC (DXTC) format instead of converting // 11111111 22222222 55555555 66666666 // 33333333 44444444 77777777 88888888 |
