aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/savegame.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/engine/savegame.cpp')
-rw-r--r--engines/sci/engine/savegame.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index 3de555cad3..806c8893b4 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -563,6 +563,18 @@ void StringTable::saveLoadWithSerializer(Common::Serializer &ser) {
}
#endif
+void GfxPalette::palVarySaveLoadPalette(Common::Serializer &s, Palette *palette) {
+ s.syncBytes(palette->mapping, 256);
+ s.syncAsUint32LE(palette->timestamp);
+ for (int i = 0; i < 256; i++) {
+ s.syncAsByte(palette->colors[i].used);
+ s.syncAsByte(palette->colors[i].r);
+ s.syncAsByte(palette->colors[i].g);
+ s.syncAsByte(palette->colors[i].b);
+ }
+ s.syncBytes(palette->intensity, 256);
+}
+
void GfxPalette::saveLoadWithSerializer(Common::Serializer &s) {
if (s.getVersion() < 24)
return;
@@ -572,8 +584,8 @@ void GfxPalette::saveLoadWithSerializer(Common::Serializer &s) {
s.syncAsSint32LE(_palVaryResourceId);
if (_palVaryResourceId != -1) {
- _palVaryOriginPalette.saveLoadWithSerializer(s);
- _palVaryTargetPalette.saveLoadWithSerializer(s);
+ palVarySaveLoadPalette(s, &_palVaryOriginPalette);
+ palVarySaveLoadPalette(s, &_palVaryTargetPalette);
s.syncAsSint16LE(_palVaryStep);
s.syncAsSint16LE(_palVaryStepStop);
s.syncAsSint16LE(_palVaryDirection);