diff options
author | Max Horn | 2009-09-17 16:50:53 +0000 |
---|---|---|
committer | Max Horn | 2009-09-17 16:50:53 +0000 |
commit | eb77efda785dd7df31a90fb3fd57ea17bf49a606 (patch) | |
tree | 5a31e8292859154a920a0abdf945df0cbd0e4ab4 /engines/sci/engine/scriptdebug.cpp | |
parent | 9651562e72ac4c73393a2aba87e835269c25210f (diff) | |
download | scummvm-rg350-eb77efda785dd7df31a90fb3fd57ea17bf49a606.tar.gz scummvm-rg350-eb77efda785dd7df31a90fb3fd57ea17bf49a606.tar.bz2 scummvm-rg350-eb77efda785dd7df31a90fb3fd57ea17bf49a606.zip |
SCI: Add a global getSciVersion() function and make use of it
svn-id: r44170
Diffstat (limited to 'engines/sci/engine/scriptdebug.cpp')
-rw-r--r-- | engines/sci/engine/scriptdebug.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index 8c086758d6..099976343a 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -69,7 +69,6 @@ int propertyOffsetToId(SegManager *segMan, int prop_ofs, reg_t objp) { Object *obj = segMan->getObject(objp); byte *selectoroffset; int selectors; - SciVersion version = segMan->sciVersion(); // for the selector defines if (!obj) { warning("Applied propertyOffsetToId on non-object at %04x:%04x", PRINT_REG(objp)); @@ -78,11 +77,11 @@ int propertyOffsetToId(SegManager *segMan, int prop_ofs, reg_t objp) { selectors = obj->_variables.size(); - if (segMan->sciVersion() < SCI_VERSION_1_1) + if (getSciVersion() < SCI_VERSION_1_1) selectoroffset = ((byte *)(obj->base_obj)) + SCRIPT_SELECTOR_OFFSET + selectors * 2; else { - if (!(obj->getInfoSelector(version).offset & SCRIPT_INFO_CLASS)) { - obj = segMan->getObject(obj->getSuperClassSelector(version)); + if (!(obj->getInfoSelector().offset & SCRIPT_INFO_CLASS)) { + obj = segMan->getObject(obj->getSuperClassSelector()); selectoroffset = (byte *)obj->base_vars; } else selectoroffset = (byte *)obj->base_vars; @@ -269,7 +268,7 @@ reg_t disassemble(EngineState *s, reg_t pos, int print_bw_tag, int print_bytecod if (opcode == op_callk) { int stackframe = (scr[pos.offset + 2] >> 1) + (scriptState.restAdjust); int argc = ((scriptState.xs->sp)[- stackframe - 1]).offset; - bool oldScriptHeader = (s->segMan->sciVersion() == SCI_VERSION_0_EARLY); + bool oldScriptHeader = (getSciVersion() == SCI_VERSION_0_EARLY); if (!oldScriptHeader) argc += (scriptState.restAdjust); |