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

Hkz at users.sourceforge.net Hkz at users.sourceforge.net
Sun May 24 19:08:03 CEST 2009


Revision: 40869
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40869&view=rev
Author:   Hkz
Date:     2009-05-24 17:08:03 +0000 (Sun, 24 May 2009)

Log Message:
-----------
tinsel: Changes to psx palette conversion function

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

Modified: scummvm/trunk/engines/tinsel/palette.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/palette.cpp	2009-05-24 15:19:28 UTC (rev 40868)
+++ scummvm/trunk/engines/tinsel/palette.cpp	2009-05-24 17:08:03 UTC (rev 40869)
@@ -100,15 +100,15 @@
 	int coloursInPalette = 0;
 
 	// Allocate space for the 16 colour destination palette
-	COLORREF *dstPal = (COLORREF*)calloc(sizeof(COLORREF), MAX_COLOURS);
-	memset(dstPal, 0, MAX_COLOURS * sizeof(COLORREF));
+	COLORREF *dstPal = (COLORREF*)calloc(sizeof(COLORREF), 16);
+	memset(dstPal, 0, 16 * sizeof(COLORREF));
 
-	for (int idx = 0; idx < 0x10; idx++) {
+	for (int idx = 0; idx < 16; idx++) {
 		clutEntry = READ_LE_UINT16(srcClut); // Read PSX CLUT entry
 		srcClut += sizeof(uint16);
 
 		if ((clutEntry == 0) && (coloursInPalette == 0))
-			coloursInPalette++;
+			continue;
 		else if ((clutEntry == 0) && (coloursInPalette != 0)) {
 			*colours = coloursInPalette;
 			return dstPal;


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