aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/tinsel/graphics.cpp1
-rw-r--r--engines/tinsel/palette.cpp6
2 files changed, 5 insertions, 2 deletions
diff --git a/engines/tinsel/graphics.cpp b/engines/tinsel/graphics.cpp
index f66c57590b..42e117aa8f 100644
--- a/engines/tinsel/graphics.cpp
+++ b/engines/tinsel/graphics.cpp
@@ -769,7 +769,6 @@ void DrawObject(DRAWOBJECT *pObj) {
}
break;
case 0x44: // PSX 4-bit CLUT
- memset(psxMapperTable, 0, 16);
psxPaletteMapper(pObj->pPal, srcPtr + sizeof(uint16), psxMapperTable);
psxFourBitClut = true;
diff --git a/engines/tinsel/palette.cpp b/engines/tinsel/palette.cpp
index 6f7b5e5f6b..d090cfa690 100644
--- a/engines/tinsel/palette.cpp
+++ b/engines/tinsel/palette.cpp
@@ -99,6 +99,8 @@ void psxPaletteMapper(PALQ *originalPal, uint8 *psxClut, byte *mapperTable) {
bool colorFound = false;
uint16 clutEntry = 0;
+ memset(mapperTable, 0, 16);
+
for (int j = 0; j < 16; j++) {
clutEntry = READ_LE_UINT16(psxClut + (sizeof(uint16) * j));
if(clutEntry) {
@@ -117,7 +119,9 @@ void psxPaletteMapper(PALQ *originalPal, uint8 *psxClut, byte *mapperTable) {
// black, i still have to find the correct fix for this.
if(clutEntry == 0x7EC0 && !colorFound) mapperTable[j] = 197;
colorFound = false;
- } else {
+ } else if (!clutEntry && j) { // The rest of the colours are zeroes
+ return;
+ } else { // Skip first entry
mapperTable[j] = 0;
}
}