diff --git a/engines/grim/costume.cpp b/engines/grim/costume.cpp index e69242bd7ab..f50838fbbf4 100644 --- a/engines/grim/costume.cpp +++ b/engines/grim/costume.cpp @@ -417,6 +417,8 @@ private: int _repeatMode; int _currTime; Common::String _fname; + + friend class Costume; }; KeyframeComponent::KeyframeComponent(Costume::Component *p, int parentID, const char *filename, tag32 t) : @@ -1211,6 +1213,13 @@ void Costume::saveState(SaveGame *state) const { if (c) { state->writeLESint32(c->_visible); state->writeVector3d(c->_matrix._pos); + + if (FROM_BE_32(c->_tag) == MKID_BE('KEYF')) { + KeyframeComponent *f = static_cast(c); + state->writeLESint32(f->_active); + state->writeLESint32(f->_repeatMode); + state->writeLESint32(f->_currTime); + } } } @@ -1246,6 +1255,11 @@ bool Costume::restoreState(SaveGame *state) { if (FROM_BE_32(c->_tag) == MKID_BE('MODL') || FROM_BE_32(c->_tag) == MKID_BE('MMDL')) { ModelComponent *m = static_cast(c); m->hierarchy()->_hierVisible = c->_visible; + } else if (FROM_BE_32(c->_tag) == MKID_BE('KEYF')) { + KeyframeComponent *f = static_cast(c); + f->_active = state->readLESint32(); + f->_repeatMode = state->readLESint32(); + f->_currTime = state->readLESint32(); } } } diff --git a/engines/grim/savegame.cpp b/engines/grim/savegame.cpp index 3f9f9f4057e..17039812144 100644 --- a/engines/grim/savegame.cpp +++ b/engines/grim/savegame.cpp @@ -35,7 +35,7 @@ namespace Grim { #define SAVEGAME_HEADERTAG 'RSAV' #define SAVEGAME_FOOTERTAG 'ESAV' -#define SAVEGAME_VERSION 3 +#define SAVEGAME_VERSION 4 // Constructor. Should create/open a saved game SaveGame::SaveGame(const char *filename, bool saving) :