[Scummvm-cvs-logs] scummvm master -> f9bbc2ca37f40692d555d3b355209a7f2538afda

bluegr bluegr at gmail.com
Thu Oct 31 06:37:59 CET 2013


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:
f9bbc2ca37 SCI: Update ScummVM's game audio options for SCI1.1 CD games


Commit: f9bbc2ca37f40692d555d3b355209a7f2538afda
    https://github.com/scummvm/scummvm/commit/f9bbc2ca37f40692d555d3b355209a7f2538afda
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2013-10-30T22:25:25-07:00

Commit Message:
SCI: Update ScummVM's game audio options for SCI1.1 CD games

This ensures that ScummVM's game audio options for speech and subtitles
get updated when they are changed in the game GUI

Changed paths:
    engines/sci/engine/vm.cpp
    engines/sci/sci.cpp
    engines/sci/sci.h



diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index ef8f165..d7c2fdc 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -200,11 +200,18 @@ static void write_var(EngineState *s, int type, int index, reg_t value) {
 
 		s->variables[type][index] = value;
 
-		// If the game is trying to change its speech/subtitle settings, apply the ScummVM audio
-		// options first, if they haven't been applied yet
-		if (type == VAR_GLOBAL && index == 90 && !g_sci->getEngineState()->_syncedAudioOptions) {
-			g_sci->syncIngameAudioOptions();
-			g_sci->getEngineState()->_syncedAudioOptions = true;
+		if (type == VAR_GLOBAL && index == 90) {
+			// The game is trying to change its speech/subtitle settings
+			if (!g_sci->getEngineState()->_syncedAudioOptions || s->variables[VAR_GLOBAL][4] == TRUE_REG) {
+				// ScummVM audio options haven't been applied yet, so apply them.
+				// We also force the ScummVM audio options when loading a game from
+				// the launcher.
+				g_sci->syncIngameAudioOptions();
+				g_sci->getEngineState()->_syncedAudioOptions = true;
+			} else {
+				// Update ScummVM's audio options
+				g_sci->updateScummVMAudioOptions();
+			}
 		}
 	}
 }
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index c1aadc3..f484b12 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -882,7 +882,7 @@ void SciEngine::syncSoundSettings() {
 }
 
 void SciEngine::syncIngameAudioOptions() {
-	// Now, sync the in-game speech/subtitles settings for SCI1.1 CD games
+	// Sync the in-game speech/subtitles settings for SCI1.1 CD games
 	if (isCD() && getSciVersion() == SCI_VERSION_1_1) {
 		bool subtitlesOn = ConfMan.getBool("subtitles");
 		bool speechOn = !ConfMan.getBool("speech_mute");
@@ -910,6 +910,26 @@ void SciEngine::syncIngameAudioOptions() {
 	}
 }
 
+void SciEngine::updateScummVMAudioOptions() {
+	// Update ScummVM's speech/subtitles settings for SCI1.1 CD games,
+	// depending on the in-game settings
+	if (isCD() && getSciVersion() == SCI_VERSION_1_1) {
+		if (_gamestate->variables[VAR_GLOBAL][90] == make_reg(0, 1)) {
+			// subtitles
+			ConfMan.setBool("subtitles", true);
+			ConfMan.setBool("speech_mute", true);
+		} else if (_gamestate->variables[VAR_GLOBAL][90] == make_reg(0, 2)) {
+			// speech
+			ConfMan.setBool("subtitles", false);
+			ConfMan.setBool("speech_mute", false);
+		} else if (_gamestate->variables[VAR_GLOBAL][90] == make_reg(0, 3)) {
+			// speech + subtitles
+			ConfMan.setBool("subtitles", true);
+			ConfMan.setBool("speech_mute", false);
+		}
+	}
+}
+
 void SciEngine::loadMacExecutable() {
 	if (getPlatform() != Common::kPlatformMacintosh || getSciVersion() < SCI_VERSION_1_EARLY || getSciVersion() > SCI_VERSION_1_1)
 		return;
diff --git a/engines/sci/sci.h b/engines/sci/sci.h
index 0a75e11..5f11d11 100644
--- a/engines/sci/sci.h
+++ b/engines/sci/sci.h
@@ -251,6 +251,7 @@ public:
 	 * - King's Quest 6 CD
 	 */
 	void syncIngameAudioOptions();
+	void updateScummVMAudioOptions();
 
 	const SciGameId &getGameId() const { return _gameId; }
 	const char *getGameIdStr() const;






More information about the Scummvm-git-logs mailing list