diff options
author | Colin Snover | 2017-05-20 20:16:32 -0500 |
---|---|---|
committer | Colin Snover | 2017-05-20 21:14:18 -0500 |
commit | bc9835ba5ee32679a715f4f5f734786b7120191f (patch) | |
tree | ded9352fcb9381565e1b30b83417dc97bf52d045 /engines | |
parent | 881be25fcd82d765235e95ebf041a70ec1ae5ae5 (diff) | |
download | scummvm-rg350-bc9835ba5ee32679a715f4f5f734786b7120191f.tar.gz scummvm-rg350-bc9835ba5ee32679a715f4f5f734786b7120191f.tar.bz2 scummvm-rg350-bc9835ba5ee32679a715f4f5f734786b7120191f.zip |
SCI: Always use SegManager::getObjectName to get object names
This ensures that all object name reading code works the same and
is in one place in the codebase.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/console.cpp | 4 | ||||
-rw-r--r-- | engines/sci/engine/guest_additions.cpp | 12 |
2 files changed, 6 insertions, 10 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp index 0e90f22eba..99c5498443 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -4211,14 +4211,14 @@ bool Console::cmdMapVocab994(int argc, const char **argv) { if (obj && ofs < obj->getVarCount()) { uint16 varSelector = obj->getVarSelector(ofs); debugPrintf("%d: property at index %04x of %s is %s %s\n", i, ofs, - s->_segMan->derefString(obj->getNameSelector()), + s->_segMan->getObjectName(reg), _engine->getKernel()->getSelectorName(varSelector).c_str(), markers[varSelector] ? "(repeat!)" : ""); markers[varSelector] = true; } else { debugPrintf("%d: property at index %04x doesn't match up with %s\n", i, ofs, - s->_segMan->derefString(obj->getNameSelector())); + s->_segMan->getObjectName(reg)); } } diff --git a/engines/sci/engine/guest_additions.cpp b/engines/sci/engine/guest_additions.cpp index e2b7354bdf..23f600fe5f 100644 --- a/engines/sci/engine/guest_additions.cpp +++ b/engines/sci/engine/guest_additions.cpp @@ -359,14 +359,10 @@ static const byte SRDialogPatch[] = { }; void GuestAdditions::patchGameSaveRestoreSCI32(Script &script) const { - ObjMap &objMap = script.getObjectMap(); - for (ObjMap::iterator it = objMap.begin(); it != objMap.end(); ++it) { - Object &obj = it->_value; - if (obj.getNameSelector().isNull()) { - continue; - } - - if (Common::String(_segMan->derefString(obj.getNameSelector())) != "SRDialog") { + const ObjMap &objMap = script.getObjectMap(); + for (ObjMap::const_iterator it = objMap.begin(); it != objMap.end(); ++it) { + const Object &obj = it->_value; + if (strncmp(_segMan->getObjectName(obj.getPos()), "SRDialog", 8) != 0) { continue; } |