aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/features.cpp
diff options
context:
space:
mode:
authormd52011-02-28 00:15:47 +0200
committermd52011-02-28 00:15:47 +0200
commit4d3392343675faec3b2427a7cd2d19ddce69884b (patch)
tree8c2aeab5e0a547bac014b1047bb5e62864bb0f1b /engines/sci/engine/features.cpp
parentd90c7a831457ee01f501d564e628fa88374f0419 (diff)
downloadscummvm-rg350-4d3392343675faec3b2427a7cd2d19ddce69884b.tar.gz
scummvm-rg350-4d3392343675faec3b2427a7cd2d19ddce69884b.tar.bz2
scummvm-rg350-4d3392343675faec3b2427a7cd2d19ddce69884b.zip
SCI: Cleanup of the save/load dialog patching code and the lofs type detection code
Diffstat (limited to 'engines/sci/engine/features.cpp')
-rw-r--r--engines/sci/engine/features.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/engines/sci/engine/features.cpp b/engines/sci/engine/features.cpp
index 206624f87e..964097f57d 100644
--- a/engines/sci/engine/features.cpp
+++ b/engines/sci/engine/features.cpp
@@ -285,20 +285,16 @@ SciVersion GameFeatures::detectLofsType() {
}
// Find a function of the "Game" object (which is the game super class) which invokes lofsa/lofss
- reg_t gameSuperClass = g_sci->getGameSuperClassAddress();
+ const Object *gameObject = _segMan->getObject(g_sci->getGameObject());
+ const Object *gameSuperObject = _segMan->getObject(gameObject->getSuperClassSelector());
bool found = false;
- if (!gameSuperClass.isNull()) {
- Common::String gameSuperClassName = _segMan->getObjectName(gameSuperClass);
- const Object *gameSuperObject = _segMan->getObject(gameSuperClass);
+ if (gameSuperObject) {
+ Common::String gameSuperClassName = _segMan->getObjectName(gameObject->getSuperClassSelector());
- if (gameSuperObject) {
- for (uint m = 0; m < gameSuperObject->getMethodCount(); m++) {
- found = autoDetectLofsType(gameSuperClassName, m);
- if (found)
- break;
- }
- } else {
- warning("detectLofsType(): Could not get superclass object");
+ for (uint m = 0; m < gameSuperObject->getMethodCount(); m++) {
+ found = autoDetectLofsType(gameSuperClassName, m);
+ if (found)
+ break;
}
} else {
warning("detectLofsType(): Could not find superclass of game object");