wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
Loading...
Searching...
No Matches
occlusion.hpp
Go to the documentation of this file.
1#pragma once
2
7
8#include <cstdint>
9#include <vector>
10
12#include <wowlib/core/lang.hpp>
16
18 using namespace wowlib::formats::wdt::occlusion::chunks;
19
23 struct [[
24 =welder::weld,
25 =welder::weld_as("WDTOcclusion"),
27 =welder::doc(R"(
28 A _occ.wdt occlusion satellite (WoD+), abstract over the client
29 version: per-tile low-resolution heightmaps the renderer occludes
30 against. Construct a concrete version with
31 WDTOcclusion.for_version(expansion). See https://wowdev.wiki/WDT.)")
32 ]] WDTOcclusionBase {};
33
34 namespace detail {
38 canonicalizing wdt::occlusion::WDTOcclusion alias, never directly.
39 @tparam V the client version this layout targets.
40 @see https://wowdev.wiki/WDT#occ */
41 template <ClientVersion V>
42 struct [[
43 =welder::weld,
44 =welder::doc(R"(
45 A _occ.wdt occlusion satellite for one client version (WoD+):
46 per-tile occlusion heightmaps. Each MAOI index record locates one
47 tile's 545 int16 values inside the packed heights block. See
48 https://wowdev.wiki/WDT.)")
50 static constexpr ClientVersion Version = V;
51
52 [[
53 =chunk("MVER"),
54 =welder::doc("The file format version; 18 like the main WDT.")]]
55 std::uint32_t mver = WdtVersion18;
57 [[
58 =chunk("MAOI"),
59 =welder::mark::no_reassign,
60 =welder::doc(
61 R"(The tile index (MAOI): one record per tile with occlusion
62 data, locating its heightmap inside heights. Empty for
63 WMO-only maps.)")]]
64 std::vector<OcclusionIndex> indices;
65
66 [[
67 =chunk("MAOH"),
68 =welder::mark::no_reassign,
69 =welder::doc(
70 R"(The packed heightmap block (MAOH): the tiles' interleaved
71 17x17 + 16x16 int16 grids back to back, addressed by the
72 index records' offsets (same layout as the WDL MARE
73 payload). Empty for WMO-only maps.)")]]
74 std::vector<std::int16_t> heights;
75 };
76 }
77
80 template <ClientVersion V> requires(V >= builds::WoD)
82}
The chunk framework, vocabulary and engine in one header.
Client version identity, the flavor axis that separates a client's CONTENT version from the engine ge...
Binding-language identities welder's core does not name.
#define WOWLIB_CS_FAMILY_SURFACE
The C# rod's family-surface opt-in, spellable in every build.
Definition lang.hpp:44
constexpr ClientVersion WoD
Warlords of Draenor (any 6.x client).
The _occ.wdt occlusion satellite entity (WoD+).
Definition records.hpp:10
detail::WDTOcclusion< canonicalVersion(V, WdtOcclusionPivots, WdtSatelliteVersions)> WDTOcclusion
A _occ.wdt satellite — the canonicalizing face of detail::WDTOcclusion: stable since WoD,...
Definition occlusion.hpp:56
constexpr std::array WdtSatelliteVersions
The _occ/_lgt satellites exist since WoD: their era-subset grid.
constexpr std::array< ClientVersion, 0 > WdtOcclusionPivots
WDTOcclusion: stable since its WoD introduction (no pivots).
constexpr std::uint32_t WdtVersion18
The WDT format version every supported client uses (the .wdt and _occ.wdt MVER payload; _lgt/_fogs/_m...
constexpr ClientVersion canonicalVersion(ClientVersion v, std::span< const ClientVersion > pivots, std::span< const ClientVersion > grid)
The canonical version v collapses to: the FIRST grid version in v's range.
consteval detail::ChunkSpec chunk(const char(&cc)[5], FourCCEndian endian=FourCCEndian::Reversed)
Declare the chunk a member maps to.
The serialization face of a chunked entity, mixed in CRTP-style: an entity struct E : ChunkedFile<E> ...
The version-agnostic base of every WDTOcclusion<V> (welded as "WDTOcclusion"); bindings-only,...
Definition occlusion.hpp:28
A _occ.wdt occlusion satellite for one client version (WoD+): the MAOI tile index and the packed MAOH...
Definition occlusion.hpp:38
WDT version grids and per-family canonicalization pivots.
_occ.wdt chunk binary structs (namespace wowlib::formats::wdt::occlusion::chunks).