aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sci/engine/savegame.cpp10
-rw-r--r--engines/sci/engine/savegame.h1
2 files changed, 8 insertions, 3 deletions
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index 60ad497b84..b0fa31a1bb 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -1184,8 +1184,8 @@ void SegManager::reconstructClones() {
bool gamestate_save(EngineState *s, Common::WriteStream *fh, const Common::String &savename, const Common::String &version) {
- set_savegame_metadata(fh, savename, version);
Common::Serializer ser(nullptr, fh);
+ set_savegame_metadata(ser, fh, savename, version);
s->saveLoadWithSerializer(ser); // FIXME: Error handling?
if (g_sci->_gfxPorts)
g_sci->_gfxPorts->saveLoadWithSerializer(ser);
@@ -1373,7 +1373,7 @@ void gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) {
s->gameIsRestarting = GAMEISRESTARTING_RESTORE;
}
-void set_savegame_metadata(Common::WriteStream *fh, const Common::String &savename, const Common::String &version) {
+void set_savegame_metadata(Common::Serializer &ser, Common::WriteStream *fh, const Common::String &savename, const Common::String &version) {
TimeDate curTime;
g_system->getTimeAndDate(curTime);
@@ -1389,11 +1389,15 @@ void set_savegame_metadata(Common::WriteStream *fh, const Common::String &savena
meta.script0Size = script0->size();
meta.gameObjectOffset = g_sci->getGameObject().getOffset();
- Common::Serializer ser(nullptr, fh);
sync_SavegameMetadata(ser, meta);
Graphics::saveThumbnail(*fh);
}
+void set_savegame_metadata(Common::WriteStream *fh, const Common::String &savename, const Common::String &version) {
+ Common::Serializer ser(nullptr, fh);
+ set_savegame_metadata(ser, fh, savename, version);
+}
+
bool get_savegame_metadata(Common::SeekableReadStream *stream, SavegameMetadata &meta) {
assert(stream);
diff --git a/engines/sci/engine/savegame.h b/engines/sci/engine/savegame.h
index 1ac25b26a9..ac79a76aff 100644
--- a/engines/sci/engine/savegame.h
+++ b/engines/sci/engine/savegame.h
@@ -123,6 +123,7 @@ bool get_savegame_metadata(Common::SeekableReadStream *stream, SavegameMetadata
/**
* Write the header to a savegame.
*/
+void set_savegame_metadata(Common::Serializer &ser, Common::WriteStream *fh, const Common::String &savename, const Common::String &version);
void set_savegame_metadata(Common::WriteStream *fh, const Common::String &savename, const Common::String &version);
} // End of namespace Sci