summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Src/TextureDecoder.cpp
diff options
context:
space:
mode:
authorXTra.KrazzY <XTra.KrazzY@gmail.com>2009-02-12 22:32:33 +0000
committerXTra.KrazzY <XTra.KrazzY@gmail.com>2009-02-12 22:32:33 +0000
commite557e090ddb4c611b453c47bebccb5465e90c51e (patch)
tree3e2288a75fb1cab3524ec314b6e0a21a15f29ef7 /Source/Core/VideoCommon/Src/TextureDecoder.cpp
parent57c4620902ec2207ea1c38f22a32acfbf1a47700 (diff)
New compact texture type for OGL/D3D: RGB565
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2225 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/VideoCommon/Src/TextureDecoder.cpp')
-rw-r--r--Source/Core/VideoCommon/Src/TextureDecoder.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/Source/Core/VideoCommon/Src/TextureDecoder.cpp b/Source/Core/VideoCommon/Src/TextureDecoder.cpp
index 161c3d6acb..e64e5adbf6 100644
--- a/Source/Core/VideoCommon/Src/TextureDecoder.cpp
+++ b/Source/Core/VideoCommon/Src/TextureDecoder.cpp
@@ -436,14 +436,17 @@ PC_TexFormat TexDecoder_Decode(u8 *dst, const u8 *src, int width, int height, in
}
return PC_TEX_FMT_BGRA32;
case GX_TF_RGB565:
- {
- 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)
- //decodebytesRGB565((u32*)dst+(y+iy)*width+x, (u16*)src, 4);
- decodebytesRGB565((u32*)dst+(y+iy)*width+x, (u16*)src);
- }
- return PC_TEX_FMT_BGRA32;
+ {
+ 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_RGB565;
case GX_TF_RGB5A3:
{
for (int y = 0; y < height; y += 4)