aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorColin Snover2017-05-20 20:16:32 -0500
committerColin Snover2017-05-20 21:14:18 -0500
commitbc9835ba5ee32679a715f4f5f734786b7120191f (patch)
treeded9352fcb9381565e1b30b83417dc97bf52d045 /engines/sci
parent881be25fcd82d765235e95ebf041a70ec1ae5ae5 (diff)
downloadscummvm-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/sci')
-rw-r--r--engines/sci/console.cpp4
-rw-r--r--engines/sci/engine/guest_additions.cpp12
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;
}