| 34 | } |
| 35 | |
| 36 | void Load() const override |
| 37 | { |
| 38 | /* Before version 80 we did NOT have a variable length animated tile table */ |
| 39 | if (IsSavegameVersionBefore(SLV_80)) { |
| 40 | /* In pre version 6, we has 16bit per tile, now we have 32bit per tile, convert it ;) */ |
| 41 | TileIndex anim_list[256]; |
| 42 | SlCopy(anim_list, 256, IsSavegameVersionBefore(SLV_6) ? (SLE_FILE_U16 | SLE_VAR_U32) : SLE_UINT32); |
| 43 | |
| 44 | for (int i = 0; i < 256; i++) { |
| 45 | if (anim_list[i] == 0) break; |
| 46 | _animated_tiles.push_back(anim_list[i]); |
| 47 | } |
| 48 | return; |
| 49 | } |
| 50 | |
| 51 | if (IsSavegameVersionBefore(SLV_RIFF_TO_ARRAY)) { |
| 52 | size_t count = SlGetFieldLength() / sizeof(_animated_tiles.front()); |
| 53 | _animated_tiles.clear(); |
| 54 | _animated_tiles.resize(_animated_tiles.size() + count); |
| 55 | SlCopy(_animated_tiles.data(), count, SLE_UINT32); |
| 56 | return; |
| 57 | } |
| 58 | |
| 59 | const std::vector<SaveLoad> slt = SlCompatTableHeader(_animated_tile_desc, _animated_tile_sl_compat); |
| 60 | |
| 61 | if (SlIterateArray() == -1) return; |
| 62 | SlGlobList(slt); |
| 63 | if (SlIterateArray() != -1) SlErrorCorrupt("Too many ANIT entries"); |
| 64 | } |
| 65 | }; |
| 66 | |
| 67 |
nothing calls this directly
no test coverage detected