aboutsummaryrefslogtreecommitdiff
path: root/scumm/saveload.cpp
diff options
context:
space:
mode:
authorJames Brown2003-01-14 10:06:56 +0000
committerJames Brown2003-01-14 10:06:56 +0000
commit5bf741f96076fa5fcdc077d5fe0a6f4557bd1dcc (patch)
tree980a4f529c01bfd637470130a024f690adaa87c1 /scumm/saveload.cpp
parent639cb13da189d269f53a9f895fc6109cd926c211 (diff)
downloadscummvm-rg350-5bf741f96076fa5fcdc077d5fe0a6f4557bd1dcc.tar.gz
scummvm-rg350-5bf741f96076fa5fcdc077d5fe0a6f4557bd1dcc.tar.bz2
scummvm-rg350-5bf741f96076fa5fcdc077d5fe0a6f4557bd1dcc.zip
Patch 667613: Extend gfxUsageBits[]
svn-id: r6453
Diffstat (limited to 'scumm/saveload.cpp')
-rw-r--r--scumm/saveload.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/scumm/saveload.cpp b/scumm/saveload.cpp
index d5520e828a..5adeaa160f 100644
--- a/scumm/saveload.cpp
+++ b/scumm/saveload.cpp
@@ -424,9 +424,10 @@ void Scumm::saveOrLoad(Serializer *s, uint32 savegameVersion)
MKLINE(Scumm, _palManipEnd, sleByte, VER_V10),
MKLINE(Scumm, _palManipCounter, sleUint16, VER_V10),
- // gfxUsageBits grew from 200 to 410 entries:
+ // gfxUsageBits grew from 200 to 410 entries. Then 3 * 410 entries:
MKARRAY_OLD(Scumm, gfxUsageBits[0], sleUint32, 200, VER_V8, VER_V9),
- MKARRAY(Scumm, gfxUsageBits[0], sleUint32, 410, VER_V10),
+ MKARRAY_OLD(Scumm, gfxUsageBits[0], sleUint32, 410, VER_V10, VER_V13),
+ MKARRAY(Scumm, gfxUsageBits[0], sleUint32, 3 * 410, VER_V14),
MKLINE(Scumm, gdi._transparentColor, sleByte, VER_V8),
MKARRAY(Scumm, _currentPalette[0], sleByte, 768, VER_V8),
@@ -557,8 +558,15 @@ void Scumm::saveOrLoad(Serializer *s, uint32 savegameVersion)
}
}
+ // Because old savegames won't fill the entire gfxUsageBits[] array,
+ // clear it here just to be sure it won't hold any unforseen garbage.
+ memset(gfxUsageBits, 0, sizeof(gfxUsageBits));
+
s->saveLoadEntries(this, mainEntries);
+ if (!s->isSaving() && savegameVersion < VER_V14)
+ upgradeGfxUsageBits();
+
s->saveLoadArrayOf(_actors, NUM_ACTORS, sizeof(_actors[0]), actorEntries);
if (savegameVersion < VER_V9)