From 2d7355dcf2ccfbffbb62dc2c795962eebcbd94cd Mon Sep 17 00:00:00 2001 From: athrxx Date: Fri, 20 Dec 2019 00:27:03 +0100 Subject: KYRA: (EOB/PC98) - fix music mute setting (this has to be done a bit different for PC-98, since - unlike the other currently supported platforms - PC-98 has ingame music) --- engines/kyra/engine/eobcommon.cpp | 16 +++++++++++----- engines/kyra/gui/gui_eob.cpp | 1 + 2 files changed, 12 insertions(+), 5 deletions(-) (limited to 'engines/kyra') diff --git a/engines/kyra/engine/eobcommon.cpp b/engines/kyra/engine/eobcommon.cpp index e1d4a4a865..b59a13d2b1 100644 --- a/engines/kyra/engine/eobcommon.cpp +++ b/engines/kyra/engine/eobcommon.cpp @@ -636,11 +636,11 @@ void EoBCoreEngine::registerDefaultSettings() { void EoBCoreEngine::readSettings() { _configHpBarGraphs = ConfMan.getBool("hpbargraphs"); _configMouseBtSwap = ConfMan.getBool("mousebtswap"); - _configSounds = ConfMan.getBool("sfx_mute") ? 0 : 1; - _configMusic = _configSounds ? 1 : 0; + _configSounds = ConfMan.getBool("sfx_mute") ? 0 : 1; + _configMusic = (_flags.platform == Common::kPlatformPC98) ? (ConfMan.getBool("music_mute") ? 0 : 1) : (_configSounds ? 1 : 0); if (_sound) { - _sound->enableMusic(_configSounds ? 1 : 0); + _sound->enableMusic(_configMusic); _sound->enableSFX(_configSounds); } } @@ -649,11 +649,17 @@ void EoBCoreEngine::writeSettings() { ConfMan.setBool("hpbargraphs", _configHpBarGraphs); ConfMan.setBool("mousebtswap", _configMouseBtSwap); ConfMan.setBool("sfx_mute", _configSounds == 0); + if (_flags.platform == Common::kPlatformPC98) + ConfMan.setBool("music_mute", _configMusic == 0); if (_sound) { - if (!_configSounds) + if (_flags.platform == Common::kPlatformPC98) { + if (!_configMusic) + snd_playSong(0); + } else if (!_configSounds) { _sound->haltTrack(); - _sound->enableMusic(_configSounds ? 1 : 0); + } + _sound->enableMusic(_configMusic); _sound->enableSFX(_configSounds); } diff --git a/engines/kyra/gui/gui_eob.cpp b/engines/kyra/gui/gui_eob.cpp index 77fc28d6c3..558766d45b 100644 --- a/engines/kyra/gui/gui_eob.cpp +++ b/engines/kyra/gui/gui_eob.cpp @@ -2293,6 +2293,7 @@ void GUI_EoB::runCampMenu() { case 0x800D: if (_vm->gameFlags().platform == Common::kPlatformPC98) { _vm->_configMusic ^= true; + _vm->writeSettings(); if (_vm->_configMusic) _vm->snd_playSong(_vm->_currentLevel + 1); else -- cgit v1.2.3