[Scummvm-git-logs] scummvm master -> 7695fb92af1d94ab9010028366c0e84e1062d8b3

athrxx athrxx at scummvm.org
Tue Oct 6 17:14:48 UTC 2020


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:
08c6423403 KYRA: (EOB) - fix CGA mode glitch
7695fb92af KYRA: (EOB/SegaCD) - allow party transfer to EOB II


Commit: 08c642340327ff8be159b3530b753dabc5fb3ceb
    https://github.com/scummvm/scummvm/commit/08c642340327ff8be159b3530b753dabc5fb3ceb
Author: athrxx (athrxx at scummvm.org)
Date: 2020-10-06T19:10:30+02:00

Commit Message:
KYRA: (EOB) - fix CGA mode glitch

Changed paths:
    engines/kyra/graphics/screen.cpp


diff --git a/engines/kyra/graphics/screen.cpp b/engines/kyra/graphics/screen.cpp
index 53a9abf89b..2eaaf94ea7 100644
--- a/engines/kyra/graphics/screen.cpp
+++ b/engines/kyra/graphics/screen.cpp
@@ -3879,7 +3879,7 @@ void Palette::loadEGAPalette(Common::ReadStream &stream, int startIndex, int col
 void Palette::setCGAPalette(int palIndex, CGAIntensity intensity) {
 	assert(_numColors >= _cgaNumColors);
 	assert(!(palIndex & ~1));
-	memcpy(_palData, _cgaColors[palIndex * 2 + intensity], _numColors * 3);
+	memcpy(_palData, _cgaColors[palIndex * 2 + intensity], _cgaNumColors * 3);
 }
 
 void Palette::loadAmigaPalette(Common::ReadStream &stream, int startIndex, int colors) {


Commit: 7695fb92af1d94ab9010028366c0e84e1062d8b3
    https://github.com/scummvm/scummvm/commit/7695fb92af1d94ab9010028366c0e84e1062d8b3
Author: athrxx (athrxx at scummvm.org)
Date: 2020-10-06T19:13:56+02:00

Commit Message:
KYRA: (EOB/SegaCD) - allow party transfer to EOB II

This slightly modifiies the save code so that parties created with the SegaCD version (from save files created after this commit) can be imported into any version of EOB II.

Also fix a memory leak in party transfer code.

Changed paths:
    engines/kyra/engine/chargen.cpp
    engines/kyra/gui/saveload.cpp
    engines/kyra/gui/saveload_eob.cpp


diff --git a/engines/kyra/engine/chargen.cpp b/engines/kyra/engine/chargen.cpp
index ed2a21097f..ed0eb28cd8 100644
--- a/engines/kyra/engine/chargen.cpp
+++ b/engines/kyra/engine/chargen.cpp
@@ -1819,6 +1819,9 @@ bool TransferPartyWiz::start() {
 			ch++;
 		}
 	}
+
+	delete[] _vm->_characters[4].faceShape;
+	delete[] _vm->_characters[5].faceShape;
 	memset(&_vm->_characters[4], 0, sizeof(EoBCharacter) * 2);
 
 	convertInventory();
diff --git a/engines/kyra/gui/saveload.cpp b/engines/kyra/gui/saveload.cpp
index e3aafb15bc..743da8c6fc 100644
--- a/engines/kyra/gui/saveload.cpp
+++ b/engines/kyra/gui/saveload.cpp
@@ -29,7 +29,7 @@
 #include "graphics/thumbnail.h"
 #include "graphics/surface.h"
 
-#define CURRENT_SAVE_VERSION 18
+#define CURRENT_SAVE_VERSION 19
 
 #define GF_FLOPPY  (1 <<  0)
 #define GF_TALKIE  (1 <<  1)
diff --git a/engines/kyra/gui/saveload_eob.cpp b/engines/kyra/gui/saveload_eob.cpp
index c310b39d08..b4fdfb73c1 100644
--- a/engines/kyra/gui/saveload_eob.cpp
+++ b/engines/kyra/gui/saveload_eob.cpp
@@ -114,7 +114,7 @@ Common::Error EoBCoreEngine::loadGameState(int slot) {
 	if (slot == -1) {
 		// Skip all settings which aren't necessary for party transfer.
 		// Jump directly to the items list.
-		in.skip(108);
+		in.skip(header.version > 18 ? 124 : 108);
 	} else {
 		_currentLevel = in.readByte();
 		_currentSub = in.readSByte();
@@ -140,7 +140,7 @@ Common::Error EoBCoreEngine::loadGameState(int slot) {
 		_activeSpell = in.readByte();
 		_returnAfterSpellCallback = in.readByte() ? true : false;
 
-		if (_flags.platform == Common::kPlatformSegaCD) {
+		if (_flags.platform == Common::kPlatformSegaCD || header.version > 18) {
 			_totalPlaySecs = in.readUint32BE();
 			_totalEnemiesKilled = in.readUint32BE();
 			_totalSteps = in.readUint32BE();
@@ -419,12 +419,11 @@ Common::Error EoBCoreEngine::saveGameStateIntern(int slot, const char *saveName,
 	out->writeByte(_activeSpell);
 	out->writeByte(_returnAfterSpellCallback ? 1 : 0);
 
-	if (_flags.platform == Common::kPlatformSegaCD) {
-		out->writeUint32BE(_totalPlaySecs);
-		out->writeUint32BE(_totalEnemiesKilled);
-		out->writeUint32BE(_totalSteps);
-		out->writeUint32BE(_levelMaps);
-	}
+	// SegaCD specific
+	out->writeUint32BE(_totalPlaySecs);
+	out->writeUint32BE(_totalEnemiesKilled);
+	out->writeUint32BE(_totalSteps);
+	out->writeUint32BE(_levelMaps);
 
 	_inf->saveState(out);
 




More information about the Scummvm-git-logs mailing list