diff options
| author | Markus Wick <degasus@users.noreply.github.com> | 2015-12-01 09:07:09 +0100 |
|---|---|---|
| committer | Markus Wick <degasus@users.noreply.github.com> | 2015-12-01 09:07:09 +0100 |
| commit | 52204c729620683fac1c1e83b6771fb9974e878e (patch) | |
| tree | 948c8cd3081d07e2663031e3fb63ceea43862e61 /Source/Core/VideoCommon/TextureDecoder_Common.cpp | |
| parent | 8322040c47e87cde407b21633be021ed76d41e5b (diff) | |
| parent | 03461915a7aa7ac5f5ba058dcf51c4474279d819 (diff) | |
Merge pull request #3299 from phire/JJ_Abrams
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; |
