aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sci/console.cpp12
-rw-r--r--engines/sci/engine/object.h1
-rw-r--r--engines/sci/engine/savegame.cpp7
3 files changed, 7 insertions, 13 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index bc115341b7..0e90f22eba 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -2175,11 +2175,11 @@ bool Console::segmentInfo(int nr) {
else
debugPrintf(" Locals : none\n");
- ObjMap objects = scr->getObjectMap();
+ const ObjMap &objects = scr->getObjectMap();
debugPrintf(" Objects: %4d\n", objects.size());
- ObjMap::iterator it;
- const ObjMap::iterator end = objects.end();
+ ObjMap::const_iterator it;
+ const ObjMap::const_iterator end = objects.end();
for (it = objects.begin(); it != end; ++it) {
debugPrintf(" ");
// Object header
@@ -3546,9 +3546,9 @@ void Console::printKernelCallsFound(int kernelFuncNum, bool showFoundScripts) {
script = customSegMan->getScript(scriptSegment);
// Iterate through all the script's objects
- ObjMap objects = script->getObjectMap();
- ObjMap::iterator it;
- const ObjMap::iterator end = objects.end();
+ const ObjMap &objects = script->getObjectMap();
+ ObjMap::const_iterator it;
+ const ObjMap::const_iterator end = objects.end();
for (it = objects.begin(); it != end; ++it) {
const Object *obj = customSegMan->getObject(it->_value.getPos());
const char *objName = customSegMan->getObjectName(it->_value.getPos());
diff --git a/engines/sci/engine/object.h b/engines/sci/engine/object.h
index 136a831636..71b366dc79 100644
--- a/engines/sci/engine/object.h
+++ b/engines/sci/engine/object.h
@@ -309,7 +309,6 @@ public:
void initSpecies(SegManager *segMan, reg_t addr);
void initSuperClass(SegManager *segMan, reg_t addr);
bool initBaseObject(SegManager *segMan, reg_t addr, bool doInitSuperClass = true);
- void syncBaseObject(const SciSpan<const byte> &ptr) { _baseObj = ptr; }
#ifdef ENABLE_SCI32
bool mustSetViewVisible(const int index, const bool fromPropertyOp) const;
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index dce6430946..1095b7fe53 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -255,11 +255,6 @@ void SegManager::saveLoadWithSerializer(Common::Serializer &s) {
if (s.isLoading()) {
// Hook the script up in the script->segment map
_scriptSegMap[scr->getScriptNumber()] = i;
-
- ObjMap objects = scr->getObjectMap();
- for (ObjMap::iterator it = objects.begin(); it != objects.end(); ++it) {
- it->_value.syncBaseObject(scr->getSpan(it->_value.getPos().getOffset()));
- }
}
// Sync the script's string heap
@@ -287,7 +282,7 @@ void SegManager::saveLoadWithSerializer(Common::Serializer &s) {
Script *scr = (Script *)_heap[i];
scr->syncLocalsBlock(this);
- ObjMap objects = scr->getObjectMap();
+ ObjMap &objects = scr->getObjectMap();
for (ObjMap::iterator it = objects.begin(); it != objects.end(); ++it) {
reg_t addr = it->_value.getPos();
Object *obj = scr->scriptObjInit(addr, false);