diff options
| author | Scott Mansell <phiren@gmail.com> | 2015-12-01 05:07:36 +1300 |
|---|---|---|
| committer | Scott Mansell <phiren@gmail.com> | 2015-12-01 05:25:38 +1300 |
| commit | 03461915a7aa7ac5f5ba058dcf51c4474279d819 (patch) | |
| tree | b861d326bd4b1c95571f3c2155c61b05feeda8d9 /Source/Core/VideoCommon/TextureDecoder_Common.cpp | |
| parent | 02d5981b226c356347841e04367cf6284d9738a6 (diff) | |
Fix lens flares in Mario Kart Wii.
Diffstat (limited to 'Source/Core/VideoCommon/TextureDecoder_Common.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/TextureDecoder_Common.cpp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/TextureDecoder_Common.cpp b/Source/Core/VideoCommon/TextureDecoder_Common.cpp index 5f8f314a0b..a37abe6e7e 100644 --- a/Source/Core/VideoCommon/TextureDecoder_Common.cpp +++ b/Source/Core/VideoCommon/TextureDecoder_Common.cpp @@ -156,6 +156,58 @@ int TexDecoder_GetPaletteSize(int format) } } +// Get the "in memory" texture format of an EFB copy's format. +// With the exception of c4/c8/c14 paletted texture formats (which are handled elsewhere) +// this is the format the game should be using when it is drawing an EFB copy back. +int TexDecoder_GetEfbCopyBaseFormat(int format) +{ + switch (format) + { + case GX_TF_I4: + case GX_CTF_Z4: + case GX_CTF_R4: + return GX_TF_I4; + case GX_TF_I8: + case GX_CTF_A8: + case GX_CTF_R8: + case GX_CTF_G8: + case GX_CTF_B8: + case GX_TF_Z8: + case GX_CTF_Z8H: + case GX_CTF_Z8M: + case GX_CTF_Z8L: + return GX_TF_I8; + case GX_TF_IA4: + case GX_CTF_RA4: + return GX_TF_IA4; + case GX_TF_IA8: + case GX_TF_Z16: + case GX_CTF_RA8: + case GX_CTF_RG8: + case GX_CTF_GB8: + case GX_CTF_Z16R: + case GX_CTF_Z16L: + return GX_TF_IA8; + case GX_TF_RGB565: + return GX_TF_RGB565; + case GX_TF_RGB5A3: + return GX_TF_RGB5A3; + case GX_TF_RGBA8: + case GX_TF_Z24X8: + case GX_CTF_YUVA8: + return GX_TF_RGBA8; + // These formats can't be (directly) generated by EFB copies + case GX_TF_C4: + case GX_TF_C8: + case GX_TF_C14X2: + case GX_TF_CMPR: + default: + PanicAlert("Unsupported Texture Format (%08x)! (GetEfbCopyBaseFormat)", format); + return format & 0xf; + } +} + + void TexDecoder_SetTexFmtOverlayOptions(bool enable, bool center) { TexFmt_Overlay_Enable = enable; |
