aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2005-04-26 14:18:34 +0000
committerMax Horn2005-04-26 14:18:34 +0000
commit973cb9a281e7b2dc73b7c640172954cc5f0bacfd (patch)
tree58c87ea7a3afa26d77328a8c13bf2b5eb436b073
parentaa330e827cf3d288c6599216846df0415ec08daf (diff)
downloadscummvm-rg350-973cb9a281e7b2dc73b7c640172954cc5f0bacfd.tar.gz
scummvm-rg350-973cb9a281e7b2dc73b7c640172954cc5f0bacfd.tar.bz2
scummvm-rg350-973cb9a281e7b2dc73b7c640172954cc5f0bacfd.zip
Make use of the new loadRoomSubBlocks (which only loads static room data now) in the save/load code; this also means we have to save a bit less data, and reduce code duplication
svn-id: r17822
-rw-r--r--scumm/saveload.cpp36
-rw-r--r--scumm/saveload.h2
2 files changed, 12 insertions, 26 deletions
diff --git a/scumm/saveload.cpp b/scumm/saveload.cpp
index fc80fcb117..64cf888926 100644
--- a/scumm/saveload.cpp
+++ b/scumm/saveload.cpp
@@ -97,7 +97,6 @@ bool ScummEngine::loadState(int slot, bool compat) {
int i, j;
SaveGameHeader hdr;
int sb, sh;
- byte *roomptr;
makeSavegameName(filename, slot, compat);
if (!(in = _saveFileMan->openForLoading(filename)))
@@ -212,18 +211,6 @@ bool ScummEngine::loadState(int slot, bool compat) {
VAR(VAR_NUM_GLOBAL_OBJS) = _numGlobalObjects - 1;
}
- if (_heversion == 70) {
- roomptr = getResourceAddress(rtRoom, _roomResource);
- const byte *ptr = findResourceData(MKID('REMP'), roomptr);
- if (ptr) {
- for (i = 0; i < 256; i++)
- _HEV7ActorPalette[i] = *ptr++;
- } else {
- for (i = 0; i < 256; i++)
- _HEV7ActorPalette[i] = i;
- }
- }
-
if (hdr.ver < VER(30)) {
// For a long time, we used incorrect location, causing it to default to zero.
if (_version == 8)
@@ -303,9 +290,8 @@ bool ScummEngine::loadState(int slot, bool compat) {
if (hdr.ver < VER(35) && _gameId == GID_MANIAC && _version == 1)
setupV1ActorTalkColor();
- // Regenerate strip table (for V1/V2 games)
- roomptr = getResourceAddress(rtRoom, _roomResource);
- gdi.roomChanged(roomptr, _IM00_offs);
+ // Load the static room data
+ loadRoomSubBlocks();
if (!(_features & GF_NEW_CAMERA)) {
camera._last.x = camera._cur.x;
@@ -454,20 +440,20 @@ 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)),
- MKLINE(ScummEngine, _EXCD_offs, sleUint32, VER(8)),
- MKLINE(ScummEngine, _IM00_offs, sleUint32, VER(8)),
- MKLINE(ScummEngine, _CLUT_offs, sleUint32, VER(8)),
+ MK_OBSOLETE(ScummEngine, _roomWidth, sleUint16, VER(8), VER(50)),
+ MK_OBSOLETE(ScummEngine, _roomHeight, sleUint16, VER(8), VER(50)),
+ MK_OBSOLETE(ScummEngine, _ENCD_offs, sleUint32, VER(8), VER(50)),
+ MK_OBSOLETE(ScummEngine, _EXCD_offs, sleUint32, VER(8), VER(50)),
+ MK_OBSOLETE(ScummEngine, _IM00_offs, sleUint32, VER(8), VER(50)),
+ MK_OBSOLETE(ScummEngine, _CLUT_offs, sleUint32, VER(8), VER(50)),
MK_OBSOLETE(ScummEngine, _EPAL_offs, sleUint32, VER(8), VER(9)),
- MKLINE(ScummEngine, _PALS_offs, sleUint32, VER(8)),
+ MK_OBSOLETE(ScummEngine, _PALS_offs, sleUint32, VER(8), VER(50)),
MKLINE(ScummEngine, _curPalIndex, sleByte, VER(8)),
MKLINE(ScummEngine, _currentRoom, sleByte, VER(8)),
MKLINE(ScummEngine, _roomResource, sleByte, VER(8)),
MKLINE(ScummEngine, _numObjectsInRoom, sleByte, VER(8)),
MKLINE(ScummEngine, _currentScript, sleByte, VER(8)),
- MKARRAY(ScummEngine, _localScriptOffsets[0], sleUint32, _numLocalScripts, VER(8)),
+ MK_OBSOLETE_ARRAY(ScummEngine, _localScriptOffsets[0], sleUint32, _numLocalScripts, VER(8), VER(50)),
// vm.localvar grew from 25 to 40 script entries and then from
@@ -568,7 +554,7 @@ void ScummEngine::saveOrLoad(Serializer *s, uint32 savegameVersion) {
MKARRAY_OLD(ScummEngine, gfxUsageBits[0], sleUint32, 410, VER(10), VER(13)),
MKARRAY(ScummEngine, gfxUsageBits[0], sleUint32, 3 * 410, VER(14)),
- MKLINE(ScummEngine, gdi._transparentColor, sleByte, VER(8)),
+ MK_OBSOLETE(ScummEngine, gdi._transparentColor, sleByte, VER(8), VER(50)),
MKARRAY(ScummEngine, _currentPalette[0], sleByte, 768, VER(8)),
// Sam & Max specific palette replaced by _shadowPalette now.
diff --git a/scumm/saveload.h b/scumm/saveload.h
index 6c81eab176..046813867d 100644
--- a/scumm/saveload.h
+++ b/scumm/saveload.h
@@ -43,7 +43,7 @@ namespace Scumm {
* only saves/loads those which are valid for the version of the savegame
* which is being loaded/saved currently.
*/
-#define CURRENT_VER 50
+#define CURRENT_VER 51
/**
* An auxillary macro, used to specify savegame versions. We use this instead