Merge pull request #1543 from unknownbrackets/texcache

Mask clut indexes for > 8-bit clut indexes.
This commit is contained in:
Henrik Rydgård 2013-04-27 01:50:53 -07:00
commit b5d6ba33b1

View File

@ -243,8 +243,14 @@ inline void DeIndexTexture(ClutT *dest, const IndexT *indexed, int length, const
const bool nakedIndex = (gstate.clutformat & ~3) == 0xC500FF00;
if (nakedIndex) {
for (int i = 0; i < length; ++i) {
*dest++ = clut[*indexed++];
if (sizeof(IndexT) == 1) {
for (int i = 0; i < length; ++i) {
*dest++ = clut[*indexed++];
}
} else {
for (int i = 0; i < length; ++i) {
*dest++ = clut[(*indexed++) & 0xFF];
}
}
} else {
for (int i = 0; i < length; ++i) {