[Scummvm-cvs-logs] SF.net SVN: scummvm:[46066] scummvm/trunk/engines/scumm

Kirben at users.sourceforge.net Kirben at users.sourceforge.net
Sun Nov 22 09:55:36 CET 2009


Revision: 46066
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46066&view=rev
Author:   Kirben
Date:     2009-11-22 08:55:36 +0000 (Sun, 22 Nov 2009)

Log Message:
-----------
Add patch for Tobias, for cursor palette in PCE version of Loom.

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/cursor.cpp
    scummvm/trunk/engines/scumm/palette.cpp
    scummvm/trunk/engines/scumm/scumm.h

Modified: scummvm/trunk/engines/scumm/cursor.cpp
===================================================================
--- scummvm/trunk/engines/scumm/cursor.cpp	2009-11-22 08:49:19 UTC (rev 46065)
+++ scummvm/trunk/engines/scumm/cursor.cpp	2009-11-22 08:55:36 UTC (rev 46066)
@@ -44,6 +44,10 @@
 	1, 1, 12, 11
 };
 
+static const uint16 default_pce_cursor_colors[4] = {
+	0x01FF, 0x016D, 0x0000, 0x0092
+};
+
 static const byte default_cursor_colors[4] = {
 	15, 15, 7, 8
 };
@@ -533,13 +537,22 @@
 
 void ScummEngine_v5::setBuiltinCursor(int idx) {
 	int i, j;
-	byte color = default_cursor_colors[idx];
+	uint16 color;
 	const uint16 *src = _cursorImages[_currentCursor];
 
 	if (_bytesPerPixel == 2) {
+		if (_game.id == GID_LOOM && _game.platform == Common::kPlatformPCEngine) {
+			byte r, g, b;
+			colorPCEToRGB(default_pce_cursor_colors[idx], &r, &g, &b);
+			color = get16BitColor(r, g, b);
+		} else {
+			color = _16BitPalette[default_cursor_colors[idx]];
+		}
+
 		for (i = 0; i < 1024; i++)
 			WRITE_UINT16(_grabbedCursor + i * 2, 0xFF);
 	} else {
+		color = default_cursor_colors[idx];
 		memset(_grabbedCursor, 0xFF, sizeof(_grabbedCursor));
 	}
 
@@ -552,7 +565,7 @@
 		for (j = 0; j < 16; j++) {
 			if (src[i] & (1 << j)) {
 				if (_bytesPerPixel == 2)
-					WRITE_UINT16(_grabbedCursor + 32 * i + (15 - j) * 2, _16BitPalette[color]);
+					WRITE_UINT16(_grabbedCursor + 32 * i + (15 - j) * 2, color);
 				else
 					_grabbedCursor[16 * i + 15 - j] = color;
 			}

Modified: scummvm/trunk/engines/scumm/palette.cpp
===================================================================
--- scummvm/trunk/engines/scumm/palette.cpp	2009-11-22 08:49:19 UTC (rev 46065)
+++ scummvm/trunk/engines/scumm/palette.cpp	2009-11-22 08:55:36 UTC (rev 46066)
@@ -202,7 +202,7 @@
 		setPalColor( index, ptr[0], ptr[1], ptr[2]);
 }
 
-void colorPCEToRGB(uint16 color, byte *r, byte *g, byte *b) {
+void ScummEngine::colorPCEToRGB(uint16 color, byte *r, byte *g, byte *b) {
 	// 3 bits for each color component: 0xgggrrrbbb
 	*b = ((color)      & 0x7) * 0xFF / 0x7;
 	*r = ((color >> 3) & 0x7) * 0xFF / 0x7;

Modified: scummvm/trunk/engines/scumm/scumm.h
===================================================================
--- scummvm/trunk/engines/scumm/scumm.h	2009-11-22 08:49:19 UTC (rev 46065)
+++ scummvm/trunk/engines/scumm/scumm.h	2009-11-22 08:55:36 UTC (rev 46066)
@@ -1050,6 +1050,7 @@
 	uint16 get16BitColor(uint8 r, uint8 g, uint8 b);
 	int remapPaletteColor(int r, int g, int b, int threshold);		// Used by Actor::remapActorPalette
 	void readPCEPalette(const byte **ptr, byte **dest, int numEntries);
+	void colorPCEToRGB(uint16 color, byte *r, byte *g, byte *b);
 	void setPCETextPalette(uint8 color);
 protected:
 	void moveMemInPalRes(int start, int end, byte direction);


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