diff options
| author | XTra.KrazzY <XTra.KrazzY@gmail.com> | 2009-02-19 01:24:33 +0000 |
|---|---|---|
| committer | XTra.KrazzY <XTra.KrazzY@gmail.com> | 2009-02-19 01:24:33 +0000 |
| commit | c5aed83513357fc7993bb5129a69d651e6feb2d0 (patch) | |
| tree | 5200c8b5ea85d6ea005e6856205b02e111bf67f0 /Source/Core/VideoCommon/Src/TextureDecoder.cpp | |
| parent | 0b1909aed0ffec84ea1d3c3cba896dce786a3b92 (diff) | |
Fixed texture overlays. Can I remove the OVERLAY_TEXFMT definition? It just makes the code look messy.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2306 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/VideoCommon/Src/TextureDecoder.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/Src/TextureDecoder.cpp | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/Source/Core/VideoCommon/Src/TextureDecoder.cpp b/Source/Core/VideoCommon/Src/TextureDecoder.cpp index 252f1843a1..8f3ac0bafd 100644 --- a/Source/Core/VideoCommon/Src/TextureDecoder.cpp +++ b/Source/Core/VideoCommon/Src/TextureDecoder.cpp @@ -21,10 +21,7 @@ #include "CPUDetect.h" #include "TextureDecoder.h" #include "LookUpTables.h" -#include <emmintrin.h> -#ifdef __SSSE3__ -#include <tmmintrin.h> -#endif + //Uncomment this to enable Texture Format ID overlays #define OVERLAY_TEXFMT @@ -506,9 +503,6 @@ PC_TexFormat TexDecoder_Decode(u8 *dst, const u8 *src, int width, int height, in if((!TexFmt_Overlay_Enable)||(retval==PC_TEX_FMT_NONE)) return retval; - // assume ABGR/ARGB (32bit) - int *dtp = (int*)dst; - int w = min(width,40); int h = min(height,10); @@ -539,7 +533,35 @@ PC_TexFormat TexDecoder_Decode(u8 *dst, const u8 *src, int width, int height, in { for(int x=0;x<xcnt;x++) { - dtp[(y+yoff)*width + x+xoff] = ptr[x]?0xFFFFFFFF:0xFF000000; + switch(retval) { + case PC_TEX_FMT_I8: + { + // TODO: Is this an acceptable way to draw in I8? + u8 *dtp = (u8*)dst; + dtp[(y+yoff)*width + x+xoff] = ptr[x]?0xFF:0x88; + break; + } + case PC_TEX_FMT_IA8: + case PC_TEX_FMT_IA4: + { + u16 *dtp = (u16*)dst; + dtp[(y+yoff)*width + x+xoff] = ptr[x]?0xFFFF:0xFF00; + break; + } + case PC_TEX_FMT_RGB565: + { + u16 *dtp = (u16*)dst; + dtp[(y+yoff)*width + x+xoff] = ptr[x]?0xFFFF:0x0000; + break; + } + default: + case PC_TEX_FMT_BGRA32: + { + int *dtp = (int*)dst; + dtp[(y+yoff)*width + x+xoff] = ptr[x]?0xFFFFFFFF:0xFF000000; + break; + } + } } ptr+=9; } |
