[Scummvm-cvs-logs] CVS: scummvm/scumm gfx.cpp,2.205,2.206 scummvm.cpp,2.355,2.356

Jamieson Christian jamieson630 at users.sourceforge.net
Thu Aug 28 20:38:03 CEST 2003


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv20144/scummvm/scumm

Modified Files:
	gfx.cpp scummvm.cpp 
Log Message:
Fix for bug [770687] MI1: palette effect missing

Added support for CC resources in small-header
games. Right now this is enabled for monkeyvga
only. loomcd has CC resources but they don't
make any sense, and the game doesn't use palette
effects anyway.

Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 2.205
retrieving revision 2.206
diff -u -d -r2.205 -r2.206
--- gfx.cpp	28 Aug 2003 19:20:30 -0000	2.205
+++ gfx.cpp	29 Aug 2003 03:35:15 -0000	2.206
@@ -2704,20 +2704,39 @@
 
 	memset(_colorCycle, 0, sizeof(_colorCycle));
 
-	while ((j = *ptr++) != 0) {
-		if (j < 1 || j > 16) {
-			error("Invalid color cycle index %d", j);
+	if (_features & GF_SMALL_HEADER) {
+		cycl = _colorCycle;
+		ptr += 6;
+		for (j = 0; j < 16; ++j, ++cycl) {
+			uint16 delay = READ_BE_UINT16(ptr);
+			ptr += 2;
+			byte start = *ptr++;
+			byte end = *ptr++;
+			if (!delay || start >= end)
+				continue;
+
+			cycl->counter = 0;
+			cycl->delay = 16384 / delay;
+			cycl->flags = 2;
+			cycl->start = start;
+			cycl->end = end;
 		}
-		cycl = &_colorCycle[j - 1];
+	} else {
+		while ((j = *ptr++) != 0) {
+			if (j < 1 || j > 16) {
+				error("Invalid color cycle index %d", j);
+			}
+			cycl = &_colorCycle[j - 1];
 
-		ptr += 2;
-		cycl->counter = 0;
-		cycl->delay = 16384 / READ_BE_UINT16(ptr);
-		ptr += 2;
-		cycl->flags = READ_BE_UINT16(ptr);
-		ptr += 2;
-		cycl->start = *ptr++;
-		cycl->end = *ptr++;
+			ptr += 2;
+			cycl->counter = 0;
+			cycl->delay = 16384 / READ_BE_UINT16(ptr);
+			ptr += 2;
+			cycl->flags = READ_BE_UINT16(ptr);
+			ptr += 2;
+			cycl->start = *ptr++;
+			cycl->end = *ptr++;
+		}
 	}
 }
 
@@ -2807,7 +2826,8 @@
 			setDirtyColors(cycl->start, cycl->end);
 			moveMemInPalRes(cycl->start, cycl->end, cycl->flags & 2);
 
-			::cyclePalette(_currentPalette, cycl->start, cycl->end, 3, !(cycl->flags & 2));
+			if (!(_features & GF_SMALL_HEADER && _version > 2))
+				::cyclePalette(_currentPalette, cycl->start, cycl->end, 3, !(cycl->flags & 2));
 
 			// Also cycle the other, indirect palettes
 			if (_proc_special_palette) {

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
retrieving revision 2.355
retrieving revision 2.356
diff -u -d -r2.355 -r2.356
--- scummvm.cpp	29 Aug 2003 02:39:05 -0000	2.355
+++ scummvm.cpp	29 Aug 2003 03:35:15 -0000	2.356
@@ -2238,13 +2238,13 @@
 	}
 
 	// Color cycling
-	if (_features & GF_OLD_BUNDLE)
-		ptr = 0; // TODO / FIXME ???
-	else if (_features & GF_SMALL_HEADER)
-		//TODO loomcd/monkeyega use difference color cycle resource format.
-		ptr = 0;
-	else
+	ptr = 0;
+	if (_features & GF_SMALL_HEADER) {
+		if (_gameId == GID_MONKEY_VGA)
+			ptr = findResourceSmall (MKID('CYCL'), roomptr);
+	} else if (!(_features & GF_OLD_BUNDLE)) {
 		ptr = findResourceData(MKID('CYCL'), roomptr);
+	}
 	if (ptr)
 		initCycl(ptr);
 





More information about the Scummvm-git-logs mailing list