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

Hkz at users.sourceforge.net Hkz at users.sourceforge.net
Wed Jun 3 16:03:06 CEST 2009


Revision: 41138
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41138&view=rev
Author:   Hkz
Date:     2009-06-03 14:03:05 +0000 (Wed, 03 Jun 2009)

Log Message:
-----------
tinsel: removed some warnings related to psx code and cleanup of psx palette remapper function

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

Modified: scummvm/trunk/engines/tinsel/graphics.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/graphics.cpp	2009-06-03 11:38:12 UTC (rev 41137)
+++ scummvm/trunk/engines/tinsel/graphics.cpp	2009-06-03 14:03:05 UTC (rev 41138)
@@ -724,9 +724,9 @@
 	uint8 *destPtr;
 	byte psxMapperTable[16];
 
-	bool psxFourBitClut; // Used by Tinsel PSX, true if an image using a 4bit CLUT is rendered
+	bool psxFourBitClut = false; // Used by Tinsel PSX, true if an image using a 4bit CLUT is rendered
 	bool psxRLEindex = false; // Used by Tinsel PSX, true if an image is using PJCRLE compressed indexes
-	uint32 psxSkipBytes; // Used by Tinsel PSX, number of bytes to skip before counting indexes for image tiles
+	uint32 psxSkipBytes = 0; // Used by Tinsel PSX, number of bytes to skip before counting indexes for image tiles
 
 	if ((pObj->width <= 0) || (pObj->height <= 0))
 		// Empty image, so return immediately

Modified: scummvm/trunk/engines/tinsel/palette.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/palette.cpp	2009-06-03 11:38:12 UTC (rev 41137)
+++ scummvm/trunk/engines/tinsel/palette.cpp	2009-06-03 14:03:05 UTC (rev 41138)
@@ -112,9 +112,7 @@
 			// 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) | 
-									((PSXGetGValue(pal->palRGB[i]) >> 3) << 5) |
-									((PSXGetBValue(pal->palRGB[i]) >> 3) << 10));
+				uint16 psxEquivalent = TINSEL_PSX_RGB(TINSEL_GetRValue(pal->palRGB[i]) >> 3, TINSEL_GetGValue(pal->palRGB[i]) >> 3, TINSEL_GetBValue(pal->palRGB[i]) >> 3); 
 
 				if (psxEquivalent == clutEntry) {
 					mapperTable[j] = i + 1;

Modified: scummvm/trunk/engines/tinsel/palette.h
===================================================================
--- scummvm/trunk/engines/tinsel/palette.h	2009-06-03 11:38:12 UTC (rev 41137)
+++ scummvm/trunk/engines/tinsel/palette.h	2009-06-03 14:03:05 UTC (rev 41138)
@@ -36,12 +36,10 @@
 #define TINSEL_RGB(r,g,b)	((COLORREF)TO_LE_32(((uint8)(r)|((uint16)(g)<<8))|(((uint32)(uint8)(b))<<16)))
 
 #define TINSEL_GetRValue(rgb)	((uint8)(FROM_LE_32(rgb)))
-#define TINSEL_GetGValue(rgb)	((uint8)(((uint16)(FROM_LE_32(rgb))) >> 8))
+#define TINSEL_GetGValue(rgb)	((uint8)(((uint16)(FROM_LE_32(rgb)))>>8))
 #define TINSEL_GetBValue(rgb)	((uint8)((FROM_LE_32(rgb))>>16))
 
-#define PSXGetRValue(rgb)	((uint8)(FROM_LE_32(rgb) & 0x000000f8))
-#define PSXGetGValue(rgb)	((uint8)(FROM_LE_32((rgb) >> 8) & 0x000000f8))
-#define PSXGetBValue(rgb)	((uint8)(FROM_LE_32((rgb) >> 16) & 0x000000f8))
+#define TINSEL_PSX_RGB(r,g,b) ((uint16)TO_LE_16(((uint8)(r))|((uint16)(g)<<5)|(((uint16)(b))<<10)))
 
 enum {
 	MAX_COLOURS		= 256,	//!< maximum number of colours - for VGA 256


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