aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/savegame.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2009-10-11 15:51:43 +0000
committerFilippos Karapetis2009-10-11 15:51:43 +0000
commit1d3118cf4282dd15d188d07f99cb438348c6d803 (patch)
treee9bf24eb6c4e25a858dec6923b881063a6bccea0 /engines/sci/engine/savegame.cpp
parentba9a9422b42fe447854f7c6e56ff5794135b6b60 (diff)
downloadscummvm-rg350-1d3118cf4282dd15d188d07f99cb438348c6d803.tar.gz
scummvm-rg350-1d3118cf4282dd15d188d07f99cb438348c6d803.tar.bz2
scummvm-rg350-1d3118cf4282dd15d188d07f99cb438348c6d803.zip
Implemented some advanced savegame functionality - loading and deleting savegames from the GMM is now possible, and new saved games will also have thumbnails. Saving from the GMM creates corrupted saved games, so it has been disabled for now
svn-id: r44930
Diffstat (limited to 'engines/sci/engine/savegame.cpp')
-rw-r--r--engines/sci/engine/savegame.cpp11
1 files changed, 11 insertions, 0 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);