wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
Loading...
Searching...
No Matches
wowlib::formats::m2::chunked::M2ChunkedFile< V > Struct Template Reference

The chunked .m2 shell for one Legion+ client version. More...

#include <wowlib/formats/m2/chunked/chunked.hpp>

Inheritance diagram for wowlib::formats::m2::chunked::M2ChunkedFile< V >:

Public Member Functions

bool operator== (const M2ChunkedFile &) const =default
Public Member Functions inherited from wowlib::formats::ChunkedFile< M2ChunkedFile< V > >
Result< void > read (std::span< const std::byte > data)
 Deserialize file bytes into this entity, replacing its contents.
Result< FileBuffer > write () const
 Serialize this entity.
ValidationReport validate () const
Result< void > ensureValid () const
 Validate and raise on the first error instead of returning a report — the assert-style face of validate().
bool operator== (const ChunkedFile &) const=default
Public Member Functions inherited from wowlib::formats::ChunkExtras
bool operator== (const ChunkExtras &) const =default
Public Member Functions inherited from wowlib::formats::m2::chunked::M2ChunkedFileBase
bool operator== (const M2ChunkedFileBase &) const =default

Public Attributes

ChunkBlob md21
 The MD20 image TRANSPORT blob; offsets inside are relative to this payload.
std::vector< std::uint32_t > physFdid
 .phys FileDataID (PFID); 0 or 1 entries.
std::vector< std::uint32_t > skinFdids
 .skin FileDataIDs (SFID): num_skin_profiles view entries, then the LOD-band skins.
std::vector< AnimFileEntry > animFdids
 .anim FileDataIDs (AFID), one per external (animation, variation) pair.
std::vector< std::uint32_t > boneFdids
 .bone FileDataIDs (BFID), one per FacePose variant.
std::vector< std::array< std::uint8_t, 2 > > textureAc
 Texture transform flags (TXAC), one 2-byte record per material then per particle emitter.
std::vector< M2ExtendedParticleSimple > extendedParticles
 Extended particle parameters (EXPT), one per emitter; superseded by EXP2 when both exist.
Exp2Data extendedParticles2 {}
 Extended particle parameters with alpha-cutoff ramps (EXP2), one per emitter.
PabcData parentSequenceBlacklist {}
 Parent-model sequence blacklist (PABC).
ChunkBlob parentTextureWeights
 Parent texture weights (PADC); offset-based track payload kept verbatim.
PsbcData parentSequenceBounds {}
 Parent sequence bounds (PSBC).
ChunkBlob parentEventData
 Parent event data (PEDC); offset-based track payload kept verbatim.
std::vector< std::uint32_t > skeletonFdid
 .skel FileDataID (SKID); 0 or 1 entries.
std::vector< std::uint32_t > textureFdids
 Texture FileDataIDs (TXID), replacing the in-image texture filenames, one per texture.
ChunkBlob lodData
 LOD data (LDV1); layout partially known, kept verbatim.
std::vector< std::uint32_t > recursiveParticleModelFdids
 Recursive (child-emitter) particle model FileDataIDs (RPID), one per emitter.
std::vector< std::uint32_t > geometryParticleModelFdids
 Geometry particle model FileDataIDs (GPID), one per emitter.
ChunkBlob waterfallV1
 Waterfall render path v1 (WFV1); undocumented, kept verbatim.
ChunkBlob waterfallV2
 Waterfall render path v2 (WFV2); undocumented, kept verbatim.
Pgd1Data particleGeosetData {}
 Particle geoset data (PGD1), one geoset per emitter (wowdev dates it to the 1.13.2.30172 classic build — the 8.2.0 retail era).
ChunkBlob waterfallV3
 Waterfall render path v3 (WFV3); shader parameter block, kept verbatim.
ChunkBlob inlinePhys
 Inline physics (PFDC): a whole .phys image plus alignment padding, kept verbatim (structured PHYS is a follow-up milestone).
ChunkBlob edgeFade
 Edge fade data (EDGF), applied to batches with flags2 0x8; kept verbatim.
ChunkBlob alphaAttenuation
 Distance-based model alpha attenuation coefficients (NERF); kept verbatim.
ChunkBlob lightDetails
 Per-light detail overrides (DETL), kept verbatim: real 9.x files carry 16-byte records where wowdev documents 12 (see M2LightDetail for the known half).
