diff options
-rw-r--r-- | scumm/cursor.cpp | 10 | ||||
-rw-r--r-- | scumm/intern.h | 5 | ||||
-rw-r--r-- | scumm/saveload.cpp | 21 | ||||
-rw-r--r-- | scumm/scumm.h | 3 |
4 files changed, 22 insertions, 17 deletions
diff --git a/scumm/cursor.cpp b/scumm/cursor.cpp index 441f677580..dd4cb23be3 100644 --- a/scumm/cursor.cpp +++ b/scumm/cursor.cpp @@ -494,14 +494,4 @@ void ScummEngine_v5::setBuiltinCursor(int idx) { updateCursor(); } -void ScummEngine_v5::saveOrLoadCursorImages(Serializer *s) { - const SaveLoadEntry cursorEntries[] = { - MKARRAY2(ScummEngine_v5, _cursorImages[0][0], sleUint16, 16, 4, (byte*)_cursorImages[1] - (byte*)_cursorImages[0], VER(44)), - MKARRAY(ScummEngine_v5, _cursorHotspots[0], sleByte, 8, VER(44)), - MKEND() - }; - - s->saveLoadEntries(this, cursorEntries); -} - } // End of namespace Scumm diff --git a/scumm/intern.h b/scumm/intern.h index 5e57148e94..449701d1cc 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -64,6 +64,8 @@ protected: virtual void initScummVars(); virtual void decodeParseString(); + virtual void saveOrLoad(Serializer *s, uint32 savegameVersion); + virtual void readMAXS(int blockSize); int getWordVararg(int *ptr); @@ -79,7 +81,6 @@ protected: void setBuiltinCursor(int index); void redefineBuiltinCursorFromChar(int index, int chr); void redefineBuiltinCursorHotspot(int index, int x, int y); - void saveOrLoadCursorImages(Serializer *s); /* Version 5 script opcodes */ void o5_actorFollowCamera(); @@ -1243,6 +1244,8 @@ protected: virtual void setupScummVars(); virtual void initScummVars(); + virtual void saveOrLoad(Serializer *s, uint32 savegameVersion); + virtual void readMAXS(int blockSize); virtual void readGlobalObjects(); virtual void readIndexBlock(uint32 blocktype, uint32 itemsize); diff --git a/scumm/saveload.cpp b/scumm/saveload.cpp index 4ffbf7faf7..7feca07a96 100644 --- a/scumm/saveload.cpp +++ b/scumm/saveload.cpp @@ -909,13 +909,26 @@ void ScummEngine::saveOrLoad(Serializer *s, uint32 savegameVersion) { if (_imuse && (_saveSound || !_saveTemporaryState)) { _imuse->save_or_load(s, this); } +} - if (_imuseDigital) { - _imuseDigital->saveOrLoad(s); - } +void ScummEngine_v5::saveOrLoad(Serializer *s, uint32 savegameVersion) { + ScummEngine::saveOrLoad(s, savegameVersion); + + const SaveLoadEntry cursorEntries[] = { + MKARRAY2(ScummEngine_v5, _cursorImages[0][0], sleUint16, 16, 4, (byte*)_cursorImages[1] - (byte*)_cursorImages[0], VER(44)), + MKARRAY(ScummEngine_v5, _cursorHotspots[0], sleByte, 8, VER(44)), + MKEND() + }; // This is probably only needed for Loom. - saveOrLoadCursorImages(s); + s->saveLoadEntries(this, cursorEntries); +} + +void ScummEngine_v7::saveOrLoad(Serializer *s, uint32 savegameVersion) { + ScummEngine::saveOrLoad(s, savegameVersion); + + assert(_imuseDigital); + _imuseDigital->saveOrLoad(s); } void ScummEngine::saveLoadResource(Serializer *ser, int type, int idx) { diff --git a/scumm/scumm.h b/scumm/scumm.h index 6c5820b2a8..3984d6d706 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -427,7 +427,6 @@ public: void updateCursor(); virtual void animateCursor() {} virtual void updatePalette(); - virtual void saveOrLoadCursorImages(Serializer *s) {} /** * Flag which signals that the SMUSH video playback should end now @@ -564,7 +563,7 @@ protected: bool saveState(int slot, bool compat); bool loadState(int slot, bool compat); - void saveOrLoad(Serializer *s, uint32 savegameVersion); + virtual void saveOrLoad(Serializer *s, uint32 savegameVersion); void saveLoadResource(Serializer *ser, int type, int index); // "Obsolete" void saveResource(Serializer *ser, int type, int index); void loadResource(Serializer *ser, int type, int index); |