aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorMax Horn2010-02-07 12:16:45 +0000
committerMax Horn2010-02-07 12:16:45 +0000
commit57f9f4cc09b361648905210bf14f7f1ce91869b0 (patch)
treea6330ab0de71cc1e3886d5fbfd72aba060627580 /engines/sci
parentae0c9b48cd48abcca3b4ff66043f38f112aff0d2 (diff)
downloadscummvm-rg350-57f9f4cc09b361648905210bf14f7f1ce91869b0.tar.gz
scummvm-rg350-57f9f4cc09b361648905210bf14f7f1ce91869b0.tar.bz2
scummvm-rg350-57f9f4cc09b361648905210bf14f7f1ce91869b0.zip
SCI: Some cleanup
svn-id: r47963
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/engine/features.cpp45
1 files changed, 19 insertions, 26 deletions
diff --git a/engines/sci/engine/features.cpp b/engines/sci/engine/features.cpp
index aa2bbf61fb..57bf12c391 100644
--- a/engines/sci/engine/features.cpp
+++ b/engines/sci/engine/features.cpp
@@ -137,19 +137,17 @@ SciVersion GameFeatures::detectDoSoundType() {
// No nodePtr selector, so this game is definitely using newer
// SCI0 sound code (i.e. SCI_VERSION_0_LATE)
_doSoundType = SCI_VERSION_0_LATE;
+ } else if (getSciVersion() >= SCI_VERSION_1_LATE) {
+ // All SCI1 late games use the newer doSound semantics
+ _doSoundType = SCI_VERSION_1_LATE;
} else {
- if (getSciVersion() >= SCI_VERSION_1_LATE) {
- // All SCI1 late games use the newer doSound semantics
- _doSoundType = SCI_VERSION_1_LATE;
- } else {
- if (!autoDetectSoundType()) {
- warning("DoSound detection failed, taking an educated guess");
-
- if (getSciVersion() >= SCI_VERSION_1_MIDDLE)
- _doSoundType = SCI_VERSION_1_LATE;
- else if (getSciVersion() > SCI_VERSION_01)
- _doSoundType = SCI_VERSION_1_EARLY;
- }
+ if (!autoDetectSoundType()) {
+ warning("DoSound detection failed, taking an educated guess");
+
+ if (getSciVersion() >= SCI_VERSION_1_MIDDLE)
+ _doSoundType = SCI_VERSION_1_LATE;
+ else if (getSciVersion() > SCI_VERSION_01)
+ _doSoundType = SCI_VERSION_1_EARLY;
}
}
@@ -326,10 +324,7 @@ SciVersion GameFeatures::detectGfxFunctionsType() {
// This detection only works (and is only needed) for SCI0 games
if (getSciVersion() >= SCI_VERSION_01) {
_gfxFunctionsType = SCI_VERSION_0_LATE;
- return _gfxFunctionsType;
- }
-
- if (getSciVersion() > SCI_VERSION_0_EARLY) {
+ } else if (getSciVersion() > SCI_VERSION_0_EARLY) {
// Check if the game is using an overlay
bool found = false;
@@ -343,14 +338,12 @@ SciVersion GameFeatures::detectGfxFunctionsType() {
if (found)
break;
}
- }
- if (_kernel->_selectorCache.overlay == -1 && !found) {
- // No overlay selector found, therefore the game is definitely
- // using old graphics functions
- _gfxFunctionsType = SCI_VERSION_0_EARLY;
- } else if (_kernel->_selectorCache.overlay == -1 && found) {
- // Detection already done above
+ if (!found) {
+ // No overlay selector found, therefore the game is definitely
+ // using old graphics functions
+ _gfxFunctionsType = SCI_VERSION_0_EARLY;
+ }
} else { // _kernel->_selectorCache.overlay != -1
// An in-between case: The game does not have a shiftParser
// selector, but it does have an overlay selector, so it uses an
@@ -417,12 +410,12 @@ bool GameFeatures::autoDetectSci21KernelType() {
}
SciVersion GameFeatures::detectSci21KernelType() {
- if (_sci21KernelType == SCI_VERSION_NONE)
+ if (_sci21KernelType == SCI_VERSION_NONE) {
if (!autoDetectSci21KernelType())
error("Could not detect the SCI2.1 kernel table type");
- debugC(1, kDebugLevelVM, "Detected SCI2.1 kernel type: %s", getSciVersionDesc(_sci21KernelType).c_str());
-
+ debugC(1, kDebugLevelVM, "Detected SCI2.1 kernel type: %s", getSciVersionDesc(_sci21KernelType).c_str());
+ }
return _sci21KernelType;
}
#endif