wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
Loading...
Searching...
No Matches
tiles.hpp
Go to the documentation of this file.
1#pragma once
2
7
8#include <array>
9#include <cstdint>
10
11#include <welder/vocabulary.hpp>
12
14 struct [[
15 =welder::weld,
16 =welder::doc(R"(
17 One tile's low-resolution heightmap (a MARE payload): a 17x17 grid of
18 int16 heights with a 16x16 grid of midpoints, on the same scale as the
19 full-resolution ADT heights. The background mountain silhouettes are
20 drawn from these.)")
21 ]] TileHeights {
22 [[=welder::doc("The 17 x 17 outer grid heights, row-major.")]]
23 std::array<std::int16_t, 17 * 17> outer{};
25 [[=welder::doc("The 16 x 16 inner (midpoint) heights, row-major.")]]
26 std::array<std::int16_t, 16 * 16> inner{};
27 };
28
29 static_assert(sizeof(TileHeights) == 1090);
30
31 struct [[
32 =welder::weld,
33 =welder::doc(R"(
34 One tile's hole mask (a MAHO payload, TBC+): 16 row bitmasks, one
35 per chunk row (y), one bit per chunk column (x) — a set bit is a hole.
36 Blizzard sets a bit when all 16 holes of the ADT chunk are set; an
37 all-zero mask is always written anyway.)")
38 ]] TileHoles {
39 [[=welder::doc("The 16 row bitmasks (y rows, x bits); a set bit is a hole.")
40 ]]
41 std::array<std::uint16_t, 16> rows{};
42 };
43
44 static_assert(sizeof(TileHoles) == 32);
45
46 struct [[
47 =welder::weld,
48 =welder::doc(R"(
49 One tile's ocean mask (a MAOE payload, Legion+): a 32-byte mask
50 selecting the ocean alpha texture — 0xFF bytes mean water everywhere,
51 0x00 none. Emitted before the tile's hole mask.)")
52 ]] TileOcean {
53 [[=welder::doc("The mask bytes; 0xFF is water everywhere, 0x00 none.")]]
54 std::array<std::uint8_t, 32> mask{};
55 };
56
57 static_assert(sizeof(TileOcean) == 32);
58}
WDL chunk binary structs (per-tile heightmaps, hole and ocean masks, low-resolution placements,...
Definition objects.hpp:17
std::array< std::int16_t, 16 *16 > inner
The 16 x 16 inner (midpoint) heights, row-major.
Definition tiles.hpp:19
std::array< std::int16_t, 17 *17 > outer
The 17 x 17 outer grid heights, row-major.
Definition tiles.hpp:16
std::array< std::uint16_t, 16 > rows
The 16 row bitmasks (y rows, x bits); a set bit is a hole.
Definition tiles.hpp:26
std::array< std::uint8_t, 32 > mask
The mask bytes; 0xFF is water everywhere, 0x00 none.
Definition tiles.hpp:33