SCI: Updated Script::getObjectMap()

It now returns a reference to the object list instead of copying it
This commit is contained in:
Filippos Karapetis 2011-11-05 13:07:09 +02:00
parent 3e98c56377
commit 5969c6bd2e
2 changed files with 2 additions and 2 deletions

View File

@ -87,7 +87,7 @@ public:
SegmentId getLocalsSegment() const { return _localsSegment; } SegmentId getLocalsSegment() const { return _localsSegment; }
reg_t *getLocalsBegin() { return _localsBlock ? _localsBlock->_locals.begin() : NULL; } reg_t *getLocalsBegin() { return _localsBlock ? _localsBlock->_locals.begin() : NULL; }
void syncLocalsBlock(SegManager *segMan); void syncLocalsBlock(SegManager *segMan);
ObjMap getObjectMap() const { return _objects; } ObjMap &getObjectMap() { return _objects; }
public: public:
Script(); Script();

View File

@ -269,7 +269,7 @@ reg_t SegManager::findObjectByName(const Common::String &name, int index) {
if (mobj->getType() == SEG_TYPE_SCRIPT) { if (mobj->getType() == SEG_TYPE_SCRIPT) {
// It's a script, scan all objects in it // It's a script, scan all objects in it
const Script *scr = (const Script *)mobj; Script *scr = (Script *)mobj;
ObjMap objects = scr->getObjectMap(); ObjMap objects = scr->getObjectMap();
for (ObjMap::const_iterator it = objects.begin(); it != objects.end(); ++it) { for (ObjMap::const_iterator it = objects.begin(); it != objects.end(); ++it) {
objpos.offset = it->_value.getPos().offset; objpos.offset = it->_value.getPos().offset;