diff options
author | James Brown | 2004-09-10 12:13:03 +0000 |
---|---|---|
committer | James Brown | 2004-09-10 12:13:03 +0000 |
commit | a427d72d0407aae11ae43ebe54aa630bd8323160 (patch) | |
tree | acb253def947cecb88ac9f1c67c5cc19773f2103 /scumm/saveload.cpp | |
parent | 71866c1287d35bb88b4d9dc048b296cc84bafb32 (diff) | |
download | scummvm-rg350-a427d72d0407aae11ae43ebe54aa630bd8323160.tar.gz scummvm-rg350-a427d72d0407aae11ae43ebe54aa630bd8323160.tar.bz2 scummvm-rg350-a427d72d0407aae11ae43ebe54aa630bd8323160.zip |
Store SCUMM md5s in save game. Save format bump.
svn-id: r14996
Diffstat (limited to 'scumm/saveload.cpp')
-rw-r--r-- | scumm/saveload.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/scumm/saveload.cpp b/scumm/saveload.cpp index aba1fcc3d1..d60232a730 100644 --- a/scumm/saveload.cpp +++ b/scumm/saveload.cpp @@ -414,6 +414,7 @@ void ScummEngine::saveOrLoad(Serializer *s, uint32 savegameVersion) { }; const SaveLoadEntry mainEntries[] = { + MKARRAY(ScummEngine, _gameMD5[0], sleUint8, 16, VER(39)), MKLINE(ScummEngine, _roomWidth, sleUint16, VER(8)), MKLINE(ScummEngine, _roomHeight, sleUint16, VER(8)), MKLINE(ScummEngine, _ENCD_offs, sleUint32, VER(8)), @@ -661,9 +662,28 @@ void ScummEngine::saveOrLoad(Serializer *s, uint32 savegameVersion) { int i, j; int var120Backup; int var98Backup; + uint8 md5Backup[16]; + + // MD5 Operations: Backup on load, compare, and reset. + if (s->isLoading()) { + for (i=0; i<17; i++) md5Backup[i] = _gameMD5[i]; + } s->saveLoadEntries(this, mainEntries); + // MD5 Operations: Backup on load, compare, and reset. + if (s->isLoading()) { + for (j = 0; j < 16; j++) { + if (_gameMD5[j] != md5Backup[j]) { + warning("Game was saved with different gamedata - you may encounter problems."); + _gameMD5[j] = md5Backup[j]; + break; + } + _gameMD5[j] = md5Backup[j]; + } + } + + if (s->isLoading() && savegameVersion < VER(14)) upgradeGfxUsageBits(); |