[Scummvm-cvs-logs] CVS: scummvm scummvm.cpp,1.192,1.193 script_v2.cpp,1.78,1.79

Jonathan Gray khalek at users.sourceforge.net
Sat Jul 27 18:41:02 CEST 2002


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

Modified Files:
	scummvm.cpp script_v2.cpp 
Log Message:
noir mode refinement by eriktorbjorn

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scummvm.cpp,v
retrieving revision 1.192
retrieving revision 1.193
diff -u -d -r1.192 -r1.193
--- scummvm.cpp	27 Jul 2002 21:06:50 -0000	1.192
+++ scummvm.cpp	28 Jul 2002 01:40:24 -0000	1.193
@@ -1377,11 +1377,11 @@
 	int i;
 	byte *data = _currentPalette + first * 3;
 
+	byte palette_colors[1024],*p = palette_colors;
+
 	// Sam & Max film noir mode
 	if (_gameId == GID_SAMNMAX && readVar(0x8000))
 		desaturatePalette();
-	
-	byte palette_colors[1024],*p = palette_colors;
 	
 	for (i = 0; i != num; i++, data += 3, p+=4) {
 		p[0] = data[0];

Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/script_v2.cpp,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -d -r1.78 -r1.79
--- script_v2.cpp	26 Jul 2002 17:03:03 -0000	1.78
+++ script_v2.cpp	28 Jul 2002 01:40:24 -0000	1.79
@@ -1889,6 +1889,15 @@
 		break;
 
 	case 213:										/* set palette */
+		// One case where this is used is to turn off Sam & Max film
+		// noir mode. Unfortunately it only restores color to the
+		// palette, it doesn't take palette manipulation (darkening,
+		// etc.) into account. So, for instance, if you turn on film
+		// noir mode in Sam & Max's office, turn off the light and turn
+		// off film noir mode, the room will no longer look dark.
+		//
+		// This bug is present in the original interpreter, so it may
+		// not be worth the trouble fixing it.
 		setPalette(pop());
 		break;
 
@@ -2838,9 +2847,23 @@
 
 		case 114:
 			// Sam & Max film noir mode
-			if (_gameId == GID_SAMNMAX)
-				desaturatePalette();
-			else
+			if (_gameId == GID_SAMNMAX) {
+				// At this point ScummVM will already have set
+				// variable 0x8000 to indicate that the game is
+				// in film noir mode. All we have to do here is
+				// to mark the palette as "dirty", and the next
+				// call to updatePalette() will take care of
+				// the rest.
+				//
+				// Actually, for extra bug-compatibility we
+				// should call desaturatePalette() here only,
+				// instead of in updatePalette(). To see the
+				// difference in behaviour, try turning on film
+				// noir mode in Sam & Max's office. The
+				// background will be grayscale, but Sam and
+				// Max themselves will be in color.
+				setDirtyColors(0, 255);
+			} else
 				warning("stub o6_miscOps_114()");
 			break;
 





More information about the Scummvm-git-logs mailing list