From 075dc8a538f2c3ea6efa68c3256a21a1a654ef42 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 25 Feb 2006 02:35:45 +0000 Subject: 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 --- engines/kyra/saveload.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'engines/kyra') 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); -- cgit v1.2.3