From 4e2b1f02001676663d9c66c3809bbc234519ee88 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Wed, 20 Nov 2013 23:31:36 +0100 Subject: SCI: script patch for laura bow 2 for audio+text at the same time needs indepth testing --- engines/sci/sci.cpp | 53 ++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 42 insertions(+), 11 deletions(-) (limited to 'engines/sci/sci.cpp') diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp index e24a5f1429..dc62d77ed2 100644 --- a/engines/sci/sci.cpp +++ b/engines/sci/sci.cpp @@ -882,6 +882,16 @@ void SciEngine::syncSoundSettings() { } } +// used by Script Patcher. Used to find out, if Laura Bow 2 needs patching for Speech+Subtitles - or not +bool SciEngine::speechAndSubtitlesEnabled() { + bool subtitlesOn = ConfMan.getBool("subtitles"); + bool speechOn = !ConfMan.getBool("speech_mute"); + + if (subtitlesOn && speechOn) + return true; + return false; +} + void SciEngine::syncIngameAudioOptions() { // Sync the in-game speech/subtitles settings for SCI1.1 CD games if (isCD() && getSciVersion() == SCI_VERSION_1_1) { @@ -894,16 +904,19 @@ void SciEngine::syncIngameAudioOptions() { _gamestate->variables[VAR_GLOBAL][90] = make_reg(0, 2); // speech } else if (subtitlesOn && speechOn) { // Is it a game that supports simultaneous speech and subtitles? - if (getGameId() == GID_SQ4 - || getGameId() == GID_FREDDYPHARKAS - || getGameId() == GID_ECOQUEST - || getGameId() == GID_LSL6 + switch (_gameId) { + case GID_SQ4: + case GID_FREDDYPHARKAS: + case GID_ECOQUEST: + case GID_LSL6: // TODO: The following need script patches for simultaneous speech and subtitles - //|| getGameId() == GID_KQ6 - //|| getGameId() == GID_LAURABOW2 - ) { + // GID_KQ6 _gamestate->variables[VAR_GLOBAL][90] = make_reg(0, 3); // speech + subtitles - } else { + break; + case GID_LAURABOW2: + // Laura Bow 2 gets patched when speech and subtitles are enabled + // It then does both, when the user has "speech" selected. That's why we select speech here + default: // Game does not support speech and subtitles, set it to speech _gamestate->variables[VAR_GLOBAL][90] = make_reg(0, 2); // speech } @@ -915,18 +928,36 @@ 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)) { + uint16 ingameSetting = _gamestate->variables[VAR_GLOBAL][90].getOffset(); + bool subtitlesOn = ConfMan.getBool("subtitles"); + bool speechOn = !ConfMan.getBool("speech_mute"); + + switch (ingameSetting) { + case 1: // subtitles ConfMan.setBool("subtitles", true); ConfMan.setBool("speech_mute", true); - } else if (_gamestate->variables[VAR_GLOBAL][90] == make_reg(0, 2)) { + break; + case 2: // speech + switch (_gameId) { + case GID_LAURABOW2: + // We don't sync "speech" for Laura Bow 2 in case the user choose "both" in the setting + // Because "speech" (2) within SCI means "speech + subtitles" for Laura Bow 2 + if (subtitlesOn && speechOn) + return; + break; + } ConfMan.setBool("subtitles", false); ConfMan.setBool("speech_mute", false); - } else if (_gamestate->variables[VAR_GLOBAL][90] == make_reg(0, 3)) { + break; + case 3: // speech + subtitles ConfMan.setBool("subtitles", true); ConfMan.setBool("speech_mute", false); + break; + default: + break; } } } -- cgit v1.2.3 From 3ea127e87774946bb3fb5e21afdb6dc2a4bb3de6 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Thu, 21 Nov 2013 09:39:19 +0100 Subject: SCI: Fix warning --- engines/sci/sci.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/sci/sci.cpp') diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp index dc62d77ed2..cbad3c6143 100644 --- a/engines/sci/sci.cpp +++ b/engines/sci/sci.cpp @@ -947,6 +947,8 @@ void SciEngine::updateScummVMAudioOptions() { if (subtitlesOn && speechOn) return; break; + default: + break; } ConfMan.setBool("subtitles", false); ConfMan.setBool("speech_mute", false); -- cgit v1.2.3 From ba3656d84e61ae5f99a9449e81c5d3ff2ffa2565 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Thu, 21 Nov 2013 22:41:07 +0100 Subject: SCI: fix script patcher for games w/o vocab --- engines/sci/sci.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/sci/sci.cpp') diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp index cbad3c6143..065565d8de 100644 --- a/engines/sci/sci.cpp +++ b/engines/sci/sci.cpp @@ -225,6 +225,7 @@ Common::Error SciEngine::run() { _gfxScreen->enableUndithering(ConfMan.getBool("disable_dithering")); _kernel = new Kernel(_resMan, segMan); + _kernel->init(); _features = new GameFeatures(segMan, _kernel); // Only SCI0, SCI01 and SCI1 EGA games used a parser -- cgit v1.2.3