wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
Loading...
Searching...
No Matches
mpv.hpp
Go to the documentation of this file.
1#pragma once
2
9
10#include <cstdint>
11#include <vector>
12
15#include <wowlib/core/lang.hpp>
20
22 using namespace wowlib::formats::wdt::mpv::chunks;
23
27 struct [[
28 =welder::weld,
29 =welder::weld_as("WDTParticulates"),
31 =welder::doc(R"(
32 A _mpv.wdt particulate-volume satellite (BfA 8.0.1+), abstract over
33 the client version: weather particulate volumes in repeated
34 PVMI/PVPD/PVBD groups. Construct a concrete version with
35 WDTParticulates.for_version(expansion). See https://wowdev.wiki/WDT.)")
37
38 namespace detail {
44 alias, never directly.
45 @tparam V the client version this layout targets.
46 @see https://wowdev.wiki/WDT#mpv */
47 template <ClientVersion V>
48 struct [[
49 =welder::weld,
50 =welder::doc(R"(
51 A _mpv.wdt particulate-volume satellite for one client version (BfA
52 8.0.1+): weather particulate volumes as repeated PVMI/PVPD/PVBD
53 groups — the i-th elements of the three lists belong together. Most
54 maps ship it empty. See https://wowdev.wiki/WDT.)")
57 static constexpr ClientVersion Version = V;
58
59 [[
60 =chunk("MVER"),
61 =welder::doc(
62 "The _mpv format version, 1 to 4; the PVMI record size is keyed "
63 "on it (0xF5C / 0xFE8 / 0x10D8).")]]
64 std::uint32_t mver = 4;
65
66 [[
67 =chunk("PVMI"),
70 =welder::doc(
71 R"(One PVMI payload per volume group. The record layout is keyed
72 on the file's own version payload, not the client build, so
73 it is kept opaque.)")]]
74 std::vector<ChunkBlob> volumeData;
75
76 [[
77 =chunk("PVPD"),
80 =welder::mark::no_reassign,
81 =welder::doc("One PVPD point array per volume group.")]]
82 std::vector<std::vector<ParticulatePoint>> pointGroups;
83
84 [[
85 =chunk("PVBD"),
88 =welder::mark::no_reassign,
89 =welder::doc("One PVBD bounds array per volume group; reading a PVBD "
90 "finalizes the group.")]]
91 std::vector<std::vector<ParticulateBounds>> boundGroups;
92
98 static constexpr std::array ChunkOrder = {fourcc("MVER"), fourcc("PVMI"), fourcc("PVPD"), fourcc("PVBD"),};
99 };
100 }
101
106 template <ClientVersion V> requires(V >= builds::BfA_Beta_26287)
108}
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 BfA_Beta_26287
Battle for Azeroth beta, 8.0.1 build 26287 (the client starts loading the _mpv.wdt particulate-volume...
The _mpv.wdt particulate-volume satellite entity (BfA+).
Definition records.hpp:13
detail::WDTParticulates< canonicalVersion(V, WdtMpvPivots, WdtMpvVersions)> WDTParticulates
A _mpv.wdt satellite — the canonicalizing face of detail::WDTParticulates: stable since BfA (its reco...
Definition mpv.hpp:77
constexpr std::array< ClientVersion, 0 > WdtMpvPivots
WDTParticulates: stable since its BfA introduction — the PVMI record size is keyed on the file's OWN ...
constexpr std::array WdtMpvVersions
The _mpv satellite exists since BfA 8.0.1: 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::RepeatingSpec Repeating
Mark a chunk that appears once PER ELEMENT of a std::vector<Element> member, any number of times: eac...
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.
The serialization face of a chunked entity, mixed in CRTP-style: an entity struct E : ChunkedFile<E> ...
The version-agnostic base of every WDTParticulates<V> (welded as "WDTParticulates"); bindings-only,...
Definition mpv.hpp:32
A _mpv.wdt particulate-volume satellite for one client version (BfA 8.0.1+).
Definition mpv.hpp:45
WDT version grids and per-family canonicalization pivots.
_mpv.wdt chunk binary structs (namespace wowlib::formats::wdt::mpv::chunks).