diff options
Diffstat (limited to 'engines/sci/engine')
-rw-r--r-- | engines/sci/engine/savegame.cpp | 11 | ||||
-rw-r--r-- | engines/sci/engine/savegame.h | 2 |
2 files changed, 12 insertions, 1 deletions
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index 619bbfb009..9a136d7a63 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -27,6 +27,7 @@ #include "common/system.h" #include "common/func.h" #include "common/serializer.h" +#include "graphics/thumbnail.h" #include "sci/sci.h" #include "sci/gfx/operations.h" @@ -529,6 +530,7 @@ int gamestate_save(EngineState *s, Common::WriteStream *fh, const char* savename */ Common::Serializer ser(0, fh); sync_SavegameMetadata(ser, meta); + Graphics::saveThumbnail(*fh); s->saveLoadWithSerializer(ser); // FIXME: Error handling? return 0; @@ -724,6 +726,15 @@ EngineState *gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) { return NULL; } + if (meta.savegame_version >= 12) { + // We don't need the thumbnail here, so just read it and discard it + Graphics::Surface *thumbnail = new Graphics::Surface(); + assert(thumbnail); + Graphics::loadThumbnail(*fh, *thumbnail); + delete thumbnail; + thumbnail = 0; + } + // FIXME: Do in-place loading at some point, instead of creating a new EngineState instance from scratch. retval = new EngineState(s->resMan, s->_kernel, s->_voc, s->_gui, s->_cursor); diff --git a/engines/sci/engine/savegame.h b/engines/sci/engine/savegame.h index 5da5486da3..95f3099f07 100644 --- a/engines/sci/engine/savegame.h +++ b/engines/sci/engine/savegame.h @@ -36,7 +36,7 @@ namespace Sci { struct EngineState; enum { - CURRENT_SAVEGAME_VERSION = 11, + CURRENT_SAVEGAME_VERSION = 12, MINIMUM_SAVEGAME_VERSION = 9 }; |