Fix lens flares in Mario Kart Wii.

This commit is contained in:
Scott Mansell
2015-12-01 05:07:36 +13:00
parent 02d5981b22
commit 03461915a7
4 changed files with 62 additions and 5 deletions

View File

@ -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;