aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sci.cpp
diff options
context:
space:
mode:
authorKamil Zbróg2013-11-26 18:53:03 +0000
committerKamil Zbróg2013-11-26 18:53:03 +0000
commit15bb1c61eda48f09253ccb8d2a42ccad59f3b00a (patch)
treec2f5ac2907225730c6f1cdaa000f549ef7951183 /engines/sci/sci.cpp
parent446c57d281e592653c9935c896d33334d23f0519 (diff)
parente1afc7d0d777dad4b7ca0a58f0bb0324b24f9584 (diff)
downloadscummvm-rg350-15bb1c61eda48f09253ccb8d2a42ccad59f3b00a.tar.gz
scummvm-rg350-15bb1c61eda48f09253ccb8d2a42ccad59f3b00a.tar.bz2
scummvm-rg350-15bb1c61eda48f09253ccb8d2a42ccad59f3b00a.zip
Merge remote-tracking branch 'sync/master' into prince-malik
Conflicts: engines/configure.engines engines/engines.mk engines/plugins_table.h
Diffstat (limited to 'engines/sci/sci.cpp')
-rw-r--r--engines/sci/sci.cpp56
1 files changed, 45 insertions, 11 deletions
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index e24a5f1429..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
@@ -882,6 +883,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 +905,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 +929,38 @@ 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;
+ default:
+ 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;
}
}
}