[Scummvm-cvs-logs] SF.net SVN: scummvm: [20866] scummvm/trunk/engines/kyra/saveload.cpp
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Fri Feb 24 18:36:01 CET 2006
Revision: 20866
Author: fingolfin
Date: 2006-02-24 18:35:45 -0800 (Fri, 24 Feb 2006)
ViewCVS: http://svn.sourceforge.net/scummvm?rev=20866&view=rev
Log Message:
-----------
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)
Modified Paths:
--------------
scummvm/trunk/engines/kyra/saveload.cpp
Modified: scummvm/trunk/engines/kyra/saveload.cpp
===================================================================
--- scummvm/trunk/engines/kyra/saveload.cpp 2006-02-25 02:31:49 UTC (rev 20865)
+++ scummvm/trunk/engines/kyra/saveload.cpp 2006-02-25 02:35:45 UTC (rev 20866)
@@ -41,7 +41,11 @@
}
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 @@
}
// Savegame version
- out->writeUint32BE(MKID('KYRA'));
+ out->writeUint32BE(MKID_BE('KYRA'));
out->writeUint32BE(CURRENT_VERSION);
out->write(saveName, 31);
out->writeUint32BE(_features);
More information about the Scummvm-git-logs
mailing list