diff options
author | Martin Kiewitz | 2010-09-05 15:09:50 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-09-05 15:09:50 +0000 |
commit | d817bec4fddf5d808d2a0d630bb9057610267386 (patch) | |
tree | 6103d2558e4efa145795a2bce1798a64c9d7198a /engines/sci/engine/kscripts.cpp | |
parent | 2a08124f0f9274dd442b7154e3b72dd981a7e2e7 (diff) | |
download | scummvm-rg350-d817bec4fddf5d808d2a0d630bb9057610267386.tar.gz scummvm-rg350-d817bec4fddf5d808d2a0d630bb9057610267386.tar.bz2 scummvm-rg350-d817bec4fddf5d808d2a0d630bb9057610267386.zip |
SCI: merging -info- stuff in Clone/DisposeClone
svn-id: r52562
Diffstat (limited to 'engines/sci/engine/kscripts.cpp')
-rw-r--r-- | engines/sci/engine/kscripts.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/engines/sci/engine/kscripts.cpp b/engines/sci/engine/kscripts.cpp index 7cc677cd3a..cebf33017a 100644 --- a/engines/sci/engine/kscripts.cpp +++ b/engines/sci/engine/kscripts.cpp @@ -178,17 +178,13 @@ reg_t kClone(EngineState *s, int argc, reg_t *argv) { *clone_obj = *parent_obj; // Mark as clone - clone_obj->markAsClone(); + clone_obj->markAsClone(); // sets -info- selector clone_obj->setSpeciesSelector(clone_obj->getPos()); if (parent_obj->isClass()) clone_obj->setSuperClassSelector(parent_obj->getPos()); s->_segMan->getScript(parent_obj->getPos().segment)->incrementLockers(); s->_segMan->getScript(clone_obj->getPos().segment)->incrementLockers(); - // Mark as clone for scripts as well - uint16 infoSelector = readSelectorValue(s->_segMan, clone_addr, SELECTOR(_info_)); - writeSelectorValue(s->_segMan, clone_addr, SELECTOR(_info_), (infoSelector & 0x7fff) | 1); - return clone_addr; } @@ -204,17 +200,12 @@ reg_t kDisposeClone(EngineState *s, int argc, reg_t *argv) { return s->r_acc; } - if (!object->isClone()) { - // SCI silently ignores non-clones; some games actually depend on it - return s->r_acc; - } - // SCI uses this technique to find out, if it's a clone and if it's supposed to get freed // At least kq4early relies on this behaviour. The scripts clone "Sound", then set bit 1 manually // and call kDisposeClone later. In that case we may not free it, otherwise we will run into issues // later, because kIsObject would then return false and Sound object wouldn't get checked. uint16 infoSelector = readSelectorValue(s->_segMan, obj, SELECTOR(_info_)); - if ((infoSelector & 3) == 1) + if ((infoSelector & 3) == kInfoFlagClone) object->markAsFreed(); return s->r_acc; |