aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2004-08-09 01:07:48 +0000
committerTravis Howell2004-08-09 01:07:48 +0000
commitd63d23ed077eb958e3dbdb6d760fe4b75af258de (patch)
tree6bb2b8d1f7dae14fbbfc5a6cff0d8d8de93dd22c
parentdc476abe6021806a8cc30935c91ffabb8e766829 (diff)
downloadscummvm-rg350-d63d23ed077eb958e3dbdb6d760fe4b75af258de.tar.gz
scummvm-rg350-d63d23ed077eb958e3dbdb6d760fe4b75af258de.tar.bz2
scummvm-rg350-d63d23ed077eb958e3dbdb6d760fe4b75af258de.zip
Add patch #999887 - Possible fix for bug #998276
Also saves _currentMusic svn-id: r14525
-rw-r--r--scumm/saveload.cpp2
-rw-r--r--scumm/saveload.h2
-rw-r--r--scumm/sound.cpp11
-rw-r--r--scumm/sound.h8
4 files changed, 20 insertions, 3 deletions
diff --git a/scumm/saveload.cpp b/scumm/saveload.cpp
index a7a78e50a6..03864c8bbe 100644
--- a/scumm/saveload.cpp
+++ b/scumm/saveload.cpp
@@ -383,6 +383,7 @@ void ScummEngine::saveOrLoad(Serializer *s, uint32 savegameVersion) {
};
const SaveLoadEntry *actorEntries = Actor::getSaveLoadEntries();
+ const SaveLoadEntry *soundEntries = _sound->getSaveLoadEntries();
const SaveLoadEntry verbEntries[] = {
MKLINE(VerbSlot, curRect.left, sleInt16, VER(8)),
@@ -672,6 +673,7 @@ void ScummEngine::saveOrLoad(Serializer *s, uint32 savegameVersion) {
}
s->saveLoadArrayOf(_actors, _numActors, sizeof(_actors[0]), actorEntries);
+ s->saveLoadEntries(_sound, soundEntries);
if (savegameVersion < VER(9))
s->saveLoadArrayOf(vm.slot, 25, sizeof(vm.slot[0]), scriptSlotEntries);
diff --git a/scumm/saveload.h b/scumm/saveload.h
index f316666c61..7f11684c2f 100644
--- a/scumm/saveload.h
+++ b/scumm/saveload.h
@@ -32,7 +32,7 @@ namespace Scumm {
// Can be useful for other ports too :)
#define VER(x) x
-#define CURRENT_VER 34
+#define CURRENT_VER 35
// To work around a warning in GCC 3.2 (and 3.1 ?) regarding non-POD types,
// we use a small trick: instead of 0 we use 42. Why? Well, it seems newer GCC
diff --git a/scumm/sound.cpp b/scumm/sound.cpp
index a055aa44e8..a0257b3fbf 100644
--- a/scumm/sound.cpp
+++ b/scumm/sound.cpp
@@ -25,6 +25,7 @@
#include "scumm/imuse.h"
#include "scumm/imuse_digi/dimuse.h"
#include "scumm/scumm.h"
+#include "scumm/saveload.h"
#include "scumm/sound.h"
#include "common/config-manager.h"
@@ -1116,4 +1117,14 @@ void Sound::updateCD() {
AudioCD.updateCD();
}
+const SaveLoadEntry *Sound::getSaveLoadEntries() {
+ static const SaveLoadEntry soundEntries[] = {
+ MKLINE(Sound, _currentCDSound, sleInt16, VER(35)),
+ MKLINE(Sound, _currentMusic, sleInt16, VER(35)),
+ MKEND()
+ };
+
+ return soundEntries;
+}
+
} // End of namespace Scumm
diff --git a/scumm/sound.h b/scumm/sound.h
index b354ac255c..d426e9c625 100644
--- a/scumm/sound.h
+++ b/scumm/sound.h
@@ -32,6 +32,7 @@ class ScummEngine;
class ScummFile;
struct MP3OffsetTable;
+struct SaveLoadEntry;
enum {
kTalkSoundID = 10000
@@ -72,8 +73,8 @@ protected:
int _overrideFreq;
- int _currentCDSound;
- int _currentMusic;
+ int16 _currentCDSound;
+ int16 _currentMusic;
public:
PlayingSoundHandle _talkChannelHandle; // Handle of mixer channel actor is talking on
PlayingSoundHandle _musicChannelHandle; // Handle of mixer channel music is on
@@ -110,6 +111,9 @@ public:
void updateCD();
int getCurrentCDSound() const { return _currentCDSound; }
+ // Used by the save/load system:
+ const SaveLoadEntry *getSaveLoadEntries();
+
protected:
ScummFile *openSfxFile();
void startSfxSound(File *file, int file_size, PlayingSoundHandle *handle, int id = -1);