[Scummvm-cvs-logs] CVS: scummvm/scumm palette.cpp,2.6,2.7

Travis Howell kirben at users.sourceforge.net
Tue Jul 13 03:00:33 CEST 2004


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

Modified Files:
	palette.cpp 
Log Message:

More palette changes needed for HE 7.0 games.


Index: palette.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/palette.cpp,v
retrieving revision 2.6
retrieving revision 2.7
diff -u -d -r2.6 -r2.7
--- palette.cpp	11 Jul 2004 03:46:32 -0000	2.6
+++ palette.cpp	13 Jul 2004 09:59:13 -0000	2.7
@@ -588,40 +588,39 @@
 
 	if (startColor <= endColor) {
 		const byte *cptr;
-		byte *cur;
-		int j;
-		int color;
-
-		cptr = getPalettePtr(_curPalIndex) + startColor * 3;
-		cur = _currentPalette + startColor * 3;
+		int color, idx, j;
 
 		for (j = startColor; j <= endColor; j++) {
 			// FIXME: Hack to fix Amiga palette adjustments
-			if ((_features & GF_AMIGA && _version == 5) && (j >= 16 && j < 81)) {
-				cptr += 3;
-				cur += 3;
+			if ((_features & GF_AMIGA && _version == 5) && (j >= 16 && j < 81))
 				continue;
-			}
+
+			idx = (_heversion == 70) ? _HEV7ActorPalette[j] : j;
+			cptr = getPalettePtr(_curPalIndex) + idx * 3;
+
+			if (_heversion == 70)
+				setDirtyColors(idx, idx);
 
 			color = *cptr++;
 			color = color * redScale / 0xFF;
 			if (color > 255)
 				color = 255;
-			*cur++ = color;
+			_currentPalette[idx * 3 + 0] = color;
 
 			color = *cptr++;
 			color = color * greenScale / 0xFF;
 			if (color > 255)
 				color = 255;
-			*cur++ = color;
+			_currentPalette[idx * 3 + 1] = color;
 
 			color = *cptr++;
 			color = color * blueScale / 0xFF;
 			if (color > 255)
 				color = 255;
-			*cur++ = color;
+			_currentPalette[idx * 3 + 2] = color;
 		}
-		setDirtyColors(startColor, endColor);
+		if (_heversion != 70)
+			setDirtyColors(startColor, endColor);
 	}
 }
 
@@ -809,6 +808,9 @@
 }
 
 void ScummEngine::setPalColor(int idx, int r, int g, int b) {
+	if (_heversion == 70)
+		idx = _HEV7ActorPalette[idx];
+
 	_currentPalette[idx * 3 + 0] = r;
 	_currentPalette[idx * 3 + 1] = g;
 	_currentPalette[idx * 3 + 2] = b;





More information about the Scummvm-git-logs mailing list