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

Hkz at users.sourceforge.net Hkz at users.sourceforge.net
Mon May 25 09:57:38 CEST 2009


Revision: 40879
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40879&view=rev
Author:   Hkz
Date:     2009-05-25 07:57:38 +0000 (Mon, 25 May 2009)

Log Message:
-----------
tinsel: avoid unnecessary iterations in Discworld PSX palette remapper

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

Modified: scummvm/trunk/engines/tinsel/graphics.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/graphics.cpp	2009-05-25 07:42:01 UTC (rev 40878)
+++ scummvm/trunk/engines/tinsel/graphics.cpp	2009-05-25 07:57:38 UTC (rev 40879)
@@ -769,7 +769,6 @@
 						}
 						break;
 					case 0x44: // PSX 4-bit CLUT
-						memset(psxMapperTable, 0, 16);
 						psxPaletteMapper(pObj->pPal, srcPtr + sizeof(uint16), psxMapperTable);
 
 						psxFourBitClut = true;

Modified: scummvm/trunk/engines/tinsel/palette.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/palette.cpp	2009-05-25 07:42:01 UTC (rev 40878)
+++ scummvm/trunk/engines/tinsel/palette.cpp	2009-05-25 07:57:38 UTC (rev 40879)
@@ -99,6 +99,8 @@
 	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 @@
 			// 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;
 		}
 	}


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