Save/restore the visibility of the meshes in the costumes. Bumped savegame version to 6.

This commit is contained in:
Giulio Camuffo 2011-03-28 13:36:07 +02:00
parent 8c66b2e7a6
commit 5d8fa44dcf
2 changed files with 5 additions and 1 deletions

View File

@ -1250,6 +1250,8 @@ void Costume::saveState(SaveGame *state) const {
state->writeLESint32(f->_active);
state->writeLESint32(f->_repeatMode);
state->writeLESint32(f->_currTime);
} else if (FROM_BE_32(c->_tag) == MKID_BE('MESH')) {
state->writeLESint32(static_cast<MeshComponent *>(c)->node()->_meshVisible);
}
}
}
@ -1291,6 +1293,8 @@ bool Costume::restoreState(SaveGame *state) {
f->_active = state->readLESint32();
f->_repeatMode = state->readLESint32();
f->_currTime = state->readLESint32();
} else if (FROM_BE_32(c->_tag) == MKID_BE('MESH')) {
static_cast<MeshComponent *>(c)->node()->_meshVisible = state->readLESint32();
}
}
}

View File

@ -35,7 +35,7 @@ namespace Grim {
#define SAVEGAME_HEADERTAG 'RSAV'
#define SAVEGAME_FOOTERTAG 'ESAV'
#define SAVEGAME_VERSION 5
#define SAVEGAME_VERSION 6
// Constructor. Should create/open a saved game
SaveGame::SaveGame(const char *filename, bool saving) :