aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFabio Battaglia2009-05-25 17:51:11 +0000
committerFabio Battaglia2009-05-25 17:51:11 +0000
commitb9b3f126674301e94d01c4a6a8e0e9d6dccb9f4a (patch)
treead3f5d647633895879d2d14692d9cc1b31370a0e /engines
parent5f7847d88d2c0a98d778ddd42a2f53df39b6a6fc (diff)
downloadscummvm-rg350-b9b3f126674301e94d01c4a6a8e0e9d6dccb9f4a.tar.gz
scummvm-rg350-b9b3f126674301e94d01c4a6a8e0e9d6dccb9f4a.tar.bz2
scummvm-rg350-b9b3f126674301e94d01c4a6a8e0e9d6dccb9f4a.zip
tinsel: avoid unnecessary checks in discworld psx palette remapper
svn-id: r40892
Diffstat (limited to 'engines')
-rw-r--r--engines/tinsel/palette.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/engines/tinsel/palette.cpp b/engines/tinsel/palette.cpp
index d090cfa690..17449f518e 100644
--- a/engines/tinsel/palette.cpp
+++ b/engines/tinsel/palette.cpp
@@ -101,9 +101,15 @@ void psxPaletteMapper(PALQ *originalPal, uint8 *psxClut, byte *mapperTable) {
memset(mapperTable, 0, 16);
- for (int j = 0; j < 16; j++) {
+ for (int j = 1; j < 16; j++) {
clutEntry = READ_LE_UINT16(psxClut + (sizeof(uint16) * j));
if(clutEntry) {
+ if (clutEntry == 0x7EC0) { // This is an already known value, used by the in-game text
+ mapperTable[j] = 232;
+ continue;
+ }
+
+ // Check for correspondent color
for (int i = 0; (i < pal->numColours) && !colorFound; i++) {
// get R G B values in the same way as psx format converters
uint16 psxEquivalent = (uint16)((uint32)(PSXGetRValue(pal->palRGB[i]) >> 3) |
@@ -115,14 +121,9 @@ void psxPaletteMapper(PALQ *originalPal, uint8 *psxClut, byte *mapperTable) {
colorFound = true;
}
}
- // FIXME: This is just to hack around a bug that causes some text to appear
- // black, i still have to find the correct fix for this.
- if(clutEntry == 0x7EC0 && !colorFound) mapperTable[j] = 197;
colorFound = false;
- } else if (!clutEntry && j) { // The rest of the colours are zeroes
+ } else { // The rest of the entries are zeroes
return;
- } else { // Skip first entry
- mapperTable[j] = 0;
}
}
}