ChunkBlob dboc
 DBOC; undocumented (16 or 32 bytes seen), kept verbatim.
ChunkBlob afra
 AFRA (Dragonflight+); not yet observed, kept verbatim.
ChunkBlob housingCollision
 Player-housing collision mesh (PCOL); offset-based layout, kept verbatim.
ChunkBlob dpiv
 DPIV; undocumented, kept verbatim.
Public Attributes inherited from wowlib::formats::ChunkExtras
std::vector< JournalEntry > journal
std::vector< UnknownChunk > unknown
std::vector< std::byte > trailing

Static Public Attributes

static constexpr ClientVersion Version = V
static constexpr FourCCEndian UnknownFourccEndian = FourCCEndian::Forward

Detailed Description

template<ClientVersion V>
requires (V >= M2ChunkedContainer)
struct wowlib::formats::m2::chunked::M2ChunkedFile< V >

The chunked .m2 shell for one Legion+ client version.

Reading is chunk-order independent and journaled, so an untouched shell rewrites byte-for-byte (the chunk-framework guarantee applies to the SHELL; the MD21 payload inside follows the offset-format semantic guarantee once the assembly re-encodes it). Instantiate through the canonicalizing m2::M2ChunkedFile alias, never directly.

Template Parameters
Vthe client version this shell targets.
See also
https://wowdev.wiki/M2#Chunks

Definition at line 58 of file chunked.hpp.

Member Function Documentation

◆ operator==()

template<ClientVersion V>
bool wowlib::formats::m2::chunked::M2ChunkedFile< V >::operator== ( const M2ChunkedFile< V > & ) const
default

Member Data Documentation

◆ afra

AFRA (Dragonflight+); not yet observed, kept verbatim.

Definition at line 168 of file chunked.hpp.

◆ alphaAttenuation

Distance-based model alpha attenuation coefficients (NERF); kept verbatim.

Definition at line 156 of file chunked.hpp.

◆ animFdids

.anim FileDataIDs (AFID), one per external (animation, variation) pair.

Definition at line 76 of file chunked.hpp.

◆ boneFdids

template<ClientVersion V>
std::vector<std::uint32_t> wowlib::formats::m2::chunked::M2ChunkedFile< V >::boneFdids

.bone FileDataIDs (BFID), one per FacePose variant.

Definition at line 80 of file chunked.hpp.

◆ dboc

DBOC; undocumented (16 or 32 bytes seen), kept verbatim.

Definition at line 164 of file chunked.hpp.

◆ dpiv

DPIV; undocumented, kept verbatim.

Definition at line 176 of file chunked.hpp.

◆ edgeFade

Edge fade data (EDGF), applied to batches with flags2 0x8; kept verbatim.

Definition at line 152 of file chunked.hpp.

◆ extendedParticles

Extended particle parameters (EXPT), one per emitter; superseded by EXP2 when both exist.

Definition at line 88 of file chunked.hpp.

◆ extendedParticles2

template<ClientVersion V>
Exp2Data wowlib::formats::m2::chunked::M2ChunkedFile< V >::extendedParticles2 {}

Extended particle parameters with alpha-cutoff ramps (EXP2), one per emitter.

Definition at line 92 of file chunked.hpp.

◆ geometryParticleModelFdids

template<ClientVersion V>
std::vector<std::uint32_t> wowlib::formats::m2::chunked::M2ChunkedFile< V >::geometryParticleModelFdids

Geometry particle model FileDataIDs (GPID), one per emitter.

Definition at line 128 of file chunked.hpp.

◆ housingCollision

Player-housing collision mesh (PCOL); offset-based layout, kept verbatim.

Definition at line 172 of file chunked.hpp.

◆ inlinePhys

Inline physics (PFDC): a whole .phys image plus alignment padding, kept verbatim (structured PHYS is a follow-up milestone).

wowdev dates it to the 9.0.1 alpha, but 8.3.7 shipped mid-alpha with the backport — 31 item M2s in the fleet client carry it.

Definition at line 148 of file chunked.hpp.

◆ lightDetails

Per-light detail overrides (DETL), kept verbatim: real 9.x files carry 16-byte records where wowdev documents 12 (see M2LightDetail for the known half).

Definition at line 160 of file chunked.hpp.

◆ lodData

LOD data (LDV1); layout partially known, kept verbatim.

