From fcd4ecc94265cc95bf939e517f378447c47df703 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Sun, 10 Aug 2014 15:04:29 -0400 Subject: TextureDecoder: Add an enum for the TLUT formats Quick code cleanup. The enum names and values come from libogc. --- Source/Core/VideoCommon/TextureDecoder_Common.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'Source/Core/VideoCommon/TextureDecoder_Common.cpp') diff --git a/Source/Core/VideoCommon/TextureDecoder_Common.cpp b/Source/Core/VideoCommon/TextureDecoder_Common.cpp index 63e6dc672e..4cb8167104 100644 --- a/Source/Core/VideoCommon/TextureDecoder_Common.cpp +++ b/Source/Core/VideoCommon/TextureDecoder_Common.cpp @@ -242,7 +242,7 @@ static void TexDecoder_DrawOverlay(u8 *dst, int width, int height, int texformat } } -PC_TexFormat TexDecoder_Decode(u8 *dst, const u8 *src, int width, int height, int texformat, int tlutaddr, int tlutfmt) +PC_TexFormat TexDecoder_Decode(u8 *dst, const u8 *src, int width, int height, int texformat, int tlutaddr, TlutFormat tlutfmt) { PC_TexFormat pc_texformat = _TexDecoder_DecodeImpl((u32*)dst, src, width, height, texformat, tlutaddr, tlutfmt); @@ -301,7 +301,7 @@ struct DXTBlock u8 lines[4]; }; -void TexDecoder_DecodeTexel(u8 *dst, const u8 *src, int s, int t, int imageWidth, int texformat, int tlutaddr, int tlutfmt) +void TexDecoder_DecodeTexel(u8 *dst, const u8 *src, int s, int t, int imageWidth, int texformat, int tlutaddr, TlutFormat tlutfmt) { /* General formula for computing texture offset // @@ -334,13 +334,13 @@ void TexDecoder_DecodeTexel(u8 *dst, const u8 *src, int s, int t, int imageWidth switch (tlutfmt) { - case 0: + case GX_TL_IA8: *((u32*)dst) = decodeIA8Swapped(tlut[val]); break; - case 1: + case GX_TL_RGB565: *((u32*)dst) = decode565RGBA(Common::swap16(tlut[val])); break; - case 2: + case GX_TL_RGB5A3: *((u32*)dst) = decode5A3RGBA(Common::swap16(tlut[val])); break; } @@ -399,13 +399,13 @@ void TexDecoder_DecodeTexel(u8 *dst, const u8 *src, int s, int t, int imageWidth switch (tlutfmt) { - case 0: + case GX_TL_IA8: *((u32*)dst) = decodeIA8Swapped(tlut[val]); break; - case 1: + case GX_TL_RGB565: *((u32*)dst) = decode565RGBA(Common::swap16(tlut[val])); break; - case 2: + case GX_TL_RGB5A3: *((u32*)dst) = decode5A3RGBA(Common::swap16(tlut[val])); break; } @@ -464,13 +464,13 @@ void TexDecoder_DecodeTexel(u8 *dst, const u8 *src, int s, int t, int imageWidth switch (tlutfmt) { - case 0: + case GX_TL_IA8: *((u32*)dst) = decodeIA8Swapped(tlut[val]); break; - case 1: + case GX_TL_RGB565: *((u32*)dst) = decode565RGBA(Common::swap16(tlut[val])); break; - case 2: + case GX_TL_RGB5A3: *((u32*)dst) = decode5A3RGBA(Common::swap16(tlut[val])); break; } -- cgit v1.2.3