aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/saveload_eob.cpp
diff options
context:
space:
mode:
authorathrxx2011-12-17 22:55:19 +0100
committerJohannes Schickel2011-12-26 16:18:17 +0100
commitd807b3d42b4a49dfe8262f496f9b341aef3c8bdd (patch)
treec1407b7c107b06a084f1135d9863a6bd0e635faf /engines/kyra/saveload_eob.cpp
parentc0e782fd0b2ba9de69563e8bcb4fb43e2f311b35 (diff)
downloadscummvm-rg350-d807b3d42b4a49dfe8262f496f9b341aef3c8bdd.tar.gz
scummvm-rg350-d807b3d42b4a49dfe8262f496f9b341aef3c8bdd.tar.bz2
scummvm-rg350-d807b3d42b4a49dfe8262f496f9b341aef3c8bdd.zip
KYRA: (EOB) - implement EOB1 party transfer
Diffstat (limited to 'engines/kyra/saveload_eob.cpp')
-rw-r--r--engines/kyra/saveload_eob.cpp68
1 files changed, 38 insertions, 30 deletions
diff --git a/engines/kyra/saveload_eob.cpp b/engines/kyra/saveload_eob.cpp
index 714033b569..1f982aa3ab 100644
--- a/engines/kyra/saveload_eob.cpp
+++ b/engines/kyra/saveload_eob.cpp
@@ -74,7 +74,7 @@ Common::Error EoBCoreEngine::loadGameState(int slot) {
c->alignment = in.readByte();
c->portrait = in.readSByte();
if (slot == -1 && c->portrait < 0)
- c->portrait += 43;
+ c->portrait = -c->portrait + 43;
c->food = in.readByte();
in.read(c->level, 3);
for (int ii = 0; ii < 3; ii++)
@@ -118,35 +118,37 @@ Common::Error EoBCoreEngine::loadGameState(int slot) {
}
_screen->_curPage = 0;
- // No more data required for party transfer
- if (slot == -1)
- return Common::kNoError;
-
- _currentLevel = in.readByte();
- _currentSub = in.readSByte();
- _currentBlock = in.readUint16BE();
- _currentDirection = in.readUint16BE();
- _itemInHand = in.readSint16BE();
- _hasTempDataFlags = in.readUint32BE();
- _partyEffectFlags = in.readUint32BE();
-
- _updateFlags = in.readUint16BE();
- _compassDirection = in.readUint16BE();
- _currentControlMode = in.readUint16BE();
- _updateCharNum = in.readUint16BE();
- _openBookSpellLevel = in.readSByte();
- _openBookSpellSelectedItem = in.readSByte();
- _openBookSpellListOffset = in.readSByte();
- _openBookChar = in.readByte();
- _openBookType = in.readByte();
- _openBookCharBackup = in.readByte();
- _openBookTypeBackup = in.readByte();
- _activeSpellCharId = in.readByte();
- _activeSpellCharacterPos = in.readByte();
- _activeSpell = in.readByte();
- _returnAfterSpellCallback = in.readByte() ? true : false;
-
- _inf->loadState(in);
+ if (slot == -1) {
+ // Skip all settings which aren't necessary for party transfer.
+ // Jump directly to the items list.
+ in.skip(108);
+ } else {
+ _currentLevel = in.readByte();
+ _currentSub = in.readSByte();
+ _currentBlock = in.readUint16BE();
+ _currentDirection = in.readUint16BE();
+ _itemInHand = in.readSint16BE();
+ _hasTempDataFlags = in.readUint32BE();
+ _partyEffectFlags = in.readUint32BE();
+
+ _updateFlags = in.readUint16BE();
+ _compassDirection = in.readUint16BE();
+ _currentControlMode = in.readUint16BE();
+ _updateCharNum = in.readUint16BE();
+ _openBookSpellLevel = in.readSByte();
+ _openBookSpellSelectedItem = in.readSByte();
+ _openBookSpellListOffset = in.readSByte();
+ _openBookChar = in.readByte();
+ _openBookType = in.readByte();
+ _openBookCharBackup = in.readByte();
+ _openBookTypeBackup = in.readByte();
+ _activeSpellCharId = in.readByte();
+ _activeSpellCharacterPos = in.readByte();
+ _activeSpell = in.readByte();
+ _returnAfterSpellCallback = in.readByte() ? true : false;
+
+ _inf->loadState(in);
+ }
for (int i = 0; i < 600; i++) {
EoBItem *t = &_items[i];
@@ -163,6 +165,12 @@ Common::Error EoBCoreEngine::loadGameState(int slot) {
t->value = in.readSByte();
}
+ // No more data needed for party transfer
+ if (slot == -1) {
+ _loading = false;
+ return Common::kNoError;
+ }
+
for (int i = 51; i < 65; i++) {
EoBItemType *t = &_itemTypes[i];
t->invFlags = in.readUint16BE();