wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
Loading...
Searching...
No Matches
fogs.hpp
Go to the documentation of this file.
1#pragma once
2
8
9#include <cstdint>
10#include <vector>
11
14#include <wowlib/core/lang.hpp>
20
22 using namespace wowlib::formats::wdt::fogs::chunks;
23
27 struct [[
28 =welder::weld,
29 =welder::weld_as("WDTFogs"),
31 =welder::doc(R"(
32 A _fogs.wdt volumetric-fog satellite (Legion 7.2.5+), abstract over
33 the client version. Construct a concrete version with
34 WDTFogs.for_version(expansion). See https://wowdev.wiki/WDT.)")
35 ]] WDTFogsBase {};
36
37 namespace detail {
38 // --- version-range trait bases (unwelded) ---------------------------------
39
41 struct FogsBfa {
42 [[
43 =chunk("VFOG"),
46 =welder::mark::no_reassign,
47 =welder::doc("The volumetric fogs (VFOG, 8.0+).")]]
48 std::vector<VolumetricFog> fogs;
49 };
50
52 struct FogsTww {
53 [[
54 =chunk("VFEX"),
57 =welder::mark::no_reassign,
58 =welder::doc(
59 "The VFOG extension records (VFEX, 11.0+, format version 2), "
60 "matched to fogs by id.")]]
61 std::vector<VolumetricFogExtra> fogExtras;
62 };
63 }
64
65 namespace detail {
71 template <ClientVersion V>
72 struct [[
73 =welder::weld,
74 =welder::doc(R"(
75 A _fogs.wdt volumetric-fog satellite for one client version (Legion
76 7.2.5+): the map's placed fog volumes. Most maps ship it empty. See
77 https://wowdev.wiki/WDT.)")
78 ]] WDTFogs
83 static constexpr ClientVersion Version = V;
84
85 [[
86 =chunk("MVER"),
87 =welder::doc("The file format version: 1 since Legion 7.2.5, 2 since "
88 "11.0.0.54935 (adds VFEX).")]]
89 std::uint32_t mver = V >= builds::TWW_Alpha_54935 ? 2 : 1;
90
93 static constexpr std::array ChunkOrder = {fourcc("MVER"), fourcc("VFOG"), fourcc("VFEX"),};
94 };
95 }
96
100 template <ClientVersion V> requires(V >= builds::Legion_TombOfSargeras)
102}
The chunk framework, vocabulary and engine in one header.
Named ClientVersion constants for the exact client builds format features appeared (or vanished) at —...
Client version identity, the flavor axis that separates a client's CONTENT version from the engine ge...
FourCC chunk identifiers: compile-time conversion of the four-letter codes to the host integers chunk...
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 TWW_Alpha_54935
The War Within alpha, 11.0.0 build 54935 (_fogs.wdt version 2 and its VFEX extension records).
constexpr ClientVersion Legion_TombOfSargeras
legion, Tomb of Sargeras, 7.2.5 build 24076 (the _fogs.wdt satellite appears, initially empty).
constexpr ClientVersion BfA_Beta_25902
Battle for Azeroth beta, 8.0.1 build 25902 (the first _fogs.wdt files with VFOG content).
The _fogs.wdt volumetric-fog satellite entity (Legion 7.2.5+).
Definition records.hpp:13
detail::WDTFogs< canonicalVersion(V, WdtFogsPivots, WdtFogsVersions)> WDTFogs
A _fogs.wdt satellite — the canonicalizing face of detail::WDTFogs: three instantiations (Legion; BfA...
Definition fogs.hpp:79
constexpr std::array WdtFogsPivots
WDTFogs: the first VFOG content builds and the version-2 VFEX records.
constexpr std::array WdtFogsVersions
The _fogs satellite exists since Legion 7.2.5: its era-subset grid.
constexpr std::uint32_t fourcc(const char(&cc)[5], FourCCEndian endian=FourCCEndian::Reversed)
The host integer a scanned chunk id compares equal to for code cc.
Definition fourcc.hpp:33
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.
constexpr detail::OptionalSpec Optional
Mark a chunk member the format does not require: absence on read is fine.
consteval detail::ChunkSpec chunk(const char(&cc)[5], FourCCEndian endian=FourCCEndian::Reversed)
Declare the chunk a member maps to.
consteval detail::SinceSpec since(ClientVersion v)
Restrict a member to entity versions >= v (inclusive).
std::conditional_t<(V.formatLineage() >=Since &&V.formatLineage()< Until), Trait, Absent< Trait > > Slot
A version-gated base: the entity inherits Trait (flattening its chunk members in) iff Since <= V < Un...
The serialization face of a chunked entity, mixed in CRTP-style: an entity struct E : ChunkedFile<E> ...
The version-agnostic base of every WDTFogs<V> (welded as "WDTFogs"); bindings-only,...
Definition fogs.hpp:31
The fog volumes, first shipped with content in 8.0.1.25902.
Definition fogs.hpp:37
std::vector< VolumetricFog > fogs
The volumetric fogs (VFOG, 8.0+).
Definition fogs.hpp:40
The version-2 extension records (11.0+).
Definition fogs.hpp:44
std::vector< VolumetricFogExtra > fogExtras
The VFOG extension records (VFEX, 11.0+, format version 2), matched to fogs by id.
Definition fogs.hpp:47
A _fogs.wdt volumetric-fog satellite for one client version (Legion 7.2.5+).
Definition fogs.hpp:62
The conditional-base mechanism that gives a versioned chunked entity exactly the fields its client ve...
WDT version grids and per-family canonicalization pivots.
_fogs.wdt chunk binary structs (namespace wowlib::formats::wdt::fogs::chunks).