aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorsluicebox2019-03-26 22:50:46 -0700
committerFilippos Karapetis2019-03-27 20:21:37 +0200
commit408eeac55cd5265114673d21c7a353a885f8825c (patch)
treeaf3d8b6a039ffb3d3f00573ef2c8b4dcbdc342c7 /engines/sci
parent5959d01a675e14452f533f5098d266c774565a0e (diff)
downloadscummvm-rg350-408eeac55cd5265114673d21c7a353a885f8825c.tar.gz
scummvm-rg350-408eeac55cd5265114673d21c7a353a885f8825c.tar.bz2
scummvm-rg350-408eeac55cd5265114673d21c7a353a885f8825c.zip
SCI: Synchronize QFG4 control panel audio settings
Fixes Audio button in control panel getting out of sync with the message mode set by ScummVM.
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/engine/guest_additions.cpp12
-rw-r--r--engines/sci/engine/vm.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/engines/sci/engine/guest_additions.cpp b/engines/sci/engine/guest_additions.cpp
index afc87a5a8f..b8d6334c96 100644
--- a/engines/sci/engine/guest_additions.cpp
+++ b/engines/sci/engine/guest_additions.cpp
@@ -847,6 +847,18 @@ void GuestAdditions::syncMessageTypeFromScummVMUsingDefaultStrategy() const {
// is no equivalent option in the ScummVM GUI
_state->variables[VAR_GLOBAL][kGlobalVarGK1NarratorMode] = NULL_REG;
}
+
+ if (g_sci->getGameId() == GID_QFG4) {
+ // QFG4 uses a game flag to control the Audio button's state in the control panel.
+ // This flag must be kept in sync with the standard global 90 speech bit.
+ uint flagNumber = 400;
+ uint globalNumber = kGlobalVarQFG4Flags + (flagNumber / 16);
+ if (value & kMessageTypeSpeech) {
+ _state->variables[VAR_GLOBAL][globalNumber] |= 0x8000;
+ } else {
+ _state->variables[VAR_GLOBAL][globalNumber] &= ~0x8000;
+ }
+ }
}
#ifdef ENABLE_SCI32
diff --git a/engines/sci/engine/vm.h b/engines/sci/engine/vm.h
index 1ba24aea89..f6a4077810 100644
--- a/engines/sci/engine/vm.h
+++ b/engines/sci/engine/vm.h
@@ -178,6 +178,7 @@ enum GlobalVar {
kGlobalVarPhant2MasterVolume = 236, // 0 to 127
kGlobalVarPhant2ControlPanel = 250,
kGlobalVarShivers1Score = 349,
+ kGlobalVarQFG4Flags = 500,
kGlobalVarHoyle5MusicVolume = 897,
kkGlobalVarHoyle5ResponseTime = 899
};