aboutsummaryrefslogtreecommitdiff
path: root/engines/mads/mads.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/mads/mads.cpp')
-rw-r--r--engines/mads/mads.cpp18
1 files changed, 18 insertions, 0 deletions
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