| 1522 | |
| 1523 | |
| 1524 | static 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 | |
| 1553 | static bool LoadOldMapPart2(LoadgameState &ls, int) |
| 1554 | { |