diff options
author | Jamieson Christian | 2003-05-21 21:38:03 +0000 |
---|---|---|
committer | Jamieson Christian | 2003-05-21 21:38:03 +0000 |
commit | 2612a8f8170bb38e86e44b6ec67d1e064bc53dea (patch) | |
tree | ec34e89ad3e36e22f772477789e45978024fa4ee /scumm | |
parent | c394046d663ead797007fc5096bb5c6306db6e2e (diff) | |
download | scummvm-rg350-2612a8f8170bb38e86e44b6ec67d1e064bc53dea.tar.gz scummvm-rg350-2612a8f8170bb38e86e44b6ec67d1e064bc53dea.tar.bz2 scummvm-rg350-2612a8f8170bb38e86e44b6ec67d1e064bc53dea.zip |
Added ParameterFader into savegame format.
Savegames are now version 17 (VER_V17).
svn-id: r7808
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/imuse.cpp | 26 | ||||
-rw-r--r-- | scumm/saveload.h | 5 |
2 files changed, 22 insertions, 9 deletions
diff --git a/scumm/imuse.cpp b/scumm/imuse.cpp index e2e3194e6b..7166a36d3f 100644 --- a/scumm/imuse.cpp +++ b/scumm/imuse.cpp @@ -3026,6 +3026,7 @@ int IMuseInternal::save_or_load(Serializer *ser, Scumm *scumm) { MKEND() }; + // VolumeFader is obsolete. const SaveLoadEntry volumeFaderEntries[] = { MK_OBSOLETE_REF(VolumeFader, player, TYPE_PLAYER, VER_V8, VER_V16), MK_OBSOLETE(VolumeFader, active, sleUint8, VER_V8, VER_V16), @@ -3039,6 +3040,15 @@ int IMuseInternal::save_or_load(Serializer *ser, Scumm *scumm) { MKEND() }; + const SaveLoadEntry parameterFaderEntries[] = { + MKLINE(ParameterFader, param, sleInt16, VER_V17), + MKLINE(ParameterFader, start, sleInt16, VER_V17), + MKLINE(ParameterFader, end, sleInt16, VER_V17), + MKLINE(ParameterFader, total_time, sleUint32, VER_V17), + MKLINE(ParameterFader, current_time, sleUint32, VER_V17), + MKEND() + }; + const SaveLoadEntry partEntries[] = { MKREF(Part, _next, TYPE_PART, VER_V8), MKREF(Part, _prev, TYPE_PART, VER_V8), @@ -3071,16 +3081,21 @@ int IMuseInternal::save_or_load(Serializer *ser, Scumm *scumm) { #endif + int i; + ser->_ref_me = this; ser->_save_ref = saveReference; ser->_load_ref = loadReference; ser->saveLoadEntries(this, mainEntries); - ser->saveLoadArrayOf(_players, ARRAYSIZE(_players), sizeof(_players[0]), playerEntries); + for (i = 0; i < ARRAYSIZE(_players); ++i) { + ser->saveLoadEntries (&_players[i], playerEntries); + ser->saveLoadArrayOf (_players[i]._parameterFaders, ARRAYSIZE(_players[i]._parameterFaders), + sizeof(ParameterFader), parameterFaderEntries); + } ser->saveLoadArrayOf(_parts, ARRAYSIZE(_parts), sizeof(_parts[0]), partEntries); { // Load/save the instrument definitions, which were revamped with V11. - int i; Part *part = &_parts[0]; if (ser->getVersion() >= VER_V11) { for (i = ARRAYSIZE(_parts); i; --i, ++part) { @@ -3093,11 +3108,8 @@ int IMuseInternal::save_or_load(Serializer *ser, Scumm *scumm) { } // VolumeFader has been replaced with the more generic ParameterFader. - { - int i; - for (i = 0; i < 8; ++i) - ser->saveLoadEntries (0, volumeFaderEntries); - } + for (i = 0; i < 8; ++i) + ser->saveLoadEntries (0, volumeFaderEntries); if (!ser->isSaving()) { // Load all sounds that we need diff --git a/scumm/saveload.h b/scumm/saveload.h index b34571f9fb..857c313558 100644 --- a/scumm/saveload.h +++ b/scumm/saveload.h @@ -35,10 +35,11 @@ enum { VER_V13, VER_V14, VER_V15, - VER_V16 + VER_V16, + VER_V17 }; -#define CURRENT_VER VER_V16 +#define CURRENT_VER VER_V17 // To work around a warning in GCC 3.2 (and 3.1 ?) regarding non-POD types, |