|
wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
|
A WMO (world map object) root file for one client version. More...
#include <wowlib/formats/wmo/root/root.hpp>
Public Member Functions | |
| void | patchChunk (std::uint32_t fourccMagic, std::span< std::byte > payload) const |
| Serializer hook (see writeEntity): stamp the derived MOHD counts into the just-written header payload — nGroups from the MOGI table, nPortals and nDoodadSets from their vectors. | |
| void | validateExtra (ValidationReport &report) const |
| Validation hook (see detail::validateEntity): the root contracts the annotations cannot express — doodad-set/portal/visible-block ranges, string-block references and the doodad name/FileDataID resolution. | |
| Public Member Functions inherited from wowlib::formats::ChunkedFile< WMORoot< 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 Attributes | |
| std::uint32_t | mver = WmoVersionV17 |
| The WMO format version; 17 for every supported client. | |
| SMOHeader | header {} |
| The root header (MOHD). | |
| std::vector< SMOMaterial > | materials |
| Materials (MOMT). | |
| StringBlock | groupNames |
| Group names (MOGN), referenced by byte offset. | |
| std::vector< SMOGroupInfo > | groupInfos |
| Per-group info (MOGI). | |
| ChunkBlob | skyboxName |
| std::vector< C3Vector > | portalVertices |
| Portal vertices (MOPV). | |
| std::vector< SMOPortal > | portals |
| Portals (MOPT). | |
| std::vector< SMOPortalRef > | portalRefs |
| Portal references from groups (MOPR). | |
| std::vector< C3Vector > | visibleBlockVertices |
| Visible block vertices (MOVV). | |
| std::vector< SMOVisibleBlock > | visibleBlocks |
| Visible blocks (MOVB). | |
| std::vector< SMOLight > | lights |
| Lights (MOLT). | |
| std::vector< SMODoodadSet > | doodadSets |
| Doodad sets (MODS). | |
| std::vector< SMODoodadDef > | doodadDefs |
| Doodad placements (MODD). | |
| std::vector< SMOFog > | fogs |
| Fog volumes (MFOG). | |
| std::vector< C4Plane > | convexVolumePlanes |
| Convex volume planes (MCVP); transports mostly. | |
| ChunkBlob | momx |
| MOMX (11.x, undocumented purpose); preserved opaque. | |
| 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 std::array | ChunkOrder |
| The canonical chunk-stream order the serializer emits a fresh entity in — decoupled from the by-trait flatten order of the version bases. | |
A WMO (world map object) root file for one client version.
The root file holds everything shared across the object — the material and texture tables, doodad (M2) sets and placements, portals, lights, fog, the convex-volume/visible-block culling data and the per-group table (MOGI/GFID) — while the actual 3D geometry lives in the separate group files (WMOGroup). The always-present chunks are own members (canonical order); version-gated chunks are inherited from the detail:: trait bases active for V.
| V | the client version this layout targets. |
|
inline |
Serializer hook (see writeEntity): stamp the derived MOHD counts into the just-written header payload — nGroups from the MOGI table, nPortals and nDoodadSets from their vectors.
The counts real client files disagree with their containers on (nTextures, nLights, nDoodadDefs, nDoodadNames) stay stored fields; see SMOHeader.
| fourccMagic | the emitted chunk's id, in disk layout. |
| payload | the finished chunk payload, patched in place. |
|
inline |
Validation hook (see detail::validateEntity): the root contracts the annotations cannot express — doodad-set/portal/visible-block ranges, string-block references and the doodad name/FileDataID resolution.
The MOHD counts patchChunk derives (nGroups, nPortals, nDoodadSets) need no check — every write restamps them — and the counts real files ship stale (nTextures, nLights, nDoodadDefs, nDoodadNames; see SMOHeader) are deliberately not validated. Cross-entity contracts (MOGI vs the group files, group references into this root) are the assembly's validate().
| report | the report findings land in. |
|
staticconstexpr |
The canonical chunk-stream order the serializer emits a fresh entity in — decoupled from the by-trait flatten order of the version bases.
Lists every chunk member exactly once (checked at compile time by writeOrder).
MFOB (12.1+, Midnight) postdates the supported client range; it and any other unmodeled root chunk round-trip through ChunkExtras::unknown.
| std::vector<C4Plane> wowlib::formats::wmo::root::detail::WMORoot< V >::convexVolumePlanes |
| std::vector<SMODoodadDef> wowlib::formats::wmo::root::detail::WMORoot< V >::doodadDefs |
| std::vector<SMODoodadSet> wowlib::formats::wmo::root::detail::WMORoot< V >::doodadSets |
| std::vector<SMOFog> wowlib::formats::wmo::root::detail::WMORoot< V >::fogs |
| std::vector<SMOGroupInfo> wowlib::formats::wmo::root::detail::WMORoot< V >::groupInfos |
| StringBlock wowlib::formats::wmo::root::detail::WMORoot< V >::groupNames |
| SMOHeader wowlib::formats::wmo::root::detail::WMORoot< V >::header {} |
| std::vector<SMOLight> wowlib::formats::wmo::root::detail::WMORoot< V >::lights |
| std::vector<SMOMaterial> wowlib::formats::wmo::root::detail::WMORoot< V >::materials |
| ChunkBlob wowlib::formats::wmo::root::detail::WMORoot< V >::momx |
| std::uint32_t wowlib::formats::wmo::root::detail::WMORoot< V >::mver = WmoVersionV17 |
| std::vector<SMOPortalRef> wowlib::formats::wmo::root::detail::WMORoot< V >::portalRefs |
| std::vector<SMOPortal> wowlib::formats::wmo::root::detail::WMORoot< V >::portals |
| std::vector<C3Vector> wowlib::formats::wmo::root::detail::WMORoot< V >::portalVertices |
| ChunkBlob wowlib::formats::wmo::root::detail::WMORoot< V >::skyboxName |
|
staticconstexpr |
| std::vector<SMOVisibleBlock> wowlib::formats::wmo::root::detail::WMORoot< V >::visibleBlocks |
| std::vector<C3Vector> wowlib::formats::wmo::root::detail::WMORoot< V >::visibleBlockVertices |