[Scummvm-cvs-logs] CVS: scummvm/saga gfx.cpp,1.41,1.42 gfx.h,1.21,1.22

Torbjörn Andersson eriktorbjorn at users.sourceforge.net
Sat Jan 15 05:43:10 CET 2005


Update of /cvsroot/scummvm/scummvm/saga
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17707

Modified Files:
	gfx.cpp gfx.h 
Log Message:
Use the same hard-coded cursor image and colours as the original ITE
interpreter. Supposedly these colours will stay fairly constant throughout
the game, in which case we no longer need to repaint it with the "best
white" colour every time the palette changes.


Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/gfx.cpp,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- gfx.cpp	6 Jan 2005 16:07:45 -0000	1.41
+++ gfx.cpp	15 Jan 2005 13:41:57 -0000	1.42
@@ -63,7 +63,7 @@
 	_black_index = -1;
 
 	// For now, always show the mouse cursor.
-	setCursor(1);
+	setCursor();
 	_system->showMouse(true);
 }
 
@@ -828,13 +828,6 @@
 		}
 	}
 
-	// When the palette changes, make sure the cursor colours are still
-	// correct. We may have to reconsider this code later, but for now
-	// there is only one cursor image.
-	if (_white_index != best_windex) {
-		setCursor(best_windex);
-	}
-
 	// Set whitest and blackest color indices
 	_white_index = best_windex;
 	_black_index = best_bindex;
@@ -974,13 +967,6 @@
 		}
 	}
 
-	// When the palette changes, make sure the cursor colours are still
-	// correct. We may have to reconsider this code later, but for now
-	// there is only one cursor image.
-	if (_white_index != best_windex) {
-		setCursor(best_windex);
-	}
-
 	_system->setPalette(_cur_pal, 0, PAL_ENTRIES);
 
 	return SUCCESS;
@@ -991,29 +977,19 @@
 	g_system->showMouse(state);
 }
 
-void Gfx::setCursor(int best_white) {
-	int i;
-	byte keycolor = (best_white == 0) ? 1 : 0;
-
+void Gfx::setCursor() {
 	// Set up the mouse cursor
 	byte cursor_img[CURSOR_W * CURSOR_H] = {
-		  0,   0,   0, 255,   0,   0,   0,
-		  0,   0,   0, 255,   0,   0,   0,
-		  0,   0,   0,   0,   0,   0,   0,
-		255, 255,   0,   0,   0, 255, 255,
-		  0,   0,   0,   0,   0,   0,   0,
-		  0,   0,   0, 255,   0,   0,   0,
-		  0,   0,   0, 255,   0,   0,   0,
+		0, 0, 0, 4, 0, 0, 0,
+		0, 0, 0, 4, 0, 0, 0,
+		0, 0, 0, 4, 0, 0, 0,
+		4, 4, 4, 2, 4, 4, 4,
+		0, 0, 0, 4, 0, 0, 0,
+		0, 0, 0, 4, 0, 0, 0,
+		0, 0, 0, 4, 0, 0, 0,
 	};
 
-	for (i = 0; i < CURSOR_W * CURSOR_H; i++) {
-		if (cursor_img[i] != 0)
-			cursor_img[i] = best_white;
-		else
-			cursor_img[i] = keycolor;
-	}
-
-	_system->setMouseCursor(cursor_img, CURSOR_W, CURSOR_H, 4, 4, keycolor);
+	_system->setMouseCursor(cursor_img, CURSOR_W, CURSOR_H, 3, 3, 0);
 }
 
 bool hitTestPoly(const Point *points, unsigned int npoints, const Point& test_point) {

Index: gfx.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/gfx.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- gfx.h	6 Jan 2005 16:07:45 -0000	1.21
+++ gfx.h	15 Jan 2005 13:41:57 -0000	1.22
@@ -107,11 +107,11 @@
 	int getCurrentPal(PALENTRY *src_pal);
 	int palToBlack(SURFACE *surface, PALENTRY *src_pal, double percent);
 	int blackToPal(SURFACE *surface, PALENTRY *src_pal, double percent);
-	void updateCursor() { setCursor(getWhite()); }
+	void updateCursor() { setCursor(); }
 	void showCursor(bool state);
 
 private:
-	void setCursor(int best_white);
+	void setCursor();
 	int _init;
 	SURFACE _back_buf;
 	int _white_index;





More information about the Scummvm-git-logs mailing list