aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2009-11-20 08:55:35 +0000
committerFilippos Karapetis2009-11-20 08:55:35 +0000
commit2f6ded8727f645579dd958fa6c8a7127ce6cca00 (patch)
tree5e0194161835fb8f0de7fd0a4d076497f867c301
parent81d3a24cce060574dcc4312b4f0f6c534225eda8 (diff)
downloadscummvm-rg350-2f6ded8727f645579dd958fa6c8a7127ce6cca00.tar.gz
scummvm-rg350-2f6ded8727f645579dd958fa6c8a7127ce6cca00.tar.bz2
scummvm-rg350-2f6ded8727f645579dd958fa6c8a7127ce6cca00.zip
Shifted some code around
svn-id: r46001
-rw-r--r--engines/sci/engine/state.cpp150
1 files changed, 75 insertions, 75 deletions
diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp
index ee948e1eb9..b34549b6d0 100644
--- a/engines/sci/engine/state.cpp
+++ b/engines/sci/engine/state.cpp
@@ -233,81 +233,6 @@ Common::String EngineState::strSplit(const char *str, const char *sep) {
return retval;
}
-SciVersion EngineState::detectDoSoundType() {
- if (_doSoundType == SCI_VERSION_AUTODETECT) {
- if (_kernel->_selectorCache.nodePtr == -1) {
- // No nodePtr selector, so this game is definitely using
- // SCI0 sound code (i.e. SCI_VERSION_0_EARLY)
- _doSoundType = SCI_VERSION_0_EARLY;
- } else {
- if (!autoDetectFeature(kDetectSoundType)) {
- 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;
- else
- _doSoundType = SCI_VERSION_0_EARLY;
- }
- }
-
- debugC(1, kDebugLevelSound, "Detected DoSound type: %s", getSciVersionDesc(_doSoundType).c_str());
- }
-
- return _doSoundType;
-}
-
-SciVersion EngineState::detectSetCursorType() {
- if (_setCursorType == SCI_VERSION_AUTODETECT) {
- if (getSciVersion() <= SCI_VERSION_01) {
- // SCI0/SCI01 games always have non-colored cursors
- _setCursorType = SCI_VERSION_0_EARLY;
- } else {
- if (!autoDetectFeature(kDetectSetCursorType)) {
- warning("SetCursor detection failed, taking an educated guess");
-
- if (getSciVersion() >= SCI_VERSION_1_1)
- _setCursorType = SCI_VERSION_1_1;
- else
- _setCursorType = SCI_VERSION_0_EARLY;
- }
- }
-
- debugC(1, kDebugLevelGraphics, "Detected SetCursor type: %s", getSciVersionDesc(_setCursorType).c_str());
- }
-
- return _setCursorType;
-}
-
-SciVersion EngineState::detectLofsType() {
- if (_lofsType == SCI_VERSION_AUTODETECT) {
- // This detection only works (and is only needed) for SCI 1
- if (getSciVersion() <= SCI_VERSION_01) {
- _lofsType = SCI_VERSION_0_EARLY;
- return _lofsType;
- }
-
- if (getSciVersion() >= SCI_VERSION_1_1) {
- _lofsType = SCI_VERSION_1_1;
- return _lofsType;
- }
-
- if (!autoDetectFeature(kDetectLofsType)) {
- warning("Lofs detection failed, taking an educated guess");
-
- if (getSciVersion() >= SCI_VERSION_1_MIDDLE)
- _lofsType = SCI_VERSION_1_MIDDLE;
- else
- _lofsType = SCI_VERSION_0_EARLY;
- }
-
- debugC(1, kDebugLevelVM, "Detected Lofs type: %s", getSciVersionDesc(_lofsType).c_str());
- }
-
- return _lofsType;
-}
-
bool EngineState::autoDetectFeature(FeatureDetection featureDetection) {
Common::String objName;
Selector slc;
@@ -492,6 +417,81 @@ bool EngineState::autoDetectFeature(FeatureDetection featureDetection) {
return false; // not found
}
+SciVersion EngineState::detectDoSoundType() {
+ if (_doSoundType == SCI_VERSION_AUTODETECT) {
+ if (_kernel->_selectorCache.nodePtr == -1) {
+ // No nodePtr selector, so this game is definitely using
+ // SCI0 sound code (i.e. SCI_VERSION_0_EARLY)
+ _doSoundType = SCI_VERSION_0_EARLY;
+ } else {
+ if (!autoDetectFeature(kDetectSoundType)) {
+ 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;
+ else
+ _doSoundType = SCI_VERSION_0_EARLY;
+ }
+ }
+
+ debugC(1, kDebugLevelSound, "Detected DoSound type: %s", getSciVersionDesc(_doSoundType).c_str());
+ }
+
+ return _doSoundType;
+}
+
+SciVersion EngineState::detectSetCursorType() {
+ if (_setCursorType == SCI_VERSION_AUTODETECT) {
+ if (getSciVersion() <= SCI_VERSION_01) {
+ // SCI0/SCI01 games always have non-colored cursors
+ _setCursorType = SCI_VERSION_0_EARLY;
+ } else {
+ if (!autoDetectFeature(kDetectSetCursorType)) {
+ warning("SetCursor detection failed, taking an educated guess");
+
+ if (getSciVersion() >= SCI_VERSION_1_1)
+ _setCursorType = SCI_VERSION_1_1;
+ else
+ _setCursorType = SCI_VERSION_0_EARLY;
+ }
+ }
+
+ debugC(1, kDebugLevelGraphics, "Detected SetCursor type: %s", getSciVersionDesc(_setCursorType).c_str());
+ }
+
+ return _setCursorType;
+}
+
+SciVersion EngineState::detectLofsType() {
+ if (_lofsType == SCI_VERSION_AUTODETECT) {
+ // This detection only works (and is only needed) for SCI 1
+ if (getSciVersion() <= SCI_VERSION_01) {
+ _lofsType = SCI_VERSION_0_EARLY;
+ return _lofsType;
+ }
+
+ if (getSciVersion() >= SCI_VERSION_1_1) {
+ _lofsType = SCI_VERSION_1_1;
+ return _lofsType;
+ }
+
+ if (!autoDetectFeature(kDetectLofsType)) {
+ warning("Lofs detection failed, taking an educated guess");
+
+ if (getSciVersion() >= SCI_VERSION_1_MIDDLE)
+ _lofsType = SCI_VERSION_1_MIDDLE;
+ else
+ _lofsType = SCI_VERSION_0_EARLY;
+ }
+
+ debugC(1, kDebugLevelVM, "Detected Lofs type: %s", getSciVersionDesc(_lofsType).c_str());
+ }
+
+ return _lofsType;
+}
+
SciVersion EngineState::detectGfxFunctionsType() {
if (_gfxFunctionsType == SCI_VERSION_AUTODETECT) {
// This detection only works (and is only needed) for SCI0 games