diff options
author | Willem Jan Palenstijn | 2011-11-11 00:07:27 +0100 |
---|---|---|
committer | Willem Jan Palenstijn | 2011-11-11 00:07:27 +0100 |
commit | 8c57e4bf431be137ed81957a2c3b960a35650d39 (patch) | |
tree | 3fb9ca4b107947a39024d8b9c468212f7f9b21c6 /engines/sci | |
parent | c79b6afcad0f463e7e1ab4ebe50e36f65abd8e16 (diff) | |
download | scummvm-rg350-8c57e4bf431be137ed81957a2c3b960a35650d39.tar.gz scummvm-rg350-8c57e4bf431be137ed81957a2c3b960a35650d39.tar.bz2 scummvm-rg350-8c57e4bf431be137ed81957a2c3b960a35650d39.zip |
SCI: Fix const cast
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/engine/script.h | 1 | ||||
-rw-r--r-- | engines/sci/engine/seg_manager.cpp | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/engines/sci/engine/script.h b/engines/sci/engine/script.h index 90a7c7a11e..1ebae3b7a8 100644 --- a/engines/sci/engine/script.h +++ b/engines/sci/engine/script.h @@ -88,6 +88,7 @@ public: reg_t *getLocalsBegin() { return _localsBlock ? _localsBlock->_locals.begin() : NULL; } void syncLocalsBlock(SegManager *segMan); ObjMap &getObjectMap() { return _objects; } + const ObjMap &getObjectMap() const { return _objects; } public: Script(); diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp index 6722cda6c9..f7da0ce970 100644 --- a/engines/sci/engine/seg_manager.cpp +++ b/engines/sci/engine/seg_manager.cpp @@ -269,8 +269,8 @@ reg_t SegManager::findObjectByName(const Common::String &name, int index) { if (mobj->getType() == SEG_TYPE_SCRIPT) { // It's a script, scan all objects in it - Script *scr = (Script *)mobj; - ObjMap objects = scr->getObjectMap(); + const Script *scr = (const Script *)mobj; + const ObjMap& objects = scr->getObjectMap(); for (ObjMap::const_iterator it = objects.begin(); it != objects.end(); ++it) { objpos.offset = it->_value.getPos().offset; if (name == getObjectName(objpos)) |