aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorFilippos Karapetis2010-07-23 07:36:55 +0000
committerFilippos Karapetis2010-07-23 07:36:55 +0000
commit3aa4f76ee422b42b6588296862e01eb3e8a50357 (patch)
tree06a8f43b83e9ae79cfc505f65b3d89eb0474f9b1 /engines/sci/engine
parent6da04bc13bdd76ae0230d9eeb3e00eb11b55b20a (diff)
downloadscummvm-rg350-3aa4f76ee422b42b6588296862e01eb3e8a50357.tar.gz
scummvm-rg350-3aa4f76ee422b42b6588296862e01eb3e8a50357.tar.bz2
scummvm-rg350-3aa4f76ee422b42b6588296862e01eb3e8a50357.zip
SCI: Now saving the kPalVary state inside savegames
svn-id: r51194
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/savegame.cpp22
-rw-r--r--engines/sci/engine/savegame.h2
2 files changed, 23 insertions, 1 deletions
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index c080120d7b..72f6ae28a7 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -40,6 +40,7 @@
#include "sci/engine/selector.h"
#include "sci/engine/vm_types.h"
#include "sci/engine/script.h" // for SCI_OBJ_EXPORTS and SCI_OBJ_SYNONYMS
+#include "sci/graphics/palette.h"
#include "sci/graphics/ports.h"
#include "sci/sound/audio.h"
#include "sci/sound/music.h"
@@ -628,6 +629,27 @@ void StringTable::saveLoadWithSerializer(Common::Serializer &ser) {
}
#endif
+void GfxPalette::saveLoadWithSerializer(Common::Serializer &s) {
+ if (s.getVersion() < 24)
+ return;
+
+ if (s.isLoading() && _palVaryResourceId != -1)
+ palVaryRemoveTimer();
+
+ s.syncAsSint32LE(_palVaryResourceId);
+ _palVaryOriginPalette.saveLoadWithSerializer(s);
+ _palVaryTargetPalette.saveLoadWithSerializer(s);
+ s.syncAsSint16LE(_palVaryStep);
+ s.syncAsSint16LE(_palVaryStepStop);
+ s.syncAsSint16LE(_palVaryDirection);
+ s.syncAsUint16LE(_palVaryTicks);
+ s.syncAsSint32LE(_palVaryPaused);
+ s.syncAsSint32LE(_palVarySignal);
+
+ if (s.isLoading() && _palVaryResourceId != -1)
+ palVaryInstallTimer();
+}
+
void SegManager::reconstructStack(EngineState *s) {
DataStack *stack = (DataStack *)(_heap[findSegmentByType(SEG_TYPE_STACK)]);
s->stack_base = stack->_entries;
diff --git a/engines/sci/engine/savegame.h b/engines/sci/engine/savegame.h
index 9a882f2bf7..799a68cbbe 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 = 23,
+ CURRENT_SAVEGAME_VERSION = 24,
MINIMUM_SAVEGAME_VERSION = 12
};