| 151 | MAP2ChunkHandler() : ChunkHandler('MAP2', CH_RIFF) {} |
| 152 | |
| 153 | void Load() const override |
| 154 | { |
| 155 | std::array<uint16_t, MAP_SL_BUF_SIZE> buf; |
| 156 | uint size = Map::Size(); |
| 157 | |
| 158 | for (TileIndex i{}; i != size;) { |
| 159 | SlCopy(buf.data(), MAP_SL_BUF_SIZE, |
| 160 | /* In those versions the m2 was 8 bits */ |
| 161 | IsSavegameVersionBefore(SLV_5) ? SLE_FILE_U8 | SLE_VAR_U16 : SLE_UINT16 |
| 162 | ); |
| 163 | for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) Tile(i++).m2() = buf[j]; |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | void Save() const override |
| 168 | { |
nothing calls this directly
no test coverage detected