SKY: Cleanup volume levels initialization

This commit is contained in:
dhewg
2011-03-19 16:49:15 +01:00
parent fa11a6e8cf
commit 5e8907fc3c
2 changed files with 20 additions and 11 deletions
+18 -11
View File
@@ -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;
+2
View File
@@ -84,6 +84,8 @@ public:
SkyEngine(OSystem *syst);
virtual ~SkyEngine();
virtual void syncSoundSettings();
static bool isDemo();
static bool isCDVersion();