Definition at line 120 of file chunked.hpp.

◆ md21

The MD20 image TRANSPORT blob; offsets inside are relative to this payload.

Hidden from the bindings: a chunk-level read keeps it verbatim, but the M2 assembly decodes it into M2.root and drops the bytes — the decoded body is the source of truth, and the assembly write re-encodes it here.

Definition at line 64 of file chunked.hpp.

◆ parentEventData

Parent event data (PEDC); offset-based track payload kept verbatim.

Definition at line 108 of file chunked.hpp.

◆ parentSequenceBlacklist

template<ClientVersion V>
PabcData wowlib::formats::m2::chunked::M2ChunkedFile< V >::parentSequenceBlacklist {}

Parent-model sequence blacklist (PABC).

Definition at line 96 of file chunked.hpp.

◆ parentSequenceBounds

template<ClientVersion V>
PsbcData wowlib::formats::m2::chunked::M2ChunkedFile< V >::parentSequenceBounds {}

Parent sequence bounds (PSBC).

Definition at line 104 of file chunked.hpp.

◆ parentTextureWeights

Parent texture weights (PADC); offset-based track payload kept verbatim.

Definition at line 100 of file chunked.hpp.

◆ particleGeosetData

template<ClientVersion V>
Pgd1Data wowlib::formats::m2::chunked::M2ChunkedFile< V >::particleGeosetData {}

Particle geoset data (PGD1), one geoset per emitter (wowdev dates it to the 1.13.2.30172 classic build — the 8.2.0 retail era).

Definition at line 140 of file chunked.hpp.

◆ physFdid

template<ClientVersion V>
std::vector<std::uint32_t> wowlib::formats::m2::chunked::M2ChunkedFile< V >::physFdid

.phys FileDataID (PFID); 0 or 1 entries.

Definition at line 68 of file chunked.hpp.

◆ recursiveParticleModelFdids

template<ClientVersion V>
std::vector<std::uint32_t> wowlib::formats::m2::chunked::M2ChunkedFile< V >::recursiveParticleModelFdids

Recursive (child-emitter) particle model FileDataIDs (RPID), one per emitter.

Definition at line 124 of file chunked.hpp.

◆ skeletonFdid

template<ClientVersion V>
std::vector<std::uint32_t> wowlib::formats::m2::chunked::M2ChunkedFile< V >::skeletonFdid

.skel FileDataID (SKID); 0 or 1 entries.

Definition at line 112 of file chunked.hpp.

◆ skinFdids

template<ClientVersion V>
std::vector<std::uint32_t> wowlib::formats::m2::chunked::M2ChunkedFile< V >::skinFdids

.skin FileDataIDs (SFID): num_skin_profiles view entries, then the LOD-band skins.

Definition at line 72 of file chunked.hpp.

◆ textureAc

template<ClientVersion V>
std::vector<std::array<std::uint8_t, 2> > wowlib::formats::m2::chunked::M2ChunkedFile< V >::textureAc

Texture transform flags (TXAC), one 2-byte record per material then per particle emitter.

Definition at line 84 of file chunked.hpp.

◆ textureFdids

template<ClientVersion V>
std::vector<std::uint32_t> wowlib::formats::m2::chunked::M2ChunkedFile< V >::textureFdids

Texture FileDataIDs (TXID), replacing the in-image texture filenames, one per texture.

Definition at line 116 of file chunked.hpp.

◆ UnknownFourccEndian

template<ClientVersion V>
FourCCEndian wowlib::formats::m2::chunked::M2ChunkedFile< V >::UnknownFourccEndian = FourCCEndian::Forward
staticconstexpr

Definition at line 60 of file chunked.hpp.

◆ Version

template<ClientVersion V>
ClientVersion wowlib::formats::m2::chunked::M2ChunkedFile< V >::Version = V
staticconstexpr

Definition at line 59 of file chunked.hpp.

◆ waterfallV1

Waterfall render path v1 (WFV1); undocumented, kept verbatim.

Definition at line 132 of file chunked.hpp.

◆ waterfallV2

Waterfall render path v2 (WFV2); undocumented, kept verbatim.

Definition at line 136 of file chunked.hpp.

◆ waterfallV3

Waterfall render path v3 (WFV3); shader parameter block, kept verbatim.

Definition at line 144 of file chunked.hpp.


The documentation for this struct was generated from the following file: