diff options
author | Colin Snover | 2017-04-30 13:44:34 -0500 |
---|---|---|
committer | Colin Snover | 2017-04-30 13:44:34 -0500 |
commit | 00168003fed1ec05164a64bdf4abc821da5b1517 (patch) | |
tree | 2eb65efae6ceaffe74073ba3b75b94dfb5d85d73 | |
parent | 94dc6ae05234b33677b10bca438819e59f6175fa (diff) | |
download | scummvm-rg350-00168003fed1ec05164a64bdf4abc821da5b1517.tar.gz scummvm-rg350-00168003fed1ec05164a64bdf4abc821da5b1517.tar.bz2 scummvm-rg350-00168003fed1ec05164a64bdf4abc821da5b1517.zip |
SCI: Clean up ugly syncBaseObject call
-rw-r--r-- | engines/sci/engine/savegame.cpp | 5 | ||||
-rw-r--r-- | engines/sci/engine/script.h | 1 |
2 files changed, 4 insertions, 2 deletions
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index 5ba88d9417..e2099a4865 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -256,8 +256,9 @@ void SegManager::saveLoadWithSerializer(Common::Serializer &s) { _scriptSegMap[scr->getScriptNumber()] = i; ObjMap objects = scr->getObjectMap(); - for (ObjMap::iterator it = objects.begin(); it != objects.end(); ++it) - it->_value.syncBaseObject(SciSpan<const byte>(scr->getBuf(it->_value.getPos().getOffset()), scr->getBufSize() - it->_value.getPos().getOffset())); + 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 diff --git a/engines/sci/engine/script.h b/engines/sci/engine/script.h index f9b3845f6a..65f3ffb6ab 100644 --- a/engines/sci/engine/script.h +++ b/engines/sci/engine/script.h @@ -107,6 +107,7 @@ public: uint32 getBufSize() const { return _buf->size(); } const byte *getBuf(uint offset = 0) const { return _buf->getUnsafeDataAt(offset); } + SciSpan<const byte> getSpan(uint offset) const { return _buf->subspan(offset); } int getScriptNumber() const { return _nr; } SegmentId getLocalsSegment() const { return _localsSegment; } |