[Scummvm-cvs-logs] CVS: scummvm gfx.cpp,1.94,1.95

Max Horn fingolfin at users.sourceforge.net
Mon Jun 3 14:52:02 CEST 2002


Update of /cvsroot/scummvm/scummvm
In directory usw-pr-cvs1:/tmp/cvs-serv29690

Modified Files:
	gfx.cpp 
Log Message:
cleaned up var names in darkenPalette a bit, making it easier to understand

Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gfx.cpp,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -d -r1.94 -r1.95
--- gfx.cpp	23 May 2002 21:22:08 -0000	1.94
+++ gfx.cpp	3 Jun 2002 21:51:11 -0000	1.95
@@ -591,8 +591,6 @@
 		// Just blit screen 0 to the display (i.e. display will be black)
 		setDirtyRange(0, 0, vs->height);
 		updateDirtyScreen(0);
-		/* XXX: EGA_proc4(0); */
-//		warning("EGA_proc4");				/* FIXME */
 		break;
 	case 134:
 		unkScreenEffect5(0);
@@ -2365,41 +2363,41 @@
 	return cptr;
 }
 
-void Scumm::darkenPalette(int a, int b, int c, int d, int e)
+void Scumm::darkenPalette(int startColor, int endColor, int redScale, int greenScale, int blueScale)
 {
-	byte *cptr, *cur;
-	int num;
-	int color;
-
-	cptr = getPalettePtr() + a * 3;
-	cur = _currentPalette + a * 3;
-	if (a <= b) {
-		num = b - a + 1;
+	if (startColor <= endColor) {
+		byte *cptr, *cur;
+		int num;
+		int color;
+	
+		cptr = getPalettePtr() + startColor * 3;
+		cur = _currentPalette + startColor * 3;
+		num = endColor - startColor + 1;
 
 		do {
 			color = *cptr++;
-			if (c != 0xFF)
-				color = color * c / 0xFF;
+			if (redScale != 0xFF)
+				color = color * redScale / 0xFF;
 			if (color > 255)
 				color = 255;
 			*cur++ = color;
 
 			color = *cptr++;
-			if (d != 0xFF)
-				color = color * d / 0xFF;
+			if (greenScale != 0xFF)
+				color = color * greenScale / 0xFF;
 			if (color > 255)
 				color = 255;
 			*cur++ = color;
 
 			color = *cptr++;
-			if (e != 0xFF)
-				color = color * e / 0xFF;
+			if (blueScale != 0xFF)
+				color = color * blueScale / 0xFF;
 			if (color > 255)
 				color = 255;
 			*cur++ = color;
 		} while (--num);
+		setDirtyColors(startColor, endColor);
 	}
-	setDirtyColors(a, b);
 }
 
 void Scumm::grabCursor(int x, int y, int w, int h)





More information about the Scummvm-git-logs mailing list