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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Mon Sep 18 23:32:06 CEST 2006


Revision: 23935
          http://svn.sourceforge.net/scummvm/?rev=23935&view=rev
Author:   fingolfin
Date:     2006-09-18 14:31:59 -0700 (Mon, 18 Sep 2006)

Log Message:
-----------
Split setBuiltinCursor into a V0-V2 and a V3-V5 part

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

Modified: scummvm/trunk/engines/scumm/cursor.cpp
===================================================================
--- scummvm/trunk/engines/scumm/cursor.cpp	2006-09-18 21:20:21 UTC (rev 23934)
+++ scummvm/trunk/engines/scumm/cursor.cpp	2006-09-18 21:31:59 UTC (rev 23935)
@@ -361,7 +361,7 @@
 	_cursorHotspots[index * 2 + 1] = y;
 }
 
-void ScummEngine_v5::setBuiltinCursor(int idx) {
+void ScummEngine_v2::setBuiltinCursor(int idx) {
 	int i, j;
 	byte color;
 
@@ -389,7 +389,7 @@
 				*dst++ = palette[((c0 >> (7 - j)) & 1) | (((c1 >> (7 - j)) & 1) << 1) | ((idx == 3) ? 4 : 0)];
 		}
 
-	} else if (_game.version <= 2 && _game.platform == Common::kPlatformAmiga) {
+	} else if (_game.platform == Common::kPlatformAmiga) {
 		_cursor.width = 15;
 		_cursor.height = 15;
 		_cursor.hotspotX = 7;
@@ -418,7 +418,7 @@
 			*(hotspot - _cursor.width * (3 + i) + i) = color;
 			*(hotspot + _cursor.width * (3 + i) + i) = color;
 		}
-	} else if (_game.version <= 2) {
+	} else {
 		_cursor.width = 23;
 		_cursor.height = 21;
 		_cursor.hotspotX = 11;
@@ -463,21 +463,27 @@
 		*(hotspot - (_cursor.width * 5) + 1) = color;
 		*(hotspot + (_cursor.width * 5) - 1) = color;
 		*(hotspot + (_cursor.width * 5) + 1) = color;
-	} else {
-		const uint16 *src;
+	}
 
-		_cursor.hotspotX = _cursorHotspots[2 * _currentCursor];
-		_cursor.hotspotY = _cursorHotspots[2 * _currentCursor + 1];
-		src = _cursorImages[_currentCursor];
+	updateCursor();
+}
 
-		_cursor.width = 16;
-		_cursor.height = 16;
+void ScummEngine_v5::setBuiltinCursor(int idx) {
+	int i, j;
+	byte color = default_cursor_colors[idx];
+	const uint16 *src = _cursorImages[_currentCursor];
 
-		for (i = 0; i < 16; i++) {
-			for (j = 0; j < 16; j++) {
-				if (src[i] & (1 << j))
-					_grabbedCursor[16 * i + 15 - j] = color;
-			}
+	memset(_grabbedCursor, 0xFF, sizeof(_grabbedCursor));
+
+	_cursor.hotspotX = _cursorHotspots[2 * _currentCursor];
+	_cursor.hotspotY = _cursorHotspots[2 * _currentCursor + 1];
+	_cursor.width = 16;
+	_cursor.height = 16;
+
+	for (i = 0; i < 16; i++) {
+		for (j = 0; j < 16; j++) {
+			if (src[i] & (1 << j))
+				_grabbedCursor[16 * i + 15 - j] = color;
 		}
 	}
 

Modified: scummvm/trunk/engines/scumm/intern.h
===================================================================
--- scummvm/trunk/engines/scumm/intern.h	2006-09-18 21:20:21 UTC (rev 23934)
+++ scummvm/trunk/engines/scumm/intern.h	2006-09-18 21:31:59 UTC (rev 23935)
@@ -85,7 +85,7 @@
 
 	virtual void animateCursor();
 
-	void setBuiltinCursor(int index);
+	virtual void setBuiltinCursor(int index);
 	void redefineBuiltinCursorFromChar(int index, int chr);
 	void redefineBuiltinCursorHotspot(int index, int x, int y);
 
@@ -314,6 +314,8 @@
 	void initV2MouseOver();
 	void initNESMouseOver();
 
+	virtual void setBuiltinCursor(int index);
+
 	void runObject(int obj, int entry);
 
 	/* Version 2 script opcodes */


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