From 6b8d9e1bb0e442a5c1cbcff5d9527e62404ffbdc Mon Sep 17 00:00:00 2001 From: gigaherz Date: Fri, 8 Aug 2008 17:30:47 +0000 Subject: [PATCH] TextFmt Overlay v4. :p git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@151 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../Core/VideoCommon/Src/TextureDecoder.cpp | 1193 ++++++++++------- Source/Core/VideoCommon/Src/TextureDecoder.h | 2 +- 2 files changed, 708 insertions(+), 487 deletions(-) diff --git a/Source/Core/VideoCommon/Src/TextureDecoder.cpp b/Source/Core/VideoCommon/Src/TextureDecoder.cpp index 8d03fea049..f693ccbfcb 100644 --- a/Source/Core/VideoCommon/Src/TextureDecoder.cpp +++ b/Source/Core/VideoCommon/Src/TextureDecoder.cpp @@ -460,13 +460,13 @@ void TexDecoder_SetTexFmtOverlayOptions(bool enable, bool center) #ifdef OVERLAY_TEXFMT extern const char* texfmt[]; extern const unsigned char sfont_map[]; -extern const unsigned char sfont_raw[]; +extern const unsigned char sfont_raw[][9*10]; PC_TexFormat TexDecoder_Decode(u8 *dst, u8 *src, int width, int height, int texformat, int tlutaddr, int tlutfmt) { PC_TexFormat retval = TexDecoder_Decode_real(dst,src,width,height,texformat,tlutaddr,tlutfmt); - if((!TexFmt_Overlay_Enable)/*||(retval==PC_TEX_FMT_NONE)*/) + if((!TexFmt_Overlay_Enable)||(retval==PC_TEX_FMT_NONE)) return retval; // assume ABGR/ARGB (32bit) @@ -490,21 +490,21 @@ PC_TexFormat TexDecoder_Decode(u8 *dst, u8 *src, int width, int height, int texf int xcnt = 0; int nchar = sfont_map[*fmt]; - const unsigned char *ptr = sfont_raw + (nchar * 10 * 9); // each char is up to 9x10 + const unsigned char *ptr = sfont_raw[nchar]; // each char is up to 9x10 + for(int x=0;x<9;x++) + { + if(ptr[x]==0x78) + break; + xcnt++; + } for(int y=0;y<10;y++) { - for(int x=0;x<9;x++) + for(int x=0;x