aboutsummaryrefslogtreecommitdiff
path: root/engines/saga
diff options
context:
space:
mode:
authorFilippos Karapetis2008-12-19 10:54:05 +0000
committerFilippos Karapetis2008-12-19 10:54:05 +0000
commit2911aa04c18654e32e985217f371eba74dfedd82 (patch)
tree97aa65d7222127e0747368e12aae8b73b32047a4 /engines/saga
parentb7dbd3ec06c3b203d2c8e201a818e6f5e3297f83 (diff)
downloadscummvm-rg350-2911aa04c18654e32e985217f371eba74dfedd82.tar.gz
scummvm-rg350-2911aa04c18654e32e985217f371eba74dfedd82.tar.bz2
scummvm-rg350-2911aa04c18654e32e985217f371eba74dfedd82.zip
Fixed bug #2424530 - "IHNM: SFX are no longer played", by assigning correct default values for missing config manager settings
svn-id: r35436
Diffstat (limited to 'engines/saga')
-rw-r--r--engines/saga/saga.cpp14
-rw-r--r--engines/saga/sound.cpp4
2 files changed, 9 insertions, 9 deletions
diff --git a/engines/saga/saga.cpp b/engines/saga/saga.cpp
index 329dc462d1..6035e7ee12 100644
--- a/engines/saga/saga.cpp
+++ b/engines/saga/saga.cpp
@@ -141,10 +141,10 @@ SagaEngine::~SagaEngine() {
}
Common::Error SagaEngine::init() {
- _musicVolume = ConfMan.getInt("music_volume");
- _subtitlesEnabled = ConfMan.getBool("subtitles");
+ _musicVolume = ConfMan.hasKey("music_volume") ? ConfMan.getInt("music_volume") : 255;
+ _subtitlesEnabled = ConfMan.hasKey("subtitles") ? ConfMan.getBool("subtitles") : true;
_readingSpeed = getTalkspeed();
- _copyProtection = ConfMan.getBool("copy_protection");
+ _copyProtection = ConfMan.hasKey("copy_protection") ? ConfMan.getBool("copy_protection") : false;
_gf_wyrmkeep = false;
_gf_compressed_sounds = false;
_musicWasPlaying = false;
@@ -217,7 +217,7 @@ Common::Error SagaEngine::init() {
_voicesEnabled = true;
ConfMan.setBool("voices", true);
} else {
- _voicesEnabled = ConfMan.getBool("voices");
+ _voicesEnabled = ConfMan.hasKey("voices") ? ConfMan.getBool("voices") : true;
}
} else {
_voicesEnabled = true;
@@ -518,17 +518,17 @@ void SagaEngine::setTalkspeed(int talkspeed) {
}
int SagaEngine::getTalkspeed() {
- return (ConfMan.getInt("talkspeed") * 3 + 255 / 2) / 255;
+ return ((ConfMan.hasKey("talkspeed") ? ConfMan.getInt("talkspeed") : 255) * 3 + 255 / 2) / 255;
}
void SagaEngine::syncSoundSettings() {
- _subtitlesEnabled = ConfMan.getBool("subtitles");
+ _subtitlesEnabled = ConfMan.hasKey("subtitles") ? ConfMan.getBool("subtitles") : true;
_readingSpeed = getTalkspeed();
if (_readingSpeed > 3)
_readingSpeed = 0;
- _musicVolume = ConfMan.getInt("music_volume");
+ _musicVolume = ConfMan.hasKey("music_volume") ? ConfMan.getInt("music_volume") : 255;
_music->setVolume(_musicVolume, 1);
_sound->setVolume();
}
diff --git a/engines/saga/sound.cpp b/engines/saga/sound.cpp
index 107b637167..f87f30a3fa 100644
--- a/engines/saga/sound.cpp
+++ b/engines/saga/sound.cpp
@@ -206,8 +206,8 @@ void Sound::stopAll() {
}
void Sound::setVolume() {
- _vm->_soundVolume = ConfMan.getInt("sound_volume");
- _vm->_speechVolume = ConfMan.getInt("speech_volume");
+ _vm->_soundVolume = ConfMan.hasKey("sound_volume") ? ConfMan.getInt("sound_volume") : 255;
+ _vm->_speechVolume = ConfMan.hasKey("speech_volume") ? ConfMan.getInt("speech_volume") : 255;
_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, _vm->_soundVolume);
_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, _vm->_speechVolume);
}