Implement new discovery of a larger CLUT than we thought, plus non-shared CLUTs for 8-bit indices.

Not sure yet what limitations apply, regarding using it for even more
16-bit colors, etc...
This commit is contained in:
Henrik Rydgård committed 2022-07-31 10:43:48 +02:00
1 parent f061eadc04
commit 2cb9e09ad3
3 files changed
+10 -6

No files matched your search

+6 -2
View File
@@ -1678,10 +1678,13 @@ CheckAlphaResult TextureCacheCommon::ReadIndexedTex(u8 *out, int outPitch, int l
texptr = (u8 *)tmpTexBuf32_.data();
}
const bool mipmapShareClut = gstate.isClutSharedForMipmaps();
const int clutSharingOffset = mipmapShareClut ? 0 : (level & 1) * 256;
GEPaletteFormat palFormat = (GEPaletteFormat)gstate.getClutPaletteFormat();
const u16 *clut16 = (const u16 *)clutBuf_;
const u32 *clut32 = (const u32 *)clutBuf_;
const u16 *clut16 = (const u16 *)clutBuf_ + clutSharingOffset;
const u32 *clut32 = (const u32 *)clutBuf_ + clutSharingOffset;
if (expandTo32Bit && palFormat != GE_CMODE_32BIT_ABGR8888) {
ConvertFormatToRGBA8888(GEPaletteFormat(palFormat), expandClut_, clut16, 256);
@@ -1721,6 +1724,7 @@ CheckAlphaResult TextureCacheCommon::ReadIndexedTex(u8 *out, int outPitch, int l
case GE_CMODE_32BIT_ABGR8888:
{
switch (bytesPerIndex) {
case 1:
for (int y = 0; y < h; ++y) {