diff options
author | Max Horn | 2010-06-28 12:28:46 +0000 |
---|---|---|
committer | Max Horn | 2010-06-28 12:28:46 +0000 |
commit | 4fdbd14a60afc72c3b936b02dffd39935594e8e5 (patch) | |
tree | bd7fc0987922e683d8a1d92b57a910c8ec6b2c82 /engines/sci/engine/segment.cpp | |
parent | 4f606cc10df1253cb035e3828f974c03f92e631f (diff) | |
download | scummvm-rg350-4fdbd14a60afc72c3b936b02dffd39935594e8e5.tar.gz scummvm-rg350-4fdbd14a60afc72c3b936b02dffd39935594e8e5.tar.bz2 scummvm-rg350-4fdbd14a60afc72c3b936b02dffd39935594e8e5.zip |
SCI: Move a few remaining Script methods to engine/script.cpp
svn-id: r50441
Diffstat (limited to 'engines/sci/engine/segment.cpp')
-rw-r--r-- | engines/sci/engine/segment.cpp | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/engines/sci/engine/segment.cpp b/engines/sci/engine/segment.cpp index 21ca1fe9b4..cb908979a3 100644 --- a/engines/sci/engine/segment.cpp +++ b/engines/sci/engine/segment.cpp @@ -245,66 +245,6 @@ SegmentRef SystemStrings::dereference(reg_t pointer) { } -//-------------------- script -------------------- -reg_t Script::findCanonicAddress(SegManager *segMan, reg_t addr) const { - addr.offset = 0; - return addr; -} - -void Script::freeAtAddress(SegManager *segMan, reg_t addr) { - /* - debugC(2, kDebugLevelGC, "[GC] Freeing script %04x:%04x", PRINT_REG(addr)); - if (_localsSegment) - debugC(2, kDebugLevelGC, "[GC] Freeing locals %04x:0000", _localsSegment); - */ - - if (_markedAsDeleted) - segMan->deallocateScript(_nr); -} - -Common::Array<reg_t> Script::listAllDeallocatable(SegmentId segId) const { - const reg_t r = make_reg(segId, 0); - return Common::Array<reg_t>(&r, 1); -} - -Common::Array<reg_t> Script::listAllOutgoingReferences(reg_t addr) const { - Common::Array<reg_t> tmp; - if (addr.offset <= _bufSize && addr.offset >= -SCRIPT_OBJECT_MAGIC_OFFSET && RAW_IS_OBJECT(_buf + addr.offset)) { - const Object *obj = getObject(addr.offset); - if (obj) { - // Note all local variables, if we have a local variable environment - if (_localsSegment) - tmp.push_back(make_reg(_localsSegment, 0)); - - for (uint i = 0; i < obj->getVarCount(); i++) - tmp.push_back(obj->getVariable(i)); - } else { - error("Request for outgoing script-object reference at %04x:%04x failed", PRINT_REG(addr)); - } - } else { - /* warning("Unexpected request for outgoing script-object references at %04x:%04x", PRINT_REG(addr));*/ - /* Happens e.g. when we're looking into strings */ - } - return tmp; -} - -Common::Array<reg_t> Script::listObjectReferences() const { - Common::Array<reg_t> tmp; - - // Locals, if present - if (_localsSegment) - tmp.push_back(make_reg(_localsSegment, 0)); - - // All objects (may be classes, may be indirectly reachable) - ObjMap::iterator it; - const ObjMap::iterator end = _objects.end(); - for (it = _objects.begin(); it != end; ++it) { - tmp.push_back(it->_value.getPos()); - } - - return tmp; -} - //-------------------- clones -------------------- Common::Array<reg_t> CloneTable::listAllOutgoingReferences(reg_t addr) const { |