[Scummvm-cvs-logs] scummvm master -> d0e64ce4a3a30d3db6194f15320dac981a0c7a16

lordhoto lordhoto at gmail.com
Sat Aug 27 20:03:51 CEST 2011


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
003c16920c SCUMM: Also save first used color beyond 80 in Indy4 Amiga palette.
d0e64ce4a3 SCUMM: Properly prefix player_towns.h include with scumm/.


Commit: 003c16920c1790152e64250b38613f36e39ec719
    https://github.com/scummvm/scummvm/commit/003c16920c1790152e64250b38613f36e39ec719
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2011-08-27T10:57:45-07:00

Commit Message:
SCUMM: Also save first used color beyond 80 in Indy4 Amiga palette.

Changed paths:
    engines/scumm/palette.cpp
    engines/scumm/saveload.cpp
    engines/scumm/saveload.h
    engines/scumm/scumm.h



diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp
index 9977436..7a6be90 100644
--- a/engines/scumm/palette.cpp
+++ b/engines/scumm/palette.cpp
@@ -380,16 +380,7 @@ void ScummEngine::setAmigaPaletteFromPtr(const byte *ptr) {
 		_colorUsedByCycle[i] = 0;
 	}
 
-	_amigaFirstUsedColor = 80;
-	for (; _amigaFirstUsedColor < 256; ++_amigaFirstUsedColor) {
-		// We look for the first used color here. If all color components are
-		// >= 252 the color seems to be unused. Check remapPaletteColor for
-		// the same behavior.
-		if (ptr[_amigaFirstUsedColor * 3 + 0] <= 251
-		    || ptr[_amigaFirstUsedColor * 3 + 1] <= 251
-		    || ptr[_amigaFirstUsedColor * 3 + 2] <= 251)
-			break;
-	}
+	amigaPaletteFindFirstUsedColor();
 
 	for (int i = 0; i < 64; ++i) {
 		_amigaPalette[i * 3 + 0] = _currentPalette[(i + 16) * 3 + 0] >> 4;
@@ -424,6 +415,18 @@ void ScummEngine::setAmigaPaletteFromPtr(const byte *ptr) {
 	setDirtyColors(0, 255);
 }
 
+void ScummEngine::amigaPaletteFindFirstUsedColor() {
+	for (_amigaFirstUsedColor = 80; _amigaFirstUsedColor < 256; ++_amigaFirstUsedColor) {
+		// We look for the first used color here. If all color components are
+		// >= 252 the color seems to be unused. Check remapPaletteColor for
+		// the same behavior.
+		if (_currentPalette[_amigaFirstUsedColor * 3 + 0] <= 251
+		    || _currentPalette[_amigaFirstUsedColor * 3 + 1] <= 251
+		    || _currentPalette[_amigaFirstUsedColor * 3 + 2] <= 251)
+			break;
+	}
+}
+
 void ScummEngine::mapRoomPalette(int idx) {
 	// For Color 33 (which is in fact 17+16) see the special case in
 	// setAmigaPaletteFromPtr.
diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp
index e0eba99..db151c2 100644
--- a/engines/scumm/saveload.cpp
+++ b/engines/scumm/saveload.cpp
@@ -1357,6 +1357,15 @@ void ScummEngine::saveOrLoad(Serializer *s) {
 			s->saveLoadArrayOf(_roomPalette, 256, 1, sleByte);
 			s->saveLoadArrayOf(_verbPalette, 256, 1, sleByte);
 			s->saveLoadArrayOf(_amigaPalette, 3 * 64, 1, sleByte);
+
+			// Starting from version 86 we also save the first used color in
+			// the palette beyond the verb palette. For old versions we just
+			// look for it again, which hopefully won't cause any troubles.
+			if (s->getVersion() >= 86) {
+				s->saveLoadArrayOf(&_amigaFirstUsedColor, 1, 2, sleUint16);
+			} else {
+				amigaPaletteFindFirstUsedColor();
+			}
 		} else {
 			warning("Save with old Indiana Jones 4 Amiga palette handling detected");
 			// We need to restore the internal state of the Amiga palette for Indy4
diff --git a/engines/scumm/saveload.h b/engines/scumm/saveload.h
index 792a31d..16c225d 100644
--- a/engines/scumm/saveload.h
+++ b/engines/scumm/saveload.h
@@ -47,7 +47,7 @@ namespace Scumm {
  * only saves/loads those which are valid for the version of the savegame
  * which is being loaded/saved currently.
  */
-#define CURRENT_VER 85
+#define CURRENT_VER 86
 
 /**
  * An auxillary macro, used to specify savegame versions. We use this instead
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index 0af8264..d9237b2 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -1092,6 +1092,7 @@ protected:
 	// Indy4 Amiga specific
 	uint16 _amigaFirstUsedColor;
 	byte _amigaPalette[3 * 64];
+	void amigaPaletteFindFirstUsedColor();
 	void mapRoomPalette(int idx);
 	int remapRoomPaletteColor(int r, int g, int b);
 	void mapVerbPalette(int idx);


Commit: d0e64ce4a3a30d3db6194f15320dac981a0c7a16
    https://github.com/scummvm/scummvm/commit/d0e64ce4a3a30d3db6194f15320dac981a0c7a16
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2011-08-27T10:58:36-07:00

Commit Message:
SCUMM: Properly prefix player_towns.h include with scumm/.

Changed paths:
    engines/scumm/saveload.cpp



diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp
index db151c2..3ab13df 100644
--- a/engines/scumm/saveload.cpp
+++ b/engines/scumm/saveload.cpp
@@ -30,7 +30,7 @@
 #include "scumm/charset.h"
 #include "scumm/imuse_digi/dimuse.h"
 #include "scumm/imuse/imuse.h"
-#include "player_towns.h"
+#include "scumm/player_towns.h"
 #include "scumm/he/intern_he.h"
 #include "scumm/object.h"
 #include "scumm/resource.h"






More information about the Scummvm-git-logs mailing list