aboutsummaryrefslogtreecommitdiff
path: root/engines/agos/saveload.cpp
diff options
context:
space:
mode:
authorTravis Howell2007-11-18 04:02:11 +0000
committerTravis Howell2007-11-18 04:02:11 +0000
commit70c4f25aef09d7e15d13090909cd6713cd4572e6 (patch)
tree24e4d3afb7a1d0639397a6dd2e9f8736fdba8179 /engines/agos/saveload.cpp
parentee4d7dc54d252cd98f0d902946d083c31440d287 (diff)
downloadscummvm-rg350-70c4f25aef09d7e15d13090909cd6713cd4572e6.tar.gz
scummvm-rg350-70c4f25aef09d7e15d13090909cd6713cd4572e6.tar.bz2
scummvm-rg350-70c4f25aef09d7e15d13090909cd6713cd4572e6.zip
Fix loading restart state file in Amiga version of Waxworks.
svn-id: r29543
Diffstat (limited to 'engines/agos/saveload.cpp')
-rw-r--r--engines/agos/saveload.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/engines/agos/saveload.cpp b/engines/agos/saveload.cpp
index 9df7e6815c..3ece2caecf 100644
--- a/engines/agos/saveload.cpp
+++ b/engines/agos/saveload.cpp
@@ -1267,11 +1267,14 @@ bool AGOSEngine_Elvira2::loadGame(const char *filename, bool restartMode) {
// read the items in item store
for (i = 0; i != _numItemStore; i++) {
- if ((getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) &&
- (getPlatform() == Common::kPlatformAmiga || getPlatform() == Common::kPlatformAtariST)) {
- _itemStore[i] = derefItem(f->readUint16BE() / 18);
- } else if (getGameType() == GType_ELVIRA2 && getPlatform() == Common::kPlatformPC) {
- _itemStore[i] = derefItem(readItemID(f));
+ if (getGameType() == GType_WW && getPlatform() == Common::kPlatformAmiga) {
+ _itemStore[i] = derefItem(f->readUint16BE() / 16);
+ } else if (getGameType() == GType_ELVIRA2) {
+ if (getPlatform() == Common::kPlatformPC) {
+ _itemStore[i] = derefItem(readItemID(f));
+ } else {
+ _itemStore[i] = derefItem(f->readUint16BE() / 18);
+ }
} else {
_itemStore[i] = derefItem(f->readUint16BE());
}
@@ -1414,11 +1417,14 @@ bool AGOSEngine_Elvira2::saveGame(uint slot, const char *caption) {
// write the items in item store
for (i = 0; i != _numItemStore; i++) {
- if ((getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) &&
- (getPlatform() == Common::kPlatformAmiga || getPlatform() == Common::kPlatformAtariST)) {
- f->writeUint16BE(itemPtrToID(_itemStore[i]) * 18);
- } else if (getGameType() == GType_ELVIRA2 && getPlatform() == Common::kPlatformPC) {
- writeItemID(f, itemPtrToID(_itemStore[i]));
+ if (getGameType() == GType_WW && getPlatform() == Common::kPlatformAmiga) {
+ f->writeUint16BE(itemPtrToID(_itemStore[i]) * 16);
+ } else if (getGameType() == GType_ELVIRA2) {
+ if (getPlatform() == Common::kPlatformPC) {
+ writeItemID(f, itemPtrToID(_itemStore[i]));
+ } else {
+ f->writeUint16BE(itemPtrToID(_itemStore[i]) * 18);
+ }
} else {
f->writeUint16BE(itemPtrToID(_itemStore[i]));
}