diff --git a/scumm/saveload.cpp b/scumm/saveload.cpp index fd94c22b71e..0cfb1650aff 100644 --- a/scumm/saveload.cpp +++ b/scumm/saveload.cpp @@ -625,8 +625,6 @@ void ScummEngine::saveOrLoad(Serializer *s, uint32 savegameVersion) { MKEND() }; - const SaveLoadEntry *soundEntries = _sound->getSaveLoadEntries(); - const SaveLoadEntry verbEntries[] = { MKLINE(VerbSlot, curRect.left, sleInt16, VER(8)), MKLINE(VerbSlot, curRect.top, sleInt16, VER(8)), @@ -957,7 +955,7 @@ void ScummEngine::saveOrLoad(Serializer *s, uint32 savegameVersion) { // // Save/load sound data // - s->saveLoadEntries(_sound, soundEntries); + _sound->saveLoadWithSerializer(s); // diff --git a/scumm/sound.cpp b/scumm/sound.cpp index 8273304cf40..d9022e44b96 100644 --- a/scumm/sound.cpp +++ b/scumm/sound.cpp @@ -25,7 +25,6 @@ #include "scumm/imuse.h" #include "scumm/imuse_digi/dimuse.h" #include "scumm/scumm.h" -#include "scumm/saveload.h" #include "scumm/sound.h" #include "scumm/util.h" @@ -1296,14 +1295,14 @@ void Sound::updateCD() { AudioCD.updateCD(); } -const SaveLoadEntry *Sound::getSaveLoadEntries() { +void Sound::saveLoadWithSerializer(Serializer *ser) { static const SaveLoadEntry soundEntries[] = { MKLINE(Sound, _currentCDSound, sleInt16, VER(35)), MKLINE(Sound, _currentMusic, sleInt16, VER(35)), MKEND() }; - return soundEntries; + ser->saveLoadEntries(this, soundEntries); } diff --git a/scumm/sound.h b/scumm/sound.h index 484edaf81c9..7bc34cfab1e 100644 --- a/scumm/sound.h +++ b/scumm/sound.h @@ -24,6 +24,7 @@ #include "common/scummsys.h" #include "sound/audiostream.h" #include "sound/mixer.h" +#include "scumm/saveload.h" namespace Common { class File; @@ -41,7 +42,7 @@ enum { kTalkSoundID = 10000 }; -class Sound { +class Sound : public Serializable { #ifdef PALMOS_MODE public: #else @@ -137,7 +138,7 @@ public: bool getHEMusicDetails(int id, int &musicOffs, int &musicSize); // Used by the save/load system: - const SaveLoadEntry *getSaveLoadEntries(); + void saveLoadWithSerializer(Serializer *ser); protected: ScummFile *openSfxFile();