aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorFilippos Karapetis2013-10-31 07:25:25 +0200
committerFilippos Karapetis2013-10-31 07:25:25 +0200
commitf9bbc2ca37f40692d555d3b355209a7f2538afda (patch)
treea45fbc76c1148a175a92b7ff245af44ca1decbff /engines/sci/engine
parentbe8bc5f030ec98e470cdda8aa1e0564e16f28ff3 (diff)
downloadscummvm-rg350-f9bbc2ca37f40692d555d3b355209a7f2538afda.tar.gz
scummvm-rg350-f9bbc2ca37f40692d555d3b355209a7f2538afda.tar.bz2
scummvm-rg350-f9bbc2ca37f40692d555d3b355209a7f2538afda.zip
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
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/vm.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index ef8f165084..d7c2fdc0eb 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();
+ }
}
}
}