aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra
diff options
context:
space:
mode:
authorMax Horn2006-02-25 02:35:45 +0000
committerMax Horn2006-02-25 02:35:45 +0000
commit075dc8a538f2c3ea6efa68c3256a21a1a654ef42 (patch)
treebf26f18fcef4f606e210a8bbbbd5b70dfc815b87 /engines/kyra
parentee0f0a1f13bf22c706097d8a0254e6f7392cb95b (diff)
downloadscummvm-rg350-075dc8a538f2c3ea6efa68c3256a21a1a654ef42.tar.gz
scummvm-rg350-075dc8a538f2c3ea6efa68c3256a21a1a654ef42.tar.bz2
scummvm-rg350-075dc8a538f2c3ea6efa68c3256a21a1a654ef42.zip
A typical example why MKID is dangerous: Kyra uses it incorrectly, thus savegames are not interchangable between BE and LE systems. Fixing this, by breaking all LE savegames (enabling a compatibility mode, if desired, is easy)
svn-id: r20866
Diffstat (limited to 'engines/kyra')
-rw-r--r--engines/kyra/saveload.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/engines/kyra/saveload.cpp b/engines/kyra/saveload.cpp
index 8471c2ae77..346ef7bf86 100644
--- a/engines/kyra/saveload.cpp
+++ b/engines/kyra/saveload.cpp
@@ -41,7 +41,11 @@ void KyraEngine::loadGame(const char *fileName) {
}
uint32 type = in->readUint32BE();
- if (type != MKID('KYRA')) {
+
+ // FIXME: The kyra savegame code used to be endian unsafe. Uncomment the
+ // following line to graciously handle old savegames from LE machines.
+ // if (type != MKID_BE('KYRA') && type != MKID_BE('ARYK')) {
+ if (type != MKID_BE('KYRA')) {
warning("No Kyrandia 1 savefile header");
delete in;
return;
@@ -233,7 +237,7 @@ void KyraEngine::saveGame(const char *fileName, const char *saveName) {
}
// Savegame version
- out->writeUint32BE(MKID('KYRA'));
+ out->writeUint32BE(MKID_BE('KYRA'));
out->writeUint32BE(CURRENT_VERSION);
out->write(saveName, 31);
out->writeUint32BE(_features);