diff options
author | Travis Howell | 2006-02-04 08:40:36 +0000 |
---|---|---|
committer | Travis Howell | 2006-02-04 08:40:36 +0000 |
commit | cd24d93f7b5e2235134ede0854d3a95339c54578 (patch) | |
tree | da75e6d41b5cd3e3918f12ce45fda19b9442e7a4 | |
parent | 529f2602618e36ce3f578ca356f7a7c97d24d5ac (diff) | |
download | scummvm-rg350-cd24d93f7b5e2235134ede0854d3a95339c54578.tar.gz scummvm-rg350-cd24d93f7b5e2235134ede0854d3a95339c54578.tar.bz2 scummvm-rg350-cd24d93f7b5e2235134ede0854d3a95339c54578.zip |
Save complete tables, was off by one.
svn-id: r20368
-rw-r--r-- | scumm/saveload.h | 2 | ||||
-rw-r--r-- | scumm/sprite_he.cpp | 12 |
2 files changed, 10 insertions, 4 deletions
diff --git a/scumm/saveload.h b/scumm/saveload.h index ce6639e372..379024a0a5 100644 --- a/scumm/saveload.h +++ b/scumm/saveload.h @@ -45,7 +45,7 @@ namespace Scumm { * only saves/loads those which are valid for the version of the savegame * which is being loaded/saved currently. */ -#define CURRENT_VER 63 +#define CURRENT_VER 64 /** * An auxillary macro, used to specify savegame versions. We use this instead diff --git a/scumm/sprite_he.cpp b/scumm/sprite_he.cpp index 9b1185f6f4..cdcf144ebc 100644 --- a/scumm/sprite_he.cpp +++ b/scumm/sprite_he.cpp @@ -1421,9 +1421,15 @@ void Sprite::saveOrLoadSpriteData(Serializer *s) { MKEND() }; - s->saveLoadArrayOf(_activeSpritesTable, _varNumSprites, sizeof(_activeSpritesTable[0]), spriteEntries); - s->saveLoadArrayOf(_spriteTable, _varNumSprites, sizeof(_spriteTable[0]), spriteEntries); - s->saveLoadArrayOf(_spriteGroups, _varNumSpriteGroups, sizeof(_spriteGroups[0]), spriteGroupEntries); + if (s->getVersion() >= VER(64)) { + s->saveLoadArrayOf(_activeSpritesTable, _varNumSprites + 1, sizeof(_activeSpritesTable[0]), spriteEntries); + s->saveLoadArrayOf(_spriteTable, _varNumSprites + 1, sizeof(_spriteTable[0]), spriteEntries); + s->saveLoadArrayOf(_spriteGroups, _varNumSpriteGroups + 1, sizeof(_spriteGroups[0]), spriteGroupEntries); + } else { + s->saveLoadArrayOf(_activeSpritesTable, _varNumSprites, sizeof(_activeSpritesTable[0]), spriteEntries); + s->saveLoadArrayOf(_spriteTable, _varNumSprites, sizeof(_spriteTable[0]), spriteEntries); + s->saveLoadArrayOf(_spriteGroups, _varNumSpriteGroups, sizeof(_spriteGroups[0]), spriteGroupEntries); + } } } // End of namespace Scumm |