MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / Load

Method Load

src/saveload/map_sl.cpp:153–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 4

SlCopyFunction · 0.85
IsSavegameVersionBeforeFunction · 0.85
TileClass · 0.85
dataMethod · 0.45

Tested by

no test coverage detected