wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
Loading...
Searching...
No Matches
boundaries.hpp
Go to the documentation of this file.
1#pragma once
2
9
10#include <array>
11#include <cstdint>
12#include <utility>
13
17
18namespace wowlib::formats::m2 {
25
33
39
43
48
54
61 consteval std::uint32_t m2FormatVersion(ClientVersion v) {
62 if (v >= M2ChunkedContainer) return 274;
63 if (v >= M2MultitexParticles) return 272;
64 if (v >= M2PerSequenceTimelines) return 264;
65 if (v >= M2CompressedBones) return 263;
66 return 256;
67 }
68
74 consteval std::pair<std::uint32_t, std::uint32_t> m2FormatVersionRange(ClientVersion v) {
75 if (v >= M2ChunkedContainer) return {264, 274};
76 if (v >= M2MultitexParticles) return {265, 273};
77 if (v >= M2PerSequenceTimelines) return {264, 264};
78 if (v >= M2CompressedBones) return {258, 263};
79 return {256, 257};
80 }
81
82 // --- version grids and per-family canonicalization pivots -----------------
83 //
84 // Every versioned M2 family instantiates only for its REAL content
85 // permutations: the public name is a canonicalizing alias over the nested
86 // detail:: template (see formats/common/version_range.hpp), flooring the
87 // requested version over the family's pivots below. A pivot that does not
88 // separate two grid versions is a harmless no-op, so the lists are
89 // generous — they name every documented change, not just the ones the
90 // current grid straddles. The welded range tables in m2.hpp are
91 // consteval-checked against these lists (rangesValid), so neither side
92 // can drift.
93
109
122
131
136 inline constexpr std::array M2TrackPivots{M2PerSequenceTimelines};
137
140
144
147
151
153 inline constexpr std::array M2SkinSectionPivots{M2CompressedBones};
154
157
161
172
176 inline constexpr std::array M2FilePivots{
179 // EXP2/PABC/PADC/PSBC/PEDC/SKID
181 // TXID/LDV1
183 // RPID/GPID
185 // WFV1/WFV2/PGD1
187 // PFDC (9.0.1-alpha chunk backported)
189 // WFV3/EDGF/NERF/DBOC
191 // DETL
193 // AFRA
195 }; // PCOL/DPIV
196
199 inline constexpr std::array<ClientVersion, 0> M2ChunkPayloadPivots{};
200
220}
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...
constexpr ClientVersion Legion_ShadowsOfArgus_24500
legion, Shadows of Argus PTR, 7.3.0 build 24500 (the .m2 parent-model and .skel satellite chunks).
constexpr ClientVersion BfA_RiseOfAzshara
BfA, Rise of Azshara, 8.2.0 build 30080 (WFV1/WFV2/PGD1).
constexpr ClientVersion DF
dragonflight (any 10.x client).
constexpr ClientVersion TWW_LegacyOfArathor
TWW, Legacy of Arathor, 11.1.7 build 60520 (PCOL/DPIV).
constexpr ClientVersion SL_Alpha_34365
shadowlands alpha, 9.0.1 build 34365 (DETL).
constexpr ClientVersion BfA_VisionsOfNzoth_35662
BfA, Visions of N'Zoth, 8.3.7 build 35662 (M2 PFDC inline physics — wowdev dates the chunk to the 9....
constexpr ClientVersion Legion_Alpha
legion alpha, 7.0.1 build 20740 — the first chunked-format build (the .m2 MD21 container,...
constexpr ClientVersion Cata
Cataclysm (any 4.x client).
constexpr ClientVersion SL_Alpha_33978
shadowlands alpha, 9.0.1 build 33978 (WFV3/EDGF/NERF/DBOC; PFDC is dated here by wowdev but reached l...
constexpr ClientVersion BfA_TidesOfVengeance
BfA, Tides of Vengeance PTR, 8.1.0 build 27826 (RPID/GPID, WMO MOSI/MODI).
constexpr ClientVersion BfA
Battle for Azeroth (any 8.x client).
constexpr ClientVersion BfA_Beta
Battle for Azeroth beta, 8.0.1 build 26629 (TXID/LDV1).
constexpr ClientVersion WoD
Warlords of Draenor (any 6.x client).
constexpr ClientVersion TBC
The Burning Crusade (any 2.x client).
constexpr ClientVersion WotLK
Wrath of the Lich King (any 3.x client).
consteval std::uint32_t m2FormatVersion(ClientVersion v)
The MD20 formatVersion wowlib writes for v — the value the client era itself exports (wowdev....
consteval std::pair< std::uint32_t, std::uint32_t > m2FormatVersionRange(ClientVersion v)
The inclusive MD20 version range a client era's files may carry — reading accepts the whole era (a 2....
constexpr ClientVersion M2ChunkedContainer
legion (7.0.1.20740): the on-disk .m2 becomes a chunked file — the MD20 image moves into the MD21 chu...
constexpr std::array M2TrackPivots
Track-shaped records (M2Track, M2TrackBase, and every record whose only version axis is the tracks it...
constexpr ClientVersion M2SplitBlendTimes
WoD (6.0.1): M2Sequence's u32 blendTime splits into the blendTimeIn/blendTimeOut pair.
constexpr std::array M2SequencePivots
M2Sequence: timestamps→duration at WotLK, blend-time split at WoD.
constexpr ClientVersion M2PerSequenceTimelines
WotLK (v264): every M2Track nests one timestamp/value array per sequence (the vanilla single timeline...
constexpr std::array M2CameraPivots
M2Camera: per-sequence tracks at WotLK, static FoV→spline at Cata.
constexpr ClientVersion M2MultitexParticles
cata (v272): particles turn multi-textured (492-byte record: texture id bitfield, multiTexScale repla...
constexpr ClientVersion M2ChunkedOnly
BfA (8.0.1): the chunked container is universal — Legion clients still served leftover raw MD20 model...
constexpr std::array M2FilePivots
M2ChunkedFile (the chunked stream): every chunk-introduction build — each documented since() value,...
constexpr std::array M2DataPivots
M2Root (the MD20 body): the union of every record pivot, its own trait slots (TBC combos,...
constexpr std::array M2BonePivots
M2CompBone: raw→compressed quaternions + name CRC at TBC, per-sequence track timelines at WotLK.
constexpr std::array M2SkinVersions
The era subset .skin files exist for (WotLK+).
constexpr std::array M2SkinProfilePivots
M2SkinProfile: the section layout at TBC, shadow batches at Cata.
constexpr std::array M2ParticlePivots
M2Particle: byte-packed blending/emitter types at TBC, FBlock ramps and spins at WotLK,...
constexpr std::array M2SkinPivots
The Skin entity (.skin files, WotLK+): its existence boundary plus the profile's Cata shadow batches.
constexpr std::array M2ChunkedVersions
The era subset the chunked container exists for (Legion+).
constexpr std::array M2SkinSectionPivots
M2SkinSection: the sort center/radius tail at TBC.
constexpr std::array M2AssemblyPivots
The M2 assembly: the union of the body, skin and stream pivots plus the bare-MD20 read gate (M2Chunke...
constexpr ClientVersion M2CompressedBones
TBC (v260+): bone rotations become compressed M2CompQuat (vanilla stored raw C4Quaternion),...
constexpr std::array< ClientVersion, 0 > M2ChunkPayloadPivots
Skeleton and its chunk payloads plus the shell payload records: stable across the whole chunked era —...
constexpr std::array M2Versions
The versions M2 is instantiated (and welded) for: every targeted last-minor-of-major release,...
constexpr ClientVersion Shadowlands
constexpr ClientVersion Tww
constexpr ClientVersion Bfa
constexpr ClientVersion Mop
constexpr ClientVersion Wod
constexpr ClientVersion Tbc
constexpr ClientVersion Vanilla
constexpr ClientVersion Legion
constexpr ClientVersion Dragonflight
constexpr ClientVersion Cata
constexpr ClientVersion Wotlk
Version-range canonicalization: the machinery behind collapsing a versioned family's instantiations t...