[Scummvm-cvs-logs] CVS: scummvm/saga gfx.cpp,1.13,1.14 gfx.h,1.4,1.5

Eugene Sandulenko sev at users.sourceforge.net
Sun May 2 09:33:02 CEST 2004


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

Modified Files:
	gfx.cpp gfx.h 
Log Message:
Make sure cursor is always white


Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/gfx.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- gfx.cpp	2 May 2004 15:59:06 -0000	1.13
+++ gfx.cpp	2 May 2004 16:32:28 -0000	1.14
@@ -904,27 +904,8 @@
 	// 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 (GfxModule.white_index != best_windex) {
-		int white = (best_windex == 255) ? 254 : best_windex;
-
-		// Set up the mouse cursor
-		static byte cursor_img[R_CURSOR_W * R_CURSOR_H] = {
-			255, 255, 255, 0,   255, 255, 255,
-			255, 255, 255, 0,   255, 255, 255,
-			255, 255, 255, 255, 255, 255, 255,
-			0,   0,   255, 255, 255, 0,   0,
-			255, 255, 255, 255, 255, 255, 255,
-			255, 255, 255, 0,   255, 255, 255,
-			255, 255, 255, 0,   255, 255, 255,
-		};
-
-		for (i = 0; i < R_CURSOR_W * R_CURSOR_H; i++) {
-			if (cursor_img[i] != 255)
-				cursor_img[i] = white;
-		}
-
-		_system->setMouseCursor(cursor_img, R_CURSOR_W, R_CURSOR_H, 4, 4);
+		GFX_SetCursor(best_windex);
 	}
 
 	// Set whitest and blackest color indices
@@ -1066,9 +1047,39 @@
 		}
 	}
 
+	// 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 (GfxModule.white_index != best_windex) {
+		GFX_SetCursor(best_windex);
+	}
+
 	_system->setPalette(cur_pal, 0, R_PAL_ENTRIES);
 
 	return R_SUCCESS;
 }
 
+void GFX_SetCursor(int best_white) {
+	int white = (best_white == 255) ? 254 : best_white;
+	int i;
+
+	// Set up the mouse cursor
+	static byte cursor_img[R_CURSOR_W * R_CURSOR_H] = {
+		255, 255, 255, 0,   255, 255, 255,
+		255, 255, 255, 0,   255, 255, 255,
+		255, 255, 255, 255, 255, 255, 255,
+		0,   0,   255, 255, 255, 0,   0,
+		255, 255, 255, 255, 255, 255, 255,
+		255, 255, 255, 0,   255, 255, 255,
+		255, 255, 255, 0,   255, 255, 255,
+	};
+
+	for (i = 0; i < R_CURSOR_W * R_CURSOR_H; i++) {
+		if (cursor_img[i] != 255)
+			cursor_img[i] = white;
+	}
+
+	_system->setMouseCursor(cursor_img, R_CURSOR_W, R_CURSOR_H, 4, 4);
+}
+
 } // End of namespace Saga

Index: gfx.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/gfx.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- gfx.h	2 May 2004 00:00:38 -0000	1.4
+++ gfx.h	2 May 2004 16:32:28 -0000	1.5
@@ -47,6 +47,8 @@
 	int black_index;
 };
 
+void GFX_SetCursor(int best_white);
+
 } // End of namespace Saga
 
 #endif





More information about the Scummvm-git-logs mailing list