aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorRobert Špalek2009-10-15 23:57:13 +0000
committerRobert Špalek2009-10-15 23:57:13 +0000
commitdddce5d97b0c9b0cf723d16ead08d5a00ad7eca0 (patch)
tree8b4ab5332b984b93a28ed0a699e96a0d2325ec98 /engines
parent71d4d12a82bb52cacb2728fb2f9d8837c1549436 (diff)
downloadscummvm-rg350-dddce5d97b0c9b0cf723d16ead08d5a00ad7eca0.tar.gz
scummvm-rg350-dddce5d97b0c9b0cf723d16ead08d5a00ad7eca0.tar.bz2
scummvm-rg350-dddce5d97b0c9b0cf723d16ead08d5a00ad7eca0.zip
Don't crash without sound support.
svn-id: r45137
Diffstat (limited to 'engines')
-rw-r--r--engines/draci/detection.cpp10
-rw-r--r--engines/draci/sound.cpp8
2 files changed, 13 insertions, 5 deletions
diff --git a/engines/draci/detection.cpp b/engines/draci/detection.cpp
index 1d58d25cfa..f9fb7ffa54 100644
--- a/engines/draci/detection.cpp
+++ b/engines/draci/detection.cpp
@@ -143,9 +143,13 @@ SaveStateList DraciMetaEngine::listSaves(const char *target) const {
Common::InSaveFile *in = saveFileMan->openForLoading(*file);
if (in) {
Draci::DraciSavegameHeader header;
- Draci::readSavegameHeader(in, header);
- saveList.push_back(SaveStateDescriptor(slotNum, header.saveName));
- if (header.thumbnail) delete header.thumbnail;
+ if (Draci::readSavegameHeader(in, header)) {
+ saveList.push_back(SaveStateDescriptor(slotNum, header.saveName));
+ if (header.thumbnail) {
+ header.thumbnail->free();
+ delete header.thumbnail;
+ }
+ }
delete in;
}
}
diff --git a/engines/draci/sound.cpp b/engines/draci/sound.cpp
index 09c7aad4ca..6b6e18f364 100644
--- a/engines/draci/sound.cpp
+++ b/engines/draci/sound.cpp
@@ -269,8 +269,12 @@ void Sound::stopAll() {
void Sound::setVolume() {
// TODO: how to retrieve "Mute All" ?
- _muteSound = ConfMan.getBool("sfx_mute");
- _muteVoice = ConfMan.getBool("speech_mute");
+ if (_mixer->isReady()) {
+ _muteSound = ConfMan.getBool("sfx_mute");
+ _muteVoice = ConfMan.getBool("speech_mute");
+ } else {
+ _muteSound = _muteVoice = true;
+ }
_showSubtitles = ConfMan.getBool("subtitles");
_talkSpeed = ConfMan.getInt("talkspeed");
const int soundVolume = ConfMan.getInt("sfx_volume");