[Scummvm-cvs-logs] scummvm master -> 81e0dd1444ea2550800d344a03cccbc8135054c1

athrxx athrxx at scummvm.org
Sat Jun 18 19:51:11 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:
03ba1871f7 SCUMM: fixed messed up colors in 16bit HE games
81e0dd1444 SCUMM: regenerate 16bit palette after loading a savegame in LOOM PCE


Commit: 03ba1871f7392db32db09228878a2e148042f8c1
    https://github.com/scummvm/scummvm/commit/03ba1871f7392db32db09228878a2e148042f8c1
Author: athrxx (athrxx at scummvm.org)
Date: 2011-06-18T10:45:36-07:00

Commit Message:
SCUMM: fixed messed up colors in 16bit HE games

(regression from 068b4a5351a5574dbfac6acff5776a0071f3f2dd)

Changed paths:
    engines/scumm/gfx.cpp
    engines/scumm/gfx.h
    engines/scumm/scumm.cpp



diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index b78059b..fd529b3 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -251,7 +251,7 @@ GdiV2::~GdiV2() {
 }
 
 #ifdef USE_RGB_COLOR
-Gdi16Bit::Gdi16Bit(ScummEngine *vm) : Gdi(vm) {
+GdiHE16bit::GdiHE16bit(ScummEngine *vm) : GdiHE(vm) {
 }
 #endif
 
@@ -3674,7 +3674,7 @@ void Gdi::unkDecode11(byte *dst, int dstPitch, const byte *src, int height) cons
 #undef READ_BIT_256
 
 #ifdef USE_RGB_COLOR
-void Gdi16Bit::writeRoomColor(byte *dst, byte color) const {
+void GdiHE16bit::writeRoomColor(byte *dst, byte color) const {
 	WRITE_UINT16(dst, READ_LE_UINT16(_vm->_hePalettes + 2048 + color * 2));
 }
 #endif
diff --git a/engines/scumm/gfx.h b/engines/scumm/gfx.h
index 54ce724..2e7111e 100644
--- a/engines/scumm/gfx.h
+++ b/engines/scumm/gfx.h
@@ -430,11 +430,11 @@ public:
 };
 
 #ifdef USE_RGB_COLOR
-class Gdi16Bit : public Gdi {
+class GdiHE16bit : public GdiHE {
 protected:
 	virtual void writeRoomColor(byte *dst, byte color) const;
 public:
-	Gdi16Bit(ScummEngine *vm);
+	GdiHE16bit(ScummEngine *vm);
 };
 #endif
 
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 362430d..4fd1f6b 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -114,17 +114,18 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
 	  _rnd("scumm")
 	  {
 
-	if (_game.heversion > 0) {
-		_gdi = new GdiHE(this);
-	} else if (_game.platform == Common::kPlatformNES) {
-		_gdi = new GdiNES(this);
 #ifdef USE_RGB_COLOR
-	} else if (_game.features & GF_16BIT_COLOR) {
+	if (_game.features & GF_16BIT_COLOR) {
 		if (_game.platform == Common::kPlatformPCEngine)
 			_gdi = new GdiPCEngine(this);
-		else
-			_gdi = new Gdi16Bit(this);
+		else if (_game.heversion > 0)
+			_gdi = new GdiHE16bit(this);
+	} else
 #endif
+	if (_game.heversion > 0) {
+		_gdi = new GdiHE(this);
+	} else if (_game.platform == Common::kPlatformNES) {
+		_gdi = new GdiNES(this);
 	} else if (_game.version <= 1) {
 		_gdi = new GdiV1(this);
 	} else if (_game.version == 2) {


Commit: 81e0dd1444ea2550800d344a03cccbc8135054c1
    https://github.com/scummvm/scummvm/commit/81e0dd1444ea2550800d344a03cccbc8135054c1
Author: athrxx (athrxx at scummvm.org)
Date: 2011-06-18T10:45:39-07:00

Commit Message:
SCUMM: regenerate 16bit palette after loading a savegame in LOOM PCE

(this avoids isssues when using savegames from different ports with different 16bit color modes)

Changed paths:
    engines/scumm/saveload.cpp



diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp
index 2be032d..f9a6b21 100644
--- a/engines/scumm/saveload.cpp
+++ b/engines/scumm/saveload.cpp
@@ -1497,6 +1497,16 @@ void ScummEngine_v5::saveOrLoad(Serializer *s) {
 			resetCursors();
 		}
 	}
+
+	// Regenerate 16bit palette after loading.
+	// This avoids color issues when loading savegames that have been saved with a different ScummVM port
+	// that uses a different 16bit color mode than the ScummVM port which is currently used.
+#ifdef USE_RGB_COLOR
+	if (_game.platform == Common::kPlatformPCEngine && s->isLoading()) {
+		for (int i = 0; i < 256; ++i)
+			_16BitPalette[i] = get16BitColor(_currentPalette[i * 3 + 0], _currentPalette[i * 3 + 1], _currentPalette[i * 3 + 2]);
+	}
+#endif
 }
 
 #ifdef ENABLE_SCUMM_7_8






More information about the Scummvm-git-logs mailing list