From a427d72d0407aae11ae43ebe54aa630bd8323160 Mon Sep 17 00:00:00 2001 From: James Brown Date: Fri, 10 Sep 2004 12:13:03 +0000 Subject: Store SCUMM md5s in save game. Save format bump. svn-id: r14996 --- scumm/saveload.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'scumm/saveload.cpp') 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(); -- cgit v1.2.3