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

Function LoadOldMapPart1

src/saveload/oldloader_sl.cpp:1524–1551  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1522
1523
1524static bool LoadOldMapPart1(LoadgameState &ls, int)
1525{
1526 if (_savegame_type == SGT_TTO) {
1527 Map::Allocate(OLD_MAP_SIZE, OLD_MAP_SIZE);
1528 }
1529
1530 for (auto t : Map::Iterate()) {
1531 t.m1() = ReadByte(ls);
1532 }
1533 for (auto t : Map::Iterate()) {
1534 t.m2() = ReadByte(ls);
1535 }
1536
1537 if (_savegame_type != SGT_TTO) {
1538 /* old map3 is split into to m3 and m4 */
1539 for (auto t : Map::Iterate()) {
1540 t.m3() = ReadByte(ls);
1541 t.m4() = ReadByte(ls);
1542 }
1543 auto range = Map::Iterate();
1544 for (auto it = range.begin(); it != range.end(); /* nothing. */) {
1545 uint8_t b = ReadByte(ls);
1546 for (int i = 0; i < 8; i += 2, ++it) (*it).m6() = GB(b, i, 2);
1547 }
1548 }
1549
1550 return true;
1551}
1552
1553static bool LoadOldMapPart2(LoadgameState &ls, int)
1554{

Callers

nothing calls this directly

Calls 4

ReadByteFunction · 0.85
GBFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected