Mask clut indexes for > 8-bit clut indexes.

Fixes #1532.
This commit is contained in:
Unknown W. Brackets committed 2013-04-27 01:19:09 -07:00
1 parent 077a448e9f
commit 9fa4725f67
1 file changed
+8 -2
+8 -2
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) {