aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2009-12-26 13:35:17 +0000
committerFilippos Karapetis2009-12-26 13:35:17 +0000
commit21c6bbc588a981cf8facd63432845a2c81e73e48 (patch)
tree142c878d9e952304527c68f59b3f2e31cdc6b5c7
parentd39ac80f4a8667c20f09c765bcdb9701a828dc28 (diff)
downloadscummvm-rg350-21c6bbc588a981cf8facd63432845a2c81e73e48.tar.gz
scummvm-rg350-21c6bbc588a981cf8facd63432845a2c81e73e48.tar.bz2
scummvm-rg350-21c6bbc588a981cf8facd63432845a2c81e73e48.zip
Fixed graphics functions detection in an old version of SQ3 - my initial thought to rely on the presence of the shiftParser selector was wrong
svn-id: r46580
-rw-r--r--engines/sci/engine/state.cpp75
1 files changed, 34 insertions, 41 deletions
diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp
index 4cc830cb02..a6b924b4a8 100644
--- a/engines/sci/engine/state.cpp
+++ b/engines/sci/engine/state.cpp
@@ -598,49 +598,42 @@ SciVersion EngineState::detectGfxFunctionsType() {
}
if (getSciVersion() > SCI_VERSION_0_EARLY) {
- if (_kernel->findSelector("shiftParser") != -1) {
- // The shiftParser selector was introduced just a bit after the
- // changes to the graphics functions, so if it exists, the game is
- // definitely using newer graphics functions
- _gfxFunctionsType = SCI_VERSION_0_LATE;
- } else {
- // No shiftparser selector, check if the game is using an overlay
- bool found = false;
-
- if (_kernel->_selectorCache.overlay == -1) {
- // No overlay selector found, check if any method of the Rm object
- // is calling kDrawPic, as the overlay selector might be missing in demos
-
- Object *obj = _segMan->getObject(_segMan->findObjectByName("Rm"));
- for (uint m = 0; m < obj->getMethodCount(); m++) {
- found = autoDetectFeature(kDetectGfxFunctions, m);
- if (found)
- break;
- }
+ // Check if the game is using an overlay
+ bool found = false;
+
+ if (_kernel->_selectorCache.overlay == -1) {
+ // No overlay selector found, check if any method of the Rm object
+ // is calling kDrawPic, as the overlay selector might be missing in demos
+
+ Object *obj = _segMan->getObject(_segMan->findObjectByName("Rm"));
+ for (uint m = 0; m < obj->getMethodCount(); m++) {
+ found = autoDetectFeature(kDetectGfxFunctions, m);
+ 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
- } 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
- // overlay. Therefore, check it to see how it calls kDrawPic to
- // determine the graphics functions type used
-
- if (!autoDetectFeature(kDetectGfxFunctions)) {
- warning("Graphics functions detection failed, taking an educated guess");
-
- // Try detecting the graphics function types from the existence of the motionCue
- // selector (which is a bit of a hack)
- if (_kernel->findSelector("motionCue") != -1)
- _gfxFunctionsType = SCI_VERSION_0_LATE;
- else
- _gfxFunctionsType = SCI_VERSION_0_EARLY;
- }
+ 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
+ } 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
+ // overlay. Therefore, check it to see how it calls kDrawPic to
+ // determine the graphics functions type used
+
+ if (!autoDetectFeature(kDetectGfxFunctions)) {
+ warning("Graphics functions detection failed, taking an educated guess");
+
+ // Try detecting the graphics function types from the existence of the motionCue
+ // selector (which is a bit of a hack)
+ if (_kernel->findSelector("motionCue") != -1)
+ _gfxFunctionsType = SCI_VERSION_0_LATE;
+ else
+ _gfxFunctionsType = SCI_VERSION_0_EARLY;
}
}
} else { // (getSciVersion() == SCI_VERSION_0_EARLY)