|
wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
|
Namespaces | |
| namespace | bone |
| The .bone facial-pose file entity (WoD+). | |
| namespace | chunked |
| The Legion+ chunked .m2 shell (M2ChunkedFile) with its per-version classes and the companion-chunk payload records (AFID entries, extended particles, parent-model overrides). | |
| namespace | detail |
| A shared model skeleton (.skel, 7.3+): the bones, attachments and sequences a skel-based model moved out of its MD20 image, plus the satellite ids. | |
| namespace | root |
| The MD20 model body (M2Root) with its per-version classes. | |
| namespace | skin |
| The external LOD view entity (.skin file, WotLK+) and the skin profile records (submeshes, render batches). | |
Classes | |
| class | AnimBuffers |
| The per-sequence external write buffers every M2-family write path shares: an external sequence's data lands in its own per-key buffer as the tracks route their blocks through sink(); inline sequences (and aliases, whose flags never mark them external) stay in the entity image. More... | |
| class | AnimCache |
| A lazy per-sequence .anim loader handing out resolution windows: for a chunked file (leading AFM2) the requested chunk's payload, for a raw file the whole content when AFM2 is asked for (raw files predate the split sections). More... | |
| struct | BoneFile |
| One .bone file: which bones get facial-pose offset matrices, and the matrices. More... | |
| struct | M2Base |
| The version-agnostic base of every M2<V> (welded as "M2"). More... | |
| struct | M2OffsetBase |
| The non-template marker base every offset block carries (what the OffsetEntity concept detects). More... | |
| struct | M2OffsetBlock |
| The serialization face of an offset block, mixed in CRTP-style: an entity struct E : M2OffsetBlock<E> gains read()/write() plus the imageSize() and memberOffset() layout queries. More... | |
| struct | OffsetReadContext |
| Resolution of SequenceData members while reading: where each outer element's nested data lives. More... | |
| struct | OffsetWriteContext |
| Resolution of SequenceData members while writing: which buffer each outer element's nested data blocks are appended to (offsets recorded relative to that buffer). More... | |
| class | SatellitePaths |
| The satellite-file naming conventions around one model path: every companion file of "creature\\x\\x.m2" derives from the same stem. More... | |
| struct | SequenceKey |
| A sequence's satellite identity: the (animation id, variation) pair the .anim naming convention ("{stem}AAAA-SS.anim") and the AFID entries key on. More... | |
| struct | SkeletonBase |
| The version-agnostic base of every Skeleton<V> (welded as "Skeleton"). More... | |
| struct | SkelParentData |
| The SKPD payload: the parent-skeleton link used for de-duplication (e.g. More... | |
Concepts | |
| concept | OffsetStringMember |
| A member serialized as an M2Array<char>: its bytes (NUL included) live in a data block, referenced by an M2Array{count, offset} slot. | |
| concept | OffsetArrayMember |
| A member serialized as an M2Array{count, offset} reference to a separate data block — a std::vector (the block holds its element images) or a std::string. | |
| concept | InlineRecordMember |
| A member serialized inline as a nested record: a non-trivial class the walker recurses into member-by-member at the current cursor (M2Track and friends). | |
| concept | InlineScalarMember |
| A member serialized as inline raw bytes: anything trivially copyable that is not an array/string reference (scalars, C3Vector, M2Range, …). | |
| concept | OffsetEntity |
| A type the offset engine can read and write: it is an M2 offset block and declares the client version it is laid out for. | |
Typedefs | |
| template<ClientVersion V> | |
| using | M2ChunkedFile = chunked::M2ChunkedFile<canonicalVersion(V, M2FilePivots, M2ChunkedVersions)> |
| The chunked .m2 stream — the canonicalizing face of chunked::M2ChunkedFile: every Legion+ version maps to its range's first grid version (M2FilePivots — the active chunk set is constant within a range). | |
| template<ClientVersion V> | |
| using | M2 = detail::M2<canonicalVersion(V, M2AssemblyPivots, M2Versions)> |
| A whole model — the canonicalizing face of detail::M2: every client version maps to its range's first grid version (M2AssemblyPivots), so one instantiation serves e.g. | |
| template<ClientVersion V> | |
| using | M2Root = root::M2Root<canonicalVersion(V, M2DataPivots, M2Versions)> |
| The MD20 body — the canonicalizing face of root::M2Root: every client version maps to its range's first grid version (M2DataPivots), so one instantiation serves e.g. | |
| template<ClientVersion V> | |
| using | SkelHeader = detail::SkelHeader<canonicalVersion(V, M2ChunkPayloadPivots, M2ChunkedVersions)> |
| The SKL1 payload — canonicalizing face of detail::SkelHeader. | |
| template<ClientVersion V> | |
| using | SkelSequences = detail::SkelSequences<canonicalVersion(V, M2ChunkPayloadPivots, M2ChunkedVersions)> |
| The SKS1 payload — canonicalizing face of detail::SkelSequences. | |
| template<ClientVersion V> | |
| using | SkelBones = detail::SkelBones<canonicalVersion(V, M2ChunkPayloadPivots, M2ChunkedVersions)> |
| The SKB1 payload — canonicalizing face of detail::SkelBones. | |
| template<ClientVersion V> | |
| using | SkelAttachments = detail::SkelAttachments<canonicalVersion(V, M2ChunkPayloadPivots, M2ChunkedVersions)> |
| The SKA1 payload — canonicalizing face of detail::SkelAttachments. | |
| template<ClientVersion V> | |
| using | Skeleton = detail::Skeleton<canonicalVersion(V, M2ChunkPayloadPivots, M2ChunkedVersions)> |
| A shared model skeleton — the canonicalizing face of detail::Skeleton: the whole chunked era is one range (M2ChunkPayloadPivots is empty), so a SINGLE instantiation serves Legion through the latest release. | |
| template<ClientVersion V> | |
| using | Skin |
| An external LOD view — the canonicalizing face of detail::Skin: every WotLK+ version maps to its range's first grid version (M2SkinPivots: only Cata's shadow batches split the era, so two instantiations cover all nine releases). | |
Enumerations | |
| enum class | GlobalFlags |
| M2Root::globalFlags bits. More... | |
Functions | |
| consteval std::uint32_t | 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 > | 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(). | |
| template<typename T, ClientVersion V> | |
| consteval std::size_t | layoutSize () |
| The image footprint of T in an offset layout for client version V: the 8-byte M2Array slot for an array/string reference, sizeof for an inline scalar, and the version-active member sum for an inline record (client records have no implicit padding, so the sum IS the layout). | |
Variables | |
| constexpr ClientVersion | 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 | 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 | 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 | M2SplitBlendTimes = builds::WoD |
| WoD (6.0.1): M2Sequence's u32 blendTime splits into the blendTimeIn/blendTimeOut pair. | |
| constexpr ClientVersion | 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 | 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 | M2Versions |
| The versions M2 is instantiated (and welded) for: every targeted last-minor-of-major release, in release order. | |
| constexpr std::array | M2SkinVersions |
| The era subset .skin files exist for (WotLK+). | |
| constexpr std::array | M2ChunkedVersions |
| The era subset the chunked container exists for (Legion+). | |
| constexpr std::array | 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 | M2SequencePivots {M2PerSequenceTimelines, M2SplitBlendTimes} |
| M2Sequence: timestamps→duration at WotLK, blend-time split at WoD. | |
| constexpr std::array | M2BonePivots {M2CompressedBones, M2PerSequenceTimelines} |
| M2CompBone: raw→compressed quaternions + name CRC at TBC, per-sequence track timelines at WotLK. | |
| constexpr std::array | M2CameraPivots {M2PerSequenceTimelines, M2MultitexParticles} |
| M2Camera: per-sequence tracks at WotLK, static FoV→spline at Cata. | |
| constexpr std::array | 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 | M2SkinSectionPivots {M2CompressedBones} |
| M2SkinSection: the sort center/radius tail at TBC. | |
| constexpr std::array | M2SkinProfilePivots {M2CompressedBones, M2MultitexParticles} |
| M2SkinProfile: the section layout at TBC, shadow batches at Cata. | |
| constexpr std::array | M2SkinPivots {M2PerSequenceTimelines, M2MultitexParticles} |
| The Skin entity (.skin files, WotLK+): its existence boundary plus the profile's Cata shadow batches. | |
| constexpr std::array | 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 | 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 > | M2ChunkPayloadPivots {} |
| Skeleton and its chunk payloads plus the shell payload records: stable across the whole chunked era — no pivots, one instantiation. | |
| constexpr std::array | M2AssemblyPivots |
| The M2 assembly: the union of the body, skin and stream pivots plus the bare-MD20 read gate (M2ChunkedOnly). | |
| constexpr std::uint32_t | Md20Magic |
| The MD20 leading magic, as memcpy'd from disk. | |
| constexpr std::uint32_t | SkinMagic |
| The .skin leading magic, as memcpy'd from disk. | |
| using wowlib::formats::m2::M2 = detail::M2<canonicalVersion(V, M2AssemblyPivots, M2Versions)> |
A whole model — the canonicalizing face of detail::M2: every client version maps to its range's first grid version (M2AssemblyPivots), so one instantiation serves e.g.
both Cata and MoP.
| using wowlib::formats::m2::M2ChunkedFile = chunked::M2ChunkedFile<canonicalVersion(V, M2FilePivots, M2ChunkedVersions)> |
The chunked .m2 stream — the canonicalizing face of chunked::M2ChunkedFile: every Legion+ version maps to its range's first grid version (M2FilePivots — the active chunk set is constant within a range).
Pre-Legion versions stay a substitution failure, so the facade's era subsetting is unchanged.
Definition at line 189 of file chunked.hpp.
| using wowlib::formats::m2::M2Root = root::M2Root<canonicalVersion(V, M2DataPivots, M2Versions)> |
The MD20 body — the canonicalizing face of root::M2Root: every client version maps to its range's first grid version (M2DataPivots), so one instantiation serves e.g.
both Cata and MoP.
| using wowlib::formats::m2::SkelAttachments = detail::SkelAttachments<canonicalVersion(V, M2ChunkPayloadPivots, M2ChunkedVersions)> |
The SKA1 payload — canonicalizing face of detail::SkelAttachments.
Definition at line 145 of file skeleton.hpp.
| using wowlib::formats::m2::SkelBones = detail::SkelBones<canonicalVersion(V, M2ChunkPayloadPivots, M2ChunkedVersions)> |
The SKB1 payload — canonicalizing face of detail::SkelBones.
Definition at line 142 of file skeleton.hpp.
| using wowlib::formats::m2::Skeleton = detail::Skeleton<canonicalVersion(V, M2ChunkPayloadPivots, M2ChunkedVersions)> |
A shared model skeleton — the canonicalizing face of detail::Skeleton: the whole chunked era is one range (M2ChunkPayloadPivots is empty), so a SINGLE instantiation serves Legion through the latest release.
Pre-Legion versions stay a substitution failure.
Definition at line 277 of file skeleton.hpp.
| using wowlib::formats::m2::SkelHeader = detail::SkelHeader<canonicalVersion(V, M2ChunkPayloadPivots, M2ChunkedVersions)> |
The SKL1 payload — canonicalizing face of detail::SkelHeader.
Definition at line 136 of file skeleton.hpp.
| using wowlib::formats::m2::SkelSequences = detail::SkelSequences<canonicalVersion(V, M2ChunkPayloadPivots, M2ChunkedVersions)> |
The SKS1 payload — canonicalizing face of detail::SkelSequences.
Definition at line 139 of file skeleton.hpp.
| using wowlib::formats::m2::skin::Skin |
An external LOD view — the canonicalizing face of detail::Skin: every WotLK+ version maps to its range's first grid version (M2SkinPivots: only Cata's shadow batches split the era, so two instantiations cover all nine releases).
Pre-WotLK versions stay a substitution failure.
|
strong |
M2Root::globalFlags bits.
M2 global flags: tilt behavior, the texture-combiner-combo gate, physics participation and exporter-era markers.
|
consteval |
The image footprint of T in an offset layout for client version V: the 8-byte M2Array slot for an array/string reference, sizeof for an inline scalar, and the version-active member sum for an inline record (client records have no implicit padding, so the sum IS the layout).
Element kinds recurse, so vector<vector<u32>> and vector<Record> fall out naturally. gatedBy members are rejected inside records: their presence is runtime state, supported only at the entity top level (see M2OffsetBlock::imageSize).
| T | the member/record type to measure. |
| V | the client version the layout targets. |
Definition at line 133 of file offset_block.hpp.
References wowlib::formats::detail::annotation(), layoutSize(), wowlib::formats::detail::membersOf(), and wowlib::formats::detail::versionActive().
Referenced by wowlib::formats::m2::M2OffsetBlock< Derived >::_readArrayElements(), wowlib::formats::m2::M2OffsetBlock< Derived >::_readVectorBlock(), wowlib::formats::m2::M2OffsetBlock< Derived >::_writeArrayElements(), wowlib::formats::m2::M2OffsetBlock< Derived >::_writeVectorBlock(), wowlib::formats::m2::M2OffsetBlock< Derived >::imageSize(), layoutSize(), and wowlib::formats::m2::M2OffsetBlock< Derived >::memberOffset().
|
consteval |
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.
Matches the entity's formatVersion member.
| v | the targeted client version. |
Definition at line 61 of file boundaries.hpp.
References M2ChunkedContainer, M2CompressedBones, M2MultitexParticles, and M2PerSequenceTimelines.
|
consteval |
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().
| v | the targeted client version. |
Definition at line 74 of file boundaries.hpp.
References M2ChunkedContainer, M2CompressedBones, M2MultitexParticles, and M2PerSequenceTimelines.
|
inlineconstexpr |
The M2 assembly: the union of the body, skin and stream pivots plus the bare-MD20 read gate (M2ChunkedOnly).
Definition at line 203 of file boundaries.hpp.
|
inlineconstexpr |
M2CompBone: raw→compressed quaternions + name CRC at TBC, per-sequence track timelines at WotLK.
Definition at line 143 of file boundaries.hpp.
|
inlineconstexpr |
M2Camera: per-sequence tracks at WotLK, static FoV→spline at Cata.
Definition at line 146 of file boundaries.hpp.
|
inlineconstexpr |
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).
Definition at line 47 of file boundaries.hpp.
Referenced by m2FormatVersion(), m2FormatVersionRange(), wowlib::formats::m2::detail::M2< canonicalVersion(V, M2AssemblyPivots, M2Versions)>::operator==(), wowlib::formats::m2::detail::M2< V >::read(), and wowlib::formats::m2::detail::M2< V >::write().
|
inlineconstexpr |
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.
Definition at line 53 of file boundaries.hpp.
Referenced by wowlib::formats::m2::detail::M2< V >::read().
|
inlineconstexpr |
The era subset the chunked container exists for (Legion+).
Definition at line 124 of file boundaries.hpp.
|
inlineconstexpr |
Skeleton and its chunk payloads plus the shell payload records: stable across the whole chunked era — no pivots, one instantiation.
Definition at line 199 of file boundaries.hpp.
|
inlineconstexpr |
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).
Definition at line 24 of file boundaries.hpp.
Referenced by m2FormatVersion(), and m2FormatVersionRange().
|
inlineconstexpr |
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).
Definition at line 165 of file boundaries.hpp.
|
inlineconstexpr |
M2ChunkedFile (the chunked stream): every chunk-introduction build — each documented since() value, so the active chunk set is constant within a range.
Canonicalized over M2ChunkedVersions.
Definition at line 176 of file boundaries.hpp.
|
inlineconstexpr |
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.
Definition at line 38 of file boundaries.hpp.
Referenced by m2FormatVersion(), and m2FormatVersionRange().
|
inlineconstexpr |
M2Particle: byte-packed blending/emitter types at TBC, FBlock ramps and spins at WotLK, the multi-texture 492-byte layout at Cata.
Definition at line 150 of file boundaries.hpp.
|
inlineconstexpr |
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.
Definition at line 32 of file boundaries.hpp.
Referenced by m2FormatVersion(), m2FormatVersionRange(), wowlib::formats::m2::detail::M2< canonicalVersion(V, M2AssemblyPivots, M2Versions)>::operator==(), wowlib::formats::m2::detail::M2< V >::read(), and wowlib::formats::m2::detail::M2< V >::write().
|
inlineconstexpr |
M2Sequence: timestamps→duration at WotLK, blend-time split at WoD.
Definition at line 139 of file boundaries.hpp.
|
inlineconstexpr |
The Skin entity (.skin files, WotLK+): its existence boundary plus the profile's Cata shadow batches.
Canonicalized over M2SkinVersions.
Definition at line 160 of file boundaries.hpp.
|
inlineconstexpr |
M2SkinProfile: the section layout at TBC, shadow batches at Cata.
Definition at line 156 of file boundaries.hpp.
|
inlineconstexpr |
M2SkinSection: the sort center/radius tail at TBC.
Definition at line 153 of file boundaries.hpp.
|
inlineconstexpr |
The era subset .skin files exist for (WotLK+).
Definition at line 111 of file boundaries.hpp.
|
inlineconstexpr |
WoD (6.0.1): M2Sequence's u32 blendTime splits into the blendTimeIn/blendTimeOut pair.
Definition at line 42 of file boundaries.hpp.
|
inlineconstexpr |
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).
Definition at line 136 of file boundaries.hpp.
|
inlineconstexpr |
The versions M2 is instantiated (and welded) for: every targeted last-minor-of-major release, in release order.
Definition at line 96 of file boundaries.hpp.
Referenced by wowlib::audit::detail::FormatDrivers::m2().
|
inlineconstexpr |
The MD20 leading magic, as memcpy'd from disk.
Definition at line 45 of file root.hpp.
Referenced by wowlib::formats::m2::detail::M2< V >::read().
|
inlineconstexpr |