[Scummvm-cvs-logs] SF.net SVN: scummvm:[40892] scummvm/trunk/engines/tinsel/palette.cpp

Hkz at users.sourceforge.net Hkz at users.sourceforge.net
Mon May 25 19:51:11 CEST 2009


Revision: 40892
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40892&view=rev
Author:   Hkz
Date:     2009-05-25 17:51:11 +0000 (Mon, 25 May 2009)

Log Message:
-----------
tinsel: avoid unnecessary checks in discworld psx palette remapper

Modified Paths:
--------------
    scummvm/trunk/engines/tinsel/palette.cpp

Modified: scummvm/trunk/engines/tinsel/palette.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/palette.cpp	2009-05-25 16:30:39 UTC (rev 40891)
+++ scummvm/trunk/engines/tinsel/palette.cpp	2009-05-25 17:51:11 UTC (rev 40892)
@@ -101,9 +101,15 @@
 
 	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 @@
 					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;
 		}
 	}
 }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list