aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sci.cpp
diff options
context:
space:
mode:
authorVincent Bénony2016-01-06 16:20:23 +0100
committerVincent Bénony2016-01-06 16:20:23 +0100
commitefdb5679ce6304dbc854afbbc511e633d7513338 (patch)
treee680a240e5f6018fc3a4cce53b50060caa22a929 /engines/sci/sci.cpp
parent4687ff6d6d2863cc95c8137543ecf9c39bc01723 (diff)
parentb72c02bad44749a1355acefdb198e36b2e772575 (diff)
downloadscummvm-rg350-efdb5679ce6304dbc854afbbc511e633d7513338.tar.gz
scummvm-rg350-efdb5679ce6304dbc854afbbc511e633d7513338.tar.bz2
scummvm-rg350-efdb5679ce6304dbc854afbbc511e633d7513338.zip
IOS: Merge branch 'master' into ios-fix
Diffstat (limited to 'engines/sci/sci.cpp')
-rw-r--r--engines/sci/sci.cpp92
1 files changed, 68 insertions, 24 deletions
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index 668ad053cc..f1ab65ef98 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -194,12 +194,6 @@ SciEngine::~SciEngine() {
extern void showScummVMDialog(const Common::String &message);
Common::Error SciEngine::run() {
- // Assign default values to the config manager, in case settings are missing
- ConfMan.registerDefault("originalsaveload", "false");
- ConfMan.registerDefault("native_fb01", "false");
- ConfMan.registerDefault("windows_cursors", "false"); // Windows cursors for KQ6 Windows
- ConfMan.registerDefault("silver_cursors", "false"); // Silver cursors for SQ4 CD
-
_resMan = new ResourceManager();
assert(_resMan);
_resMan->addAppropriateSources();
@@ -892,29 +886,79 @@ bool SciEngine::speechAndSubtitlesEnabled() {
}
void SciEngine::syncIngameAudioOptions() {
- // Sync the in-game speech/subtitles settings for SCI1.1 CD games
- if (isCD() && getSciVersion() == SCI_VERSION_1_1) {
- bool subtitlesOn = ConfMan.getBool("subtitles");
- bool speechOn = !ConfMan.getBool("speech_mute");
+ bool useGlobal90 = false;
- if (subtitlesOn && !speechOn) {
- _gamestate->variables[VAR_GLOBAL][90] = make_reg(0, 1); // subtitles
- } else if (!subtitlesOn && speechOn) {
- _gamestate->variables[VAR_GLOBAL][90] = make_reg(0, 2); // speech
- } else if (subtitlesOn && speechOn) {
- // Is it a game that supports simultaneous speech and subtitles?
+ // Sync the in-game speech/subtitles settings for SCI1.1 CD games
+ if (isCD()) {
+ switch (getSciVersion()) {
+ case SCI_VERSION_1_1:
+ // All SCI1.1 CD games use global 90
+ useGlobal90 = true;
+ break;
+#ifdef ENABLE_SCI32
+ case SCI_VERSION_2:
+ case SCI_VERSION_2_1_EARLY:
+ case SCI_VERSION_2_1_MIDDLE:
+ case SCI_VERSION_2_1_LATE:
+ // Only use global 90 for some specific games, not all SCI32 games used this method
switch (_gameId) {
- case GID_SQ4:
- case GID_FREDDYPHARKAS:
- case GID_ECOQUEST:
- case GID_LSL6:
- case GID_LAURABOW2:
- case GID_KQ6:
- _gamestate->variables[VAR_GLOBAL][90] = make_reg(0, 3); // speech + subtitles
+ case GID_KQ7: // SCI2.1
+ case GID_GK1: // SCI2
+ case GID_GK2: // SCI2.1
+ case GID_SQ6: // SCI2.1
+ case GID_TORIN: // SCI2.1
+ case GID_QFG4: // SCI2.1
+ useGlobal90 = true;
break;
+ case GID_LSL6: // SCI2.1
+ // TODO: Uses gameFlags array
+ break;
+ // TODO: Unknown at the moment:
+ // Shivers - seems not to use global 90
+ // Police Quest: SWAT - unable to check
+ // Police Quest 4 - unable to check
+ // Mixed Up Mother Goose - unable to check
+ // Phantasmagoria - seems to use global 90, unable to check for subtitles atm
default:
- // Game does not support speech and subtitles, set it to speech
+ return;
+ }
+ break;
+#endif // ENABLE_SCI32
+ default:
+ return;
+ }
+
+ bool subtitlesOn = ConfMan.getBool("subtitles");
+ bool speechOn = !ConfMan.getBool("speech_mute");
+
+ if (useGlobal90) {
+ if (subtitlesOn && !speechOn) {
+ _gamestate->variables[VAR_GLOBAL][90] = make_reg(0, 1); // subtitles
+ } else if (!subtitlesOn && speechOn) {
_gamestate->variables[VAR_GLOBAL][90] = make_reg(0, 2); // speech
+ } else if (subtitlesOn && speechOn) {
+ // Is it a game that supports simultaneous speech and subtitles?
+ switch (_gameId) {
+ case GID_SQ4:
+ case GID_FREDDYPHARKAS:
+ case GID_ECOQUEST:
+ case GID_LSL6:
+ case GID_LAURABOW2:
+ case GID_KQ6:
+#ifdef ENABLE_SCI32
+ // Unsure about Gabriel Knight 2
+ case GID_KQ7: // SCI2.1
+ case GID_GK1: // SCI2
+ case GID_SQ6: // SCI2.1, SQ6 seems to always use subtitles anyway
+ case GID_TORIN: // SCI2.1
+ case GID_QFG4: // SCI2.1
+#endif // ENABLE_SCI32
+ _gamestate->variables[VAR_GLOBAL][90] = make_reg(0, 3); // speech + subtitles
+ break;
+ default:
+ // Game does not support speech and subtitles, set it to speech
+ _gamestate->variables[VAR_GLOBAL][90] = make_reg(0, 2); // speech
+ }
}
}
}