aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorFilippos Karapetis2009-11-20 15:16:03 +0000
committerFilippos Karapetis2009-11-20 15:16:03 +0000
commit662fc11d67edea9142f226e1fe73ef053ab476c3 (patch)
tree78e2a9abadc2e072daf02512a7040e6e8ae77ac8 /engines/sci
parent94c8f77faac80cf9f431ad530d9ec5c6e3672c2b (diff)
downloadscummvm-rg350-662fc11d67edea9142f226e1fe73ef053ab476c3.tar.gz
scummvm-rg350-662fc11d67edea9142f226e1fe73ef053ab476c3.tar.bz2
scummvm-rg350-662fc11d67edea9142f226e1fe73ef053ab476c3.zip
Check the overridden game object when performing setCursor detection, which properly fixes KQ5CD (thanks waltervn)
svn-id: r46009
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/engine/state.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp
index d957dbe1e7..286f423eba 100644
--- a/engines/sci/engine/state.cpp
+++ b/engines/sci/engine/state.cpp
@@ -236,34 +236,41 @@ Common::String EngineState::strSplit(const char *str, const char *sep) {
bool EngineState::autoDetectFeature(FeatureDetection featureDetection, int methodNum) {
Common::String objName;
Selector slc;
+ reg_t objAddr;
// Get address of target script
switch (featureDetection) {
case kDetectGfxFunctions:
objName = "Rm";
+ objAddr = _segMan->findObjectByName(objName);
slc = _kernel->_selectorCache.overlay;
break;
case kDetectMoveCountType:
objName = "Motion";
+ objAddr = _segMan->findObjectByName(objName);
slc = _kernel->_selectorCache.doit;
break;
case kDetectSoundType:
objName = "Sound";
+ objAddr = _segMan->findObjectByName(objName);
slc = _kernel->_selectorCache.play;
break;
case kDetectSetCursorType:
objName = "Game";
+ // We need to check the overridden game object here. Fixes KQ5CD setCursor detection,
+ // as KQ5CD overrides the default setCursor selector of the Game object
+ objAddr = _gameObj;
slc = _kernel->_selectorCache.setCursor;
break;
case kDetectLofsType:
objName = "Game";
+ objAddr = _segMan->findObjectByName(objName);
break;
default:
break;
}
reg_t addr;
- reg_t objAddr = _segMan->findObjectByName(objName);
if (objAddr.isNull()) {
warning("autoDetectFeature: %s object couldn't be found", objName.c_str());
return false;
@@ -464,12 +471,6 @@ SciVersion EngineState::detectSetCursorType() {
}
}
- if (_gameName == "kq5" && Common::File::exists("audio001.002")) {
- // WORKAROUND for KQ5CD: The code of the setCursor selector has not been yet
- // rewritten for cursor views, but the game does use cursor views
- _setCursorType = SCI_VERSION_1_1;
- }
-
debugC(1, kDebugLevelGraphics, "Detected SetCursor type: %s", getSciVersionDesc(_setCursorType).c_str());
}