aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordhewg2011-03-19 15:08:59 +0100
committerdhewg2011-03-19 16:49:15 +0100
commit5e8907fc3cff41cd27e04bbbe5d434f2017fca88 (patch)
tree0a2642380a496a531edba61c2cd33828bd9bf95b
parentfa11a6e8cffc0ed177329aaa0e8bf15387a15d49 (diff)
downloadscummvm-rg350-5e8907fc3cff41cd27e04bbbe5d434f2017fca88.tar.gz
scummvm-rg350-5e8907fc3cff41cd27e04bbbe5d434f2017fca88.tar.bz2
scummvm-rg350-5e8907fc3cff41cd27e04bbbe5d434f2017fca88.zip
SKY: Cleanup volume levels initialization
-rw-r--r--engines/sky/sky.cpp29
-rw-r--r--engines/sky/sky.h2
2 files changed, 20 insertions, 11 deletions
diff --git a/engines/sky/sky.cpp b/engines/sky/sky.cpp
index c42bb6301e..f3556c84b3 100644
--- a/engines/sky/sky.cpp
+++ b/engines/sky/sky.cpp
@@ -100,6 +100,22 @@ SkyEngine::~SkyEngine() {
free(_itemList[i]);
}
+void SkyEngine::syncSoundSettings() {
+ Engine::syncSoundSettings();
+
+ bool mute = false;
+ if (ConfMan.hasKey("mute"))
+ mute = ConfMan.getBool("mute");
+
+ if (ConfMan.getBool("sfx_mute"))
+ SkyEngine::_systemVars.systemFlags |= SF_FX_OFF;
+
+ if (ConfMan.getBool("music_mute"))
+ SkyEngine::_systemVars.systemFlags |= SF_MUS_OFF;
+
+ _skyMusic->setVolume(mute ? 0: ConfMan.getInt("music_volume") >> 1);
+}
+
GUI::Debugger *SkyEngine::getDebugger() {
return _debugger;
}
@@ -242,16 +258,6 @@ Common::Error SkyEngine::go() {
Common::Error SkyEngine::init() {
initGraphics(320, 200, false);
- if (ConfMan.getBool("sfx_mute")) {
- SkyEngine::_systemVars.systemFlags |= SF_FX_OFF;
- }
- if (ConfMan.getBool("music_mute")) {
- SkyEngine::_systemVars.systemFlags |= SF_MUS_OFF;
- }
- _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
- _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, ConfMan.getInt("speech_volume"));
- _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));
-
_skyDisk = new Disk();
_skySound = new Sound(_mixer, _skyDisk, Audio::Mixer::kMaxChannelVolume);
@@ -346,7 +352,8 @@ Common::Error SkyEngine::init() {
}
}
- _skyMusic->setVolume(ConfMan.getInt("music_volume") >> 1);
+ // Setup mixer
+ syncSoundSettings();
_debugger = new Debugger(_skyLogic, _skyMouse, _skyScreen, _skyCompact);
return Common::kNoError;
diff --git a/engines/sky/sky.h b/engines/sky/sky.h
index 29e7c9ab42..d8ced1e569 100644
--- a/engines/sky/sky.h
+++ b/engines/sky/sky.h
@@ -84,6 +84,8 @@ public:
SkyEngine(OSystem *syst);
virtual ~SkyEngine();
+ virtual void syncSoundSettings();
+
static bool isDemo();
static bool isCDVersion();