|
wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
|
A whole M2 model for one client version: the MD20 body plus every baked-in satellite. More...
#include <wowlib/formats/m2/m2.hpp>
Public Member Functions | |
| Result< void > | read (fs::FileSystem &fs, const FileKey &key) |
| Load the model and all its satellite files from a client filesystem, replacing this entity's contents. | |
| Result< void > | write (fs::FileSystem &fs, const FileKey &key) const |
| Serialize and store the model and every satellite file through the filesystem's project overlay; satellite names derive from the key, which must resolve to a path. | |
| 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 M2 &) const =default |
| Public Member Functions inherited from wowlib::formats::m2::M2Base | |
| bool | operator== (const M2Base &) const =default |
Public Attributes | |
| M2Root< V > | root {} |
| The MD20 body — the model's root, uniform across every era (pre-Legion it IS the file; Legion+ it is the decoded MD21 image, whose transport blob chunks drops after read). | |
Static Public Attributes | |
| static constexpr ClientVersion | Version = V |
A whole M2 model for one client version: the MD20 body plus every baked-in satellite.
Reading resolves external sequence data (.anim) and the LOD views (.skin) into the entity; writing re-derives the satellite set — sequences with (flags & 0x130) == 0 split back into "{model}AAAA-SS.anim" files, the skins into "{model}0N.skin".
There is no byte-perfect round-trip for offset formats: writes lay data out canonically, and a written model re-reads equal instead. Instantiate through the canonicalizing m2::M2 alias, never directly.
| V | the canonical client version this assembly targets. |
|
nodiscard |
Validate and raise on the first error instead of returning a report — the assert-style face of validate().
Definition at line 895 of file m2.hpp.
References wowlib::formats::m2::detail::M2< canonicalVersion(V, M2AssemblyPivots, M2Versions)>::ensureValid(), and validate().
|
default |
| Result< void > wowlib::formats::m2::detail::M2< V >::read | ( | fs::FileSystem & | fs, |
| const FileKey & | key ) |
Load the model and all its satellite files from a client filesystem, replacing this entity's contents.
| fs | the filesystem gateway |
| key | the .m2 file identity (path and/or FileDataID) |
Definition at line 525 of file m2.hpp.
References wowlib::FormatVersionMismatch, wowlib::formats::m2::M2ChunkedContainer, wowlib::formats::m2::M2ChunkedOnly, wowlib::formats::m2::M2PerSequenceTimelines, wowlib::makeError(), wowlib::formats::m2::Md20Magic, wowlib::formats::m2::detail::M2< canonicalVersion(V, M2AssemblyPivots, M2Versions)>::read(), and root.
|
nodiscard |
Definition at line 843 of file m2.hpp.
References wowlib::formats::ValidationReport::full(), root, wowlib::formats::m2::detail::M2< canonicalVersion(V, M2AssemblyPivots, M2Versions)>::validate(), wowlib::formats::detail::validateEntity(), wowlib::formats::detail::validateOptionalIndexElements(), and wowlib::formats::m2::detail::validateProfileAgainstRoot().
Referenced by ensureValid().
| Result< void > wowlib::formats::m2::detail::M2< V >::write | ( | fs::FileSystem & | fs, |
| const FileKey & | key ) const |
Serialize and store the model and every satellite file through the filesystem's project overlay; satellite names derive from the key, which must resolve to a path.
| fs | the filesystem gateway |
| key | the .m2 file identity; must resolve to a path |
Definition at line 565 of file m2.hpp.
References wowlib::formats::m2::M2ChunkedContainer, wowlib::formats::m2::M2PerSequenceTimelines, wowlib::makeError(), wowlib::FileKey::path, wowlib::PathNotResolvable, root, and wowlib::formats::m2::detail::M2< canonicalVersion(V, M2AssemblyPivots, M2Versions)>::write().
| M2Root<V> wowlib::formats::m2::detail::M2< V >::root {} |
The MD20 body — the model's root, uniform across every era (pre-Legion it IS the file; Legion+ it is the decoded MD21 image, whose transport blob chunks drops after read).
Definition at line 128 of file m2.hpp.
Referenced by read(), validate(), and write().
|
staticconstexpr |