Code: Select all
/** Checks if the savegame is between these versions (for ChrisIN savegame compatibility checks).
*/
static inline bool CheckChrisInVersion(uint16 from, uint16 to)
{
extern uint16 _sl_version;
if (_sl_version > from && _sl_version < to) return true;
return false;
}
Code: Select all
/* Before version 80 we did NOT have a variable length animated tile table */
if (CheckChrisInVersion(0,80)) { ///< this was CheckSavegameVersion(80) originally
/* In pre version 6, we has 16bit per tile, now we have 32bit per tile, convert it ;) */
SlArray(_animated_tile_list, 256, CheckSavegameVersion(6) ? (SLE_FILE_U16 | SLE_VAR_U32) : SLE_UINT32);
for (_animated_tile_count = 0; _animated_tile_count < 256; _animated_tile_count++) {
if (_animated_tile_list[_animated_tile_count] == 0) break;
}
return;
}
/* This is duplicate code from above for ChrisIN until Trunk reaches savegame version 85 */
if (CheckChrisInVersion(80,85)) {
/* In pre version 6, we has 16bit per tile, now we have 32bit per tile, convert it ;) */
SlArray(_animated_tile_list, 256, CheckSavegameVersion(6) ? (SLE_FILE_U16 | SLE_VAR_U32) : SLE_UINT32);
for (_animated_tile_count = 0; _animated_tile_count < 256; _animated_tile_count++) {
if (_animated_tile_list[_animated_tile_count] == 0) break;
}
return;
}
