[Scummvm-cvs-logs] scummvm master -> 97ef41707ab957099b4972bba501479001315e69

dreammaster dreammaster at scummvm.org
Sun Mar 15 00:10:39 CET 2015


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
97ef41707a MADS: Hook up sfx/music flags


Commit: 97ef41707ab957099b4972bba501479001315e69
    https://github.com/scummvm/scummvm/commit/97ef41707ab957099b4972bba501479001315e69
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-03-14T19:09:44-04:00

Commit Message:
MADS: Hook up sfx/music flags

Changed paths:
    engines/mads/detection_tables.h
    engines/mads/mads.cpp
    engines/mads/mads.h
    engines/mads/sound.cpp



diff --git a/engines/mads/detection_tables.h b/engines/mads/detection_tables.h
index e68ae38..92614ba 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 a62ad2d..761aef3 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 7cc0ac8..1d641e7 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 fbf217b..1baa169 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);
 	}
 }
 






More information about the Scummvm-git-logs mailing list