From bfb2c04ace044b734a8341a929c2456da82a229f Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Sun, 10 Aug 2014 13:59:47 -0400 Subject: [PATCH] TextureDecoder: Remove unused function GetPC_TexFormat was never used. It was added in commit d02426a, with the only user being commented out code. The commented out code was later removed in 9893122, but the implementation stayed. --- Source/Core/VideoCommon/TextureDecoder.h | 1 - .../VideoCommon/TextureDecoder_Generic.cpp | 48 ------------------- .../Core/VideoCommon/TextureDecoder_x64.cpp | 47 ------------------ 3 files changed, 96 deletions(-) diff --git a/Source/Core/VideoCommon/TextureDecoder.h b/Source/Core/VideoCommon/TextureDecoder.h index 45925f7aaf..372c778df1 100644 --- a/Source/Core/VideoCommon/TextureDecoder.h +++ b/Source/Core/VideoCommon/TextureDecoder.h @@ -76,7 +76,6 @@ enum PC_TexFormat }; PC_TexFormat TexDecoder_Decode(u8 *dst, const u8 *src, int width, int height, int texformat, int tlutaddr, int tlutfmt,bool rgbaOnly = false); -PC_TexFormat GetPC_TexFormat(int texformat, int tlutfmt); void TexDecoder_DecodeTexel(u8 *dst, const u8 *src, int s, int t, int imageWidth, int texformat, int tlutaddr, int tlutfmt); void TexDecoder_DecodeTexelRGBA8FromTmem(u8 *dst, const u8 *src_ar, const u8* src_gb, int s, int t, int imageWidth); PC_TexFormat TexDecoder_DecodeRGBA8FromTmem(u8* dst, const u8 *src_ar, const u8 *src_gb, int width, int height); diff --git a/Source/Core/VideoCommon/TextureDecoder_Generic.cpp b/Source/Core/VideoCommon/TextureDecoder_Generic.cpp index 1b5a8a7026..8625b014f2 100644 --- a/Source/Core/VideoCommon/TextureDecoder_Generic.cpp +++ b/Source/Core/VideoCommon/TextureDecoder_Generic.cpp @@ -574,54 +574,6 @@ static void copyDXTBlock(u8* dst, const u8* src) } #endif -static PC_TexFormat GetPCFormatFromTLUTFormat(int tlutfmt) -{ - switch (tlutfmt) - { - case 0: return PC_TEX_FMT_IA8; // IA8 - case 1: return PC_TEX_FMT_RGB565; // RGB565 - case 2: return PC_TEX_FMT_BGRA32; // RGB5A3: This TLUT format requires - // extra work to decode. - } - return PC_TEX_FMT_NONE; // Error -} - -PC_TexFormat GetPC_TexFormat(int texformat, int tlutfmt) -{ - switch (texformat) - { - case GX_TF_C4: - return GetPCFormatFromTLUTFormat(tlutfmt); - case GX_TF_I4: - return PC_TEX_FMT_IA8; - case GX_TF_I8: // speed critical - return PC_TEX_FMT_IA8; - case GX_TF_C8: - return GetPCFormatFromTLUTFormat(tlutfmt); - case GX_TF_IA4: - return PC_TEX_FMT_IA4_AS_IA8; - case GX_TF_IA8: - return PC_TEX_FMT_IA8; - case GX_TF_C14X2: - return GetPCFormatFromTLUTFormat(tlutfmt); - case GX_TF_RGB565: - return PC_TEX_FMT_RGB565; - case GX_TF_RGB5A3: - return PC_TEX_FMT_BGRA32; - case GX_TF_RGBA8: // speed critical - return PC_TEX_FMT_BGRA32; - case GX_TF_CMPR: // speed critical - // The metroid games use this format almost exclusively. - { - return PC_TEX_FMT_BGRA32; - } - } - - // The "copy" texture formats, too? - return PC_TEX_FMT_NONE; -} - - //switch endianness, unswizzle //TODO: to save memory, don't blindly convert everything to argb8888 //also ARGB order needs to be swapped later, to accommodate modern hardware better diff --git a/Source/Core/VideoCommon/TextureDecoder_x64.cpp b/Source/Core/VideoCommon/TextureDecoder_x64.cpp index a31aa3ad3d..66bf5a708b 100644 --- a/Source/Core/VideoCommon/TextureDecoder_x64.cpp +++ b/Source/Core/VideoCommon/TextureDecoder_x64.cpp @@ -622,53 +622,6 @@ static void copyDXTBlock(u8* dst, const u8* src) } #endif -static PC_TexFormat GetPCFormatFromTLUTFormat(int tlutfmt) -{ - switch (tlutfmt) - { - case 0: return PC_TEX_FMT_IA8; // IA8 - case 1: return PC_TEX_FMT_RGB565; // RGB565 - case 2: return PC_TEX_FMT_BGRA32; // RGB5A3: This TLUT format requires - // extra work to decode. - } - return PC_TEX_FMT_NONE; // Error -} - -PC_TexFormat GetPC_TexFormat(int texformat, int tlutfmt) -{ - switch (texformat) - { - case GX_TF_C4: - return GetPCFormatFromTLUTFormat(tlutfmt); - case GX_TF_I4: - return PC_TEX_FMT_IA8; - case GX_TF_I8: // speed critical - return PC_TEX_FMT_IA8; - case GX_TF_C8: - return GetPCFormatFromTLUTFormat(tlutfmt); - case GX_TF_IA4: - return PC_TEX_FMT_IA4_AS_IA8; - case GX_TF_IA8: - return PC_TEX_FMT_IA8; - case GX_TF_C14X2: - return GetPCFormatFromTLUTFormat(tlutfmt); - case GX_TF_RGB565: - return PC_TEX_FMT_RGB565; - case GX_TF_RGB5A3: - return PC_TEX_FMT_BGRA32; - case GX_TF_RGBA8: // speed critical - return PC_TEX_FMT_BGRA32; - case GX_TF_CMPR: // speed critical - // The metroid games use this format almost exclusively. - { - return PC_TEX_FMT_BGRA32; - } - } - - // The "copy" texture formats, too? - return PC_TEX_FMT_NONE; -} - inline void SetOpenMPThreadCount(int width, int height) { #ifdef _OPENMP