Turn class Sound into a Serializable

svn-id: r19225
This commit is contained in:
Max Horn 2005-10-21 23:04:58 +00:00
parent ffc5e1718f
commit b5e63f5bfb
3 changed files with 6 additions and 8 deletions

View File

@ -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);
//

View File

@ -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);
}

View File

@ -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();