[Scummvm-cvs-logs] SF.net SVN: scummvm: [30651] scummvm/branches/branch-0-11-0/engines/scumm

sev at users.sourceforge.net sev at users.sourceforge.net
Sun Jan 27 16:12:55 CET 2008


Revision: 30651
          http://scummvm.svn.sourceforge.net/scummvm/?rev=30651&view=rev
Author:   sev
Date:     2008-01-27 07:12:55 -0800 (Sun, 27 Jan 2008)

Log Message:
-----------
backport fix for bug #1846886: "PUTTZOO: Windows version cursor/pointer drawn
wrong".  And replace default HE cursor (used in Lost) with correct one.

Modified Paths:
--------------
    scummvm/branches/branch-0-11-0/engines/scumm/cursor.cpp
    scummvm/branches/branch-0-11-0/engines/scumm/he/resource_he.cpp

Modified: scummvm/branches/branch-0-11-0/engines/scumm/cursor.cpp
===================================================================
--- scummvm/branches/branch-0-11-0/engines/scumm/cursor.cpp	2008-01-27 15:10:56 UTC (rev 30650)
+++ scummvm/branches/branch-0-11-0/engines/scumm/cursor.cpp	2008-01-27 15:12:55 UTC (rev 30651)
@@ -48,15 +48,23 @@
 	15, 15, 7, 8
 };
 
-
-static const uint16 default_he_cursor[64] = {
-	0x0000, 0x0000, 0x3800, 0x0000, 0x7e00, 0x0000, 0x5f80, 0x0000,
-	0x5fe0, 0x0000, 0x2ff8, 0x0000, 0x27fe, 0x0000, 0x17ff, 0x8000,
-	0x13ff, 0xe000, 0x09ff, 0xf000, 0x09ff, 0xf800, 0x04ff, 0xf800,
-	0x047f, 0xf000, 0x027f, 0xe000, 0x023f, 0xf000, 0x011f, 0xf800,
-	0x0111, 0xfc00, 0x0080, 0xfc00, 0x0084, 0x0c00, 0x004a, 0x0800,
-	0x0031, 0x1000, 0x0000, 0xe000, 0x0000, 0x0000, 0x0000, 0x0000,
+// 2bpp
+static const uint16 default_he_cursor[128] = {
+	0x0a80, 0x0000, 0x0000, 0x0000, 0x2568, 0x0000, 0x0000, 0x0000,
+	0x9556, 0x8000, 0x0000, 0x0000, 0x9955, 0x6800, 0x0000, 0x0000,
+	0x9955, 0x5680, 0x0000, 0x0000, 0x2655, 0x5568, 0x0000, 0x0000,
+	0x2695, 0x5556, 0x8000, 0x0000, 0x0995, 0x5555, 0x6800, 0x0000,
+	0x09a5, 0x5555, 0x5600, 0x0000, 0x0269, 0x5555, 0x5580, 0x0000,
+	0x0269, 0x5555, 0x5560, 0x0000, 0x009a, 0x5555, 0x5560, 0x0000,
+	0x009a, 0x9555, 0x5580, 0x0000, 0x0026, 0x9555, 0x5600, 0x0000,
+	0x0026, 0xa555, 0x5580, 0x0000, 0x0009, 0xa955, 0x5560, 0x0000,
+	0x0009, 0xa9a9, 0x5558, 0x0000, 0x0002, 0x6aaa, 0x5558, 0x0000,
+	0x0002, 0x6a9a, 0xaa58, 0x0000, 0x0000, 0x9a66, 0xaa60, 0x0000,
+	0x0000, 0x2589, 0xa980, 0x0000, 0x0000, 0x0a02, 0x5600, 0x0000,
+	0x0000, 0x0000, 0xa800, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
 	0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+	0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+	0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
 	0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
 };
 
@@ -155,8 +163,9 @@
 void ScummEngine_v70he::setDefaultCursor() {
 	const uint16 *src;
 	int i, j;
-	static const byte palette[] = { 0xff, 0xff, 0xff, 0,
-							  0,    0,    0,    0};
+	static const byte palette[] = {0,    0,    0,    0, 
+								   0xff, 0xff, 0xff, 0,
+								   0,    0,    0,    0};
 
 	memset(_grabbedCursor, 5, sizeof(_grabbedCursor));
 
@@ -167,18 +176,28 @@
 	_cursor.height = 32;
 
 	for (i = 0; i < 32; i++) {
+		int p = *src;
 		for (j = 0; j < 32; j++) {
-			if (*src & (1 << (15 - (j % 16))))
-				_grabbedCursor[32 * i + j] = 0xfe;
-			if (j == 15)
-				src++;
+			switch ((p & (0x3 << 14)) >> 14) {
+				case 1:
+					_grabbedCursor[32 * i + j] = 0xfe;
+					break;
+				case 2:
+					_grabbedCursor[32 * i + j] = 0xfd;
+					break;
+				default:
+					break;
+			}
+			p <<= 2;
+
+			if ((j + 1) % 8 == 0)
+				p = *(++src);
 		}
-		src++;
 	}
 
 	// Since white color position is not guaranteed
 	// we setup our own palette if supported by backend
-	CursorMan.replaceCursorPalette(palette, 0xfe, 2);
+	CursorMan.replaceCursorPalette(palette, 0xfd, 3);
 
 	updateCursor();
 }

Modified: scummvm/branches/branch-0-11-0/engines/scumm/he/resource_he.cpp
===================================================================
--- scummvm/branches/branch-0-11-0/engines/scumm/he/resource_he.cpp	2008-01-27 15:10:56 UTC (rev 30650)
+++ scummvm/branches/branch-0-11-0/engines/scumm/he/resource_he.cpp	2008-01-27 15:12:55 UTC (rev 30651)
@@ -954,7 +954,7 @@
 							if (color) {
 								cursor[0][width * d + x] = 254; // white
 							} else {
-								cursor[0][width * d + x] = 0; // black
+								cursor[0][width * d + x] = 253; // black
 							}
 						} else {
 							cursor[0][width * d + x] = 255; // transparent


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