diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/mads/detection_tables.h | 4 | ||||
-rw-r--r-- | engines/mads/mads.cpp | 18 | ||||
-rw-r--r-- | engines/mads/mads.h | 6 | ||||
-rw-r--r-- | engines/mads/sound.cpp | 5 |
4 files changed, 30 insertions, 3 deletions
diff --git a/engines/mads/detection_tables.h b/engines/mads/detection_tables.h index e68ae380d0..92614ba361 100644 --- a/engines/mads/detection_tables.h +++ b/engines/mads/detection_tables.h @@ -56,7 +56,7 @@ static const MADSGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformDOS, ADGF_NO_FLAGS, - GUIO1(GUIO_NONE) + GUIO1(GUIO_NOSPEECH) }, GType_RexNebular, 0 @@ -74,7 +74,7 @@ static const MADSGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformDOS, ADGF_NO_FLAGS, - GUIO1(GUIO_NONE) + GUIO1(GUIO_NOSPEECH) }, GType_RexNebular, 0 diff --git a/engines/mads/mads.cpp b/engines/mads/mads.cpp index a62ad2d7df..761aef3e66 100644 --- a/engines/mads/mads.cpp +++ b/engines/mads/mads.cpp @@ -44,6 +44,7 @@ MADSEngine::MADSEngine(OSystem *syst, const MADSGameDescription *gameDesc) : _textWindowStill = false; _screenFade = SCREEN_FADE_SMOOTH; _musicFlag = true; + _soundFlag = true; _dithering = false; _debugger = nullptr; @@ -107,12 +108,23 @@ void MADSEngine::loadOptions() { _invObjectsAnimated = ConfMan.getBool("InvObjectsAnimated"); if (ConfMan.hasKey("TextWindowStill")) _textWindowStill = ConfMan.getBool("TextWindowStill"); + + if (ConfMan.hasKey("mute") && ConfMan.getBool("mute")) { + _soundFlag = false; + _musicFlag = false; + } else { + _soundFlag = !ConfMan.hasKey("sfx_mute") || !ConfMan.getBool("sfx_mute"); + _musicFlag = !ConfMan.hasGameDomain("music_mute") || !ConfMan.getBool("music_mute"); + } } void MADSEngine::saveOptions() { ConfMan.setBool("EasyMouse", _easyMouse); ConfMan.setBool("InvObjectsAnimated", _invObjectsAnimated); ConfMan.setBool("TextWindowStill", _textWindowStill); + ConfMan.setBool("mute", !_soundFlag && !_musicFlag); + ConfMan.setBool("sfx_mute", !_soundFlag && _musicFlag); + ConfMan.setBool("music_mute", _soundFlag && !_musicFlag); ConfMan.flushToDisk(); } @@ -153,6 +165,12 @@ bool MADSEngine::canSaveGameStateCurrently() { && _events->_cursorId != CURSOR_WAIT; } +void MADSEngine::syncSoundSettings() { + Engine::syncSoundSettings(); + + loadOptions(); +} + /** * Support method that generates a savegame name * @param slot Slot number diff --git a/engines/mads/mads.h b/engines/mads/mads.h index 7cc0ac8bc2..1d641e7c87 100644 --- a/engines/mads/mads.h +++ b/engines/mads/mads.h @@ -106,6 +106,7 @@ public: bool _textWindowStill; ScreenFade _screenFade; bool _musicFlag; + bool _soundFlag; bool _dithering; public: MADSEngine(OSystem *syst, const MADSGameDescription *gameDesc); @@ -148,6 +149,11 @@ public: */ virtual Common::Error saveGameState(int slot, const Common::String &desc); + /** + * Handles updating sound settings after they're changed in the GMM dialog + */ + virtual void syncSoundSettings(); + void saveOptions(); }; diff --git a/engines/mads/sound.cpp b/engines/mads/sound.cpp index fbf217ba0c..1baa169c55 100644 --- a/engines/mads/sound.cpp +++ b/engines/mads/sound.cpp @@ -146,7 +146,10 @@ void SoundManager::command(int commandId, int param) { if (_queuedCommands.size() < 8) _queuedCommands.push(commandId); } else if (_driver) { - _driver->command(commandId, param); + // Note: I don't know any way to identify music commands versus sfx + // commands, so if sfx is mute, then so is music + if (_vm->_soundFlag) + _driver->command(commandId, param); } } |