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

A WDT main file for one client version. More...

#include <wowlib/formats/wdt/root/root.hpp>

Inheritance diagram for wowlib::formats::wdt::root::detail::WDTRoot< V >:

Public Member Functions

void validateExtra (ValidationReport &report) const
 Validation hook (see formats::detail::validateValue): the map-wide tables the client indexes POSITIONALLY, so their size is the contract — the 64x64 MAIN grid and, when engaged, the matching MAID grid — plus the global-WMO records a WMO-only map is limited to.
Public Member Functions inherited from wowlib::formats::ChunkedFile< WDTRoot< 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 = WdtVersion18
 The WDT format version; 18 for every supported client.
SMMapHeader< V > header {}
 The map header (MPHD): flags and, since 8.1, the satellite FileDataIDs.
std::vector< SMAreaInfo > tiles
StringBlock globalWmoName
std::vector< SMMapObjDef > globalWmo
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 (see writeOrder).

Detailed Description

template<ClientVersion V>
struct wowlib::formats::wdt::root::detail::WDTRoot< V >

A WDT main file for one client version.

The main file holds the map-wide header (MPHD), the 64x64 tile table (MAIN) saying which tiles have terrain, since 8.1 the per-tile FileDataID table (MAID), and — for WMO-only maps — the single global map object (MWMO/MODF). Version-gated chunks are inherited from the detail:: trait bases active for V. Instantiate through the canonicalizing wdt::root::WDTRoot alias, never directly.

Template Parameters
Vthe client version this layout targets.
See also
https://wowdev.wiki/WDT

Definition at line 75 of file root.hpp.

Member Function Documentation

◆ validateExtra()

template<ClientVersion V>
void wowlib::formats::wdt::root::detail::WDTRoot< V >::validateExtra ( ValidationReport & report) const
inline

Validation hook (see formats::detail::validateValue): the map-wide tables the client indexes POSITIONALLY, so their size is the contract — the 64x64 MAIN grid and, when engaged, the matching MAID grid — plus the global-WMO records a WMO-only map is limited to.

Parameters
reportthe report findings land in.

Definition at line 119 of file root.hpp.

Member Data Documentation

◆ ChunkOrder

template<ClientVersion V>
std::array wowlib::formats::wdt::root::detail::WDTRoot< V >::ChunkOrder
staticconstexpr
Initial value:
= {
fourcc("MVER"),
fourcc("MPHD"),
fourcc("MAIN"),
fourcc("MAID"),
fourcc("MWMO"),
fourcc("MODF"),
fourcc("MANM"),
}
constexpr std::uint32_t fourcc(const char(&cc)[5], FourCCEndian endian=FourCCEndian::Reversed)
The host integer a scanned chunk id compares equal to for code cc.
Definition fourcc.hpp:33

The canonical chunk-stream order the serializer emits a fresh entity in (see writeOrder).

Lists every chunk member exactly once.

MAI2 (12.0.5+, Midnight) postdates the supported client range; it and any other unmodeled chunk round-trip through ChunkExtras::unknown.

Definition at line 104 of file root.hpp.

◆ globalWmo

template<ClientVersion V>
std::vector<SMMapObjDef> wowlib::formats::wdt::root::detail::WDTRoot< V >::globalWmo

Definition at line 97 of file root.hpp.

◆ globalWmoName

Definition at line 94 of file root.hpp.

◆ header

The map header (MPHD): flags and, since 8.1, the satellite FileDataIDs.

Definition at line 88 of file root.hpp.

◆ mver

The WDT format version; 18 for every supported client.

Definition at line 84 of file root.hpp.

◆ tiles

Definition at line 91 of file root.hpp.

◆ Version

template<ClientVersion V>
ClientVersion wowlib::formats::wdt::root::detail::WDTRoot< V >::Version = V
staticconstexpr

Definition at line 80 of file root.hpp.


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