[Scummvm-git-logs] scummvm branch-2-2 -> be5f19e614a61286fe42561ae5648fa33f789874

athrxx athrxx at scummvm.org
Tue Oct 6 17:16:27 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:
b861be27bd KYRA: (EOB) - fix CGA mode glitch
be5f19e614 KYRA: (EOB/SegaCD) - allow party transfer to EOB II


Commit: b861be27bd1f42b0b8deecb38ae1324436a5f993
    https://github.com/scummvm/scummvm/commit/b861be27bd1f42b0b8deecb38ae1324436a5f993
Author: athrxx (athrxx at scummvm.org)
Date: 2020-10-06T19:16:01+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: be5f19e614a61286fe42561ae5648fa33f789874
    https://github.com/scummvm/scummvm/commit/be5f19e614a61286fe42561ae5648fa33f789874
Author: athrxx (athrxx at scummvm.org)
Date: 2020-10-06T19:16:02+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 0d6f156a28..3425264753 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