|
wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
|
The M2 version vocabulary: the layout pivots record/entity partial specializations key on, and the MD20 formatVersion written for each targeted client. More...
#include <array>#include <cstdint>#include <utility>#include <wowlib/core/client_builds.hpp>#include <wowlib/core/client_version.hpp>#include <wowlib/formats/common/version_range.hpp>Go to the source code of this file.
Namespaces | |
| namespace | wowlib |
| namespace | wowlib::formats |
| namespace | wowlib::formats::m2 |
Functions | |
| consteval std::uint32_t | wowlib::formats::m2::m2FormatVersion (ClientVersion v) |
| The MD20 formatVersion wowlib writes for v — the value the client era itself exports (wowdev.wiki/M2, the Versions section): vanilla 256, TBC 263, WotLK 264, Cata through WoD 272, Legion+ 274. | |
| consteval std::pair< std::uint32_t, std::uint32_t > | wowlib::formats::m2::m2FormatVersionRange (ClientVersion v) |
| The inclusive MD20 version range a client era's files may carry — reading accepts the whole era (a 2.4.3 client still ships v260 models), writing always emits m2FormatVersion(). | |
Variables | |
| constexpr ClientVersion | wowlib::formats::m2::M2CompressedBones = builds::TBC |
| TBC (v260+): bone rotations become compressed M2CompQuat (vanilla stored raw C4Quaternion), M2CompBone gains the boneNameCRC field, and the particle header packs blendingType/emitterType into bytes next to the new particleColorIndex (late-TBC v262 in the format; TBC's last minor 2.4.3 writes v263, so the whole tbc target is past it). | |
| constexpr ClientVersion | wowlib::formats::m2::M2PerSequenceTimelines = builds::WotLK |
| WotLK (v264): every M2Track nests one timestamp/value array per sequence (the vanilla single timeline with interpolation ranges is gone), M2Sequence stores a duration instead of global start/end timestamps, skin profiles move out to .skin files and low-priority sequences to .anim files, particles gain the FBlock color/scale tracks and the four spin fields, ribbons their priority-plane tail. | |
| constexpr ClientVersion | wowlib::formats::m2::M2MultitexParticles = builds::Cata |
| cata (v272): particles turn multi-textured (492-byte record: texture id bitfield, multiTexScale replacing particleType/headOrTail, the multiTexScroll tail) and cameras trade the static diagonal FOV for a spline track. | |
| constexpr ClientVersion | wowlib::formats::m2::M2SplitBlendTimes = builds::WoD |
| WoD (6.0.1): M2Sequence's u32 blendTime splits into the blendTimeIn/blendTimeOut pair. | |
| constexpr ClientVersion | wowlib::formats::m2::M2ChunkedContainer = builds::Legion_Alpha |
| legion (7.0.1.20740): the on-disk .m2 becomes a chunked file — the MD20 image moves into the MD21 chunk (offsets stay relative to the image) joined by the companion chunks (PFID/SFID/AFID/…, forward fourccs). | |
| constexpr ClientVersion | wowlib::formats::m2::M2ChunkedOnly = builds::BfA |
| BfA (8.0.1): the chunked container is universal — Legion clients still served leftover raw MD20 models, but from 8.0 on none exist, so BfA+ reads treat a bare MD20 magic as a version mismatch instead of falling back to the monolithic path. | |
| constexpr std::array | wowlib::formats::m2::M2Versions |
| The versions M2 is instantiated (and welded) for: every targeted last-minor-of-major release, in release order. | |
| constexpr std::array | wowlib::formats::m2::M2SkinVersions |
| The era subset .skin files exist for (WotLK+). | |
| constexpr std::array | wowlib::formats::m2::M2ChunkedVersions |
| The era subset the chunked container exists for (Legion+). | |
| constexpr std::array | wowlib::formats::m2::M2TrackPivots {M2PerSequenceTimelines} |
| Track-shaped records (M2Track, M2TrackBase, and every record whose only version axis is the tracks it embeds: colors, weights, transforms, flipbooks, attachments, events, lights, ribbons — the ribbon's WotLK trailing fields share the same pivot). | |
| constexpr std::array | wowlib::formats::m2::M2SequencePivots {M2PerSequenceTimelines, M2SplitBlendTimes} |
| M2Sequence: timestamps→duration at WotLK, blend-time split at WoD. | |
| constexpr std::array | wowlib::formats::m2::M2BonePivots {M2CompressedBones, M2PerSequenceTimelines} |
| M2CompBone: raw→compressed quaternions + name CRC at TBC, per-sequence track timelines at WotLK. | |
| constexpr std::array | wowlib::formats::m2::M2CameraPivots {M2PerSequenceTimelines, M2MultitexParticles} |
| M2Camera: per-sequence tracks at WotLK, static FoV→spline at Cata. | |
| constexpr std::array | wowlib::formats::m2::M2ParticlePivots {M2CompressedBones, M2PerSequenceTimelines, M2MultitexParticles} |
| M2Particle: byte-packed blending/emitter types at TBC, FBlock ramps and spins at WotLK, the multi-texture 492-byte layout at Cata. | |
| constexpr std::array | wowlib::formats::m2::M2SkinSectionPivots {M2CompressedBones} |
| M2SkinSection: the sort center/radius tail at TBC. | |
| constexpr std::array | wowlib::formats::m2::M2SkinProfilePivots {M2CompressedBones, M2MultitexParticles} |
| M2SkinProfile: the section layout at TBC, shadow batches at Cata. | |
| constexpr std::array | wowlib::formats::m2::M2SkinPivots {M2PerSequenceTimelines, M2MultitexParticles} |
| The Skin entity (.skin files, WotLK+): its existence boundary plus the profile's Cata shadow batches. | |
| constexpr std::array | wowlib::formats::m2::M2DataPivots |
| M2Root (the MD20 body): the union of every record pivot, its own trait slots (TBC combos, WotLK external skins) and the format-version steps (263/264/272/274). | |
| constexpr std::array | wowlib::formats::m2::M2FilePivots |
| M2ChunkedFile (the chunked stream): every chunk-introduction build — each documented since() value, so the active chunk set is constant within a range. | |
| constexpr std::array< ClientVersion, 0 > | wowlib::formats::m2::M2ChunkPayloadPivots {} |
| Skeleton and its chunk payloads plus the shell payload records: stable across the whole chunked era — no pivots, one instantiation. | |
| constexpr std::array | wowlib::formats::m2::M2AssemblyPivots |
| The M2 assembly: the union of the body, skin and stream pivots plus the bare-MD20 read gate (M2ChunkedOnly). | |
The M2 version vocabulary: the layout pivots record/entity partial specializations key on, and the MD20 formatVersion written for each targeted client.
The M2 format version (256–274) moves with the client but is stored per file — reading trusts the requested entity version's layout and cross-checks the file's value.
Definition in file boundaries.hpp.