10 #include "../stdafx.h"
15 #include "../map_func.h"
16 #include "../core/bitmath_func.hpp"
19 #include "../safeguards.h"
21 static uint32_t _map_dim_x;
22 static uint32_t _map_dim_y;
24 static const SaveLoad _map_desc[] = {
67 static const uint MAP_SL_BUF_SIZE = 4096;
74 std::array<uint8_t, MAP_SL_BUF_SIZE> buf;
78 SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT8);
79 for (uint j = 0; j != MAP_SL_BUF_SIZE; j++)
Tile(i++).
type() = buf[j];
85 std::array<uint8_t, MAP_SL_BUF_SIZE> buf;
90 for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) buf[j] =
Tile(i++).
type();
91 SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT8);
101 std::array<uint8_t, MAP_SL_BUF_SIZE> buf;
105 SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT8);
106 for (uint j = 0; j != MAP_SL_BUF_SIZE; j++)
Tile(i++).
height() = buf[j];
112 std::array<uint8_t, MAP_SL_BUF_SIZE> buf;
117 for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) buf[j] =
Tile(i++).
height();
118 SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT8);
128 std::array<uint8_t, MAP_SL_BUF_SIZE> buf;
132 SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT8);
133 for (uint j = 0; j != MAP_SL_BUF_SIZE; j++)
Tile(i++).
m1() = buf[j];
139 std::array<uint8_t, MAP_SL_BUF_SIZE> buf;
144 for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) buf[j] =
Tile(i++).
m1();
145 SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT8);
155 std::array<uint16_t, MAP_SL_BUF_SIZE> buf;
159 SlCopy(buf.data(), MAP_SL_BUF_SIZE,
163 for (uint j = 0; j != MAP_SL_BUF_SIZE; j++)
Tile(i++).
m2() = buf[j];
169 std::array<uint16_t, MAP_SL_BUF_SIZE> buf;
172 SlSetLength(
static_cast<uint32_t
>(size) *
sizeof(uint16_t));
174 for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) buf[j] =
Tile(i++).
m2();
175 SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT16);
185 std::array<uint8_t, MAP_SL_BUF_SIZE> buf;
189 SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT8);
190 for (uint j = 0; j != MAP_SL_BUF_SIZE; j++)
Tile(i++).
m3() = buf[j];
196 std::array<uint8_t, MAP_SL_BUF_SIZE> buf;
201 for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) buf[j] =
Tile(i++).
m3();
202 SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT8);
212 std::array<uint8_t, MAP_SL_BUF_SIZE> buf;
216 SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT8);
217 for (uint j = 0; j != MAP_SL_BUF_SIZE; j++)
Tile(i++).
m4() = buf[j];
223 std::array<uint8_t, MAP_SL_BUF_SIZE> buf;
228 for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) buf[j] =
Tile(i++).
m4();
229 SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT8);
239 std::array<uint8_t, MAP_SL_BUF_SIZE> buf;
243 SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT8);
244 for (uint j = 0; j != MAP_SL_BUF_SIZE; j++)
Tile(i++).
m5() = buf[j];
250 std::array<uint8_t, MAP_SL_BUF_SIZE> buf;
255 for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) buf[j] =
Tile(i++).
m5();
256 SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT8);
266 std::array<uint8_t, MAP_SL_BUF_SIZE> buf;
272 SlCopy(buf.data(), 1024, SLE_UINT8);
273 for (uint j = 0; j != 1024; j++) {
282 SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT8);
283 for (uint j = 0; j != MAP_SL_BUF_SIZE; j++)
Tile(i++).
m6() = buf[j];
290 std::array<uint8_t, MAP_SL_BUF_SIZE> buf;
295 for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) buf[j] =
Tile(i++).
m6();
296 SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT8);
306 std::array<uint8_t, MAP_SL_BUF_SIZE> buf;
310 SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT8);
311 for (uint j = 0; j != MAP_SL_BUF_SIZE; j++)
Tile(i++).
m7() = buf[j];
317 std::array<uint8_t, MAP_SL_BUF_SIZE> buf;
322 for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) buf[j] =
Tile(i++).
m7();
323 SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT8);
333 std::array<uint16_t, MAP_SL_BUF_SIZE> buf;
337 SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT16);
338 for (uint j = 0; j != MAP_SL_BUF_SIZE; j++)
Tile(i++).
m8() = buf[j];
344 std::array<uint16_t, MAP_SL_BUF_SIZE> buf;
347 SlSetLength(
static_cast<uint32_t
>(size) *
sizeof(uint16_t));
349 for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) buf[j] =
Tile(i++).
m8();
350 SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT16);