From 408eeac55cd5265114673d21c7a353a885f8825c Mon Sep 17 00:00:00 2001 From: sluicebox Date: Tue, 26 Mar 2019 22:50:46 -0700 Subject: SCI: Synchronize QFG4 control panel audio settings Fixes Audio button in control panel getting out of sync with the message mode set by ScummVM. --- engines/sci/engine/guest_additions.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'engines/sci/engine/guest_additions.cpp') 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 -- cgit v1.2.3