diff options
author | Filippos Karapetis | 2009-09-12 18:22:32 +0000 |
---|---|---|
committer | Filippos Karapetis | 2009-09-12 18:22:32 +0000 |
commit | 18b24da384ee7fdc0db8f6cd72ecbb0e3929ad19 (patch) | |
tree | 0de226d2f4e8fe28205a50a2572712687108b7b1 | |
parent | 15cb36a7ee2629e7f09aff02769353f8eded3035 (diff) | |
download | scummvm-rg350-18b24da384ee7fdc0db8f6cd72ecbb0e3929ad19.tar.gz scummvm-rg350-18b24da384ee7fdc0db8f6cd72ecbb0e3929ad19.tar.bz2 scummvm-rg350-18b24da384ee7fdc0db8f6cd72ecbb0e3929ad19.zip |
Removed the INST_LOOKUP_CLASS define
svn-id: r44043
-rw-r--r-- | engines/sci/engine/seg_manager.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp index 1a9475b909..cafccc7e87 100644 --- a/engines/sci/engine/seg_manager.cpp +++ b/engines/sci/engine/seg_manager.cpp @@ -479,9 +479,10 @@ SegmentId SegManager::getScriptSegment(int script_nr, ScriptLoadType load) { return -1; } -#define INST_LOOKUP_CLASS(id) ((id == 0xffff) ? NULL_REG : getClassAddress(id, SCRIPT_GET_LOCK, NULL_REG)) - reg_t SegManager::getClassAddress(int classnr, ScriptLoadType lock, reg_t caller) { + if (classnr == 0xffff) + return NULL_REG; + if (classnr < 0 || (int)_classtable.size() <= classnr || _classtable[classnr].script < 0) { error("[VM] Attempt to dereference class %x, which doesn't exist (max %x)", classnr, _classtable.size()); return NULL_REG; @@ -726,7 +727,8 @@ void SegManager::scriptInitialiseObjectsSci11(SegmentId seg) { #endif // Copy base from species class, as we need its selector IDs - obj->_variables[SCRIPT_SUPERCLASS_SELECTOR] = INST_LOOKUP_CLASS(obj->_variables[SCRIPT_SUPERCLASS_SELECTOR].offset); + obj->_variables[SCRIPT_SUPERCLASS_SELECTOR] = + getClassAddress(obj->_variables[SCRIPT_SUPERCLASS_SELECTOR].offset, SCRIPT_GET_LOCK, NULL_REG); // Set the -classScript- selector to the script number. // FIXME: As this selector is filled in at run-time, it is likely |