[Scummvm-cvs-logs] SF.net SVN: scummvm: [22540] scummvm/trunk/gui/newgui.cpp

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Sat May 20 01:30:04 CEST 2006


Revision: 22540
Author:   eriktorbjorn
Date:     2006-05-20 01:29:50 -0700 (Sat, 20 May 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=22540&view=rev

Log Message:
-----------
Set a cursor palette for the classic theme, as well. Otherwise we'll get the
wrong colours in many games.

Modified Paths:
--------------
    scummvm/trunk/gui/newgui.cpp
Modified: scummvm/trunk/gui/newgui.cpp
===================================================================
--- scummvm/trunk/gui/newgui.cpp	2006-05-20 08:06:21 UTC (rev 22539)
+++ scummvm/trunk/gui/newgui.cpp	2006-05-20 08:29:50 UTC (rev 22540)
@@ -146,6 +146,17 @@
 	int i;
 	bool useStandardCurs = !_theme->ownCursor();
 
+	if (useStandardCurs) {
+		const byte palette[] = {
+			255, 255, 255, 0,
+			255, 255, 255, 0,
+			171, 171, 171, 0,
+			 87,  87,  87, 0
+		};
+
+		_system->setCursorPalette(palette, 0, 4);
+	}
+
 	while (!_dialogStack.empty() && activeDialog == _dialogStack.top()) {
 		activeDialog->handleTickle();
 
@@ -305,21 +316,17 @@
 	_needRedraw = true;
 }
 
-//
-// Draw the mouse cursor (animated). This is mostly ripped from the cursor code in gfx.cpp
-// We could plug in a different cursor here if we like to.
-//
+// Draw the mouse cursor (animated). This is pretty much the same as in old
+// SCUMM games, but the code no longer resembles what we have in cursor.cpp
+// very much. We could plug in a different cursor here if we like to.
+
 void NewGui::animateCursor() {
 	int time = _system->getMillis();
 	if (time > _cursorAnimateTimer + kCursorAnimateDelay) {
-		const byte colors[4] = { 15, 15, 7, 8 };
-		const byte color = colors[_cursorAnimateCounter];
-		int i;
-
-		for (i = 0; i < 15; i++) {
+		for (int i = 0; i < 15; i++) {
 			if ((i < 6) || (i > 8)) {
-				_cursor[16 * 7 + i] = color;
-				_cursor[16 * i + 7] = color;
+				_cursor[16 * 7 + i] = _cursorAnimateCounter;
+				_cursor[16 * i + 7] = _cursorAnimateCounter;
 			}
 		}
 


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