|
wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
|
A WDL low-resolution heightmap file for one client version. More...
#include <wowlib/formats/wdl/wdl.hpp>
Public Member Functions | |
| std::vector< std::uint32_t > | oceanMaskTiles () const |
| The heightmap ordinal each ocean mask belongs to (parallel to oceanMasks): derived from the stored journal's interleave, or the identity pairing for fresh entities. | |
| void | validateExtra (ValidationReport &report) const |
| Validation hook (see formats::detail::validateValue): the tile-table pairing invariants — the MAOF table's shape, and the ordinal pairing that makes the i-th nonzero slot own the i-th heightmap. | |
| Result< std::optional< std::vector< JournalEntry > > > | resequencedJournal () const |
| Serializer hook (see writeEntity): once the stored journal no longer matches the tile data (tiles added/removed, or a fresh entity), rebuild the emission order — every non-tile chunk in canonical order, then each tile's MARE/(MAOC/MAOE)/MAHO interleaved after MAOF, preserved unknown chunks last. | |
| Result< void > | patchFile (std::span< std::byte > image) const |
| Serializer hook (see writeEntity): stamp the MAOF table in the finished image — the i-th nonzero slot receives the i-th MARE chunk's absolute offset. | |
| Result< void > | read (fs::FileSystem &fs, const FileKey &key) |
| Load the WDL from a client filesystem, replacing this entity's contents. | |
| Result< void > | write (fs::FileSystem &fs, const FileKey &key) const |
| Serialize and store the WDL through the filesystem's project overlay. | |
| Public Member Functions inherited from wowlib::formats::ChunkedFile< WDL< 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 = WdlVersion18 |
| The WDL format version; 18 for every supported client. | |
| StringBlock | wmoFilenames |
| std::vector< std::uint32_t > | wmoFilenameOffsets |
| MWMO filename start offsets (MWID), one per name. | |
| std::vector< SMMapObjDef > | wmoPlacements |
| WMO silhouette placements (MODF), one per MWMO name; the same 64-byte record the WDT and ADT use. | |
| std::vector< std::uint32_t > | tileOffsets |
| std::vector< TileHeights > | heightmaps |
| 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); the per-tile interleave is produced by resequencedJournal(), not this table. | |
A WDL low-resolution heightmap file for one client version.
Instantiate through the canonicalizing wdl::WDL alias, never directly.
The tile chunks pair by ordinal: the i-th heightmap belongs to the i-th nonzero tileOffsets slot (row-major), and the i-th hole mask to the i-th heightmap. The MAOF offsets themselves are DERIVED — stamped from the finished layout on every write — so only the nonzero pattern is authored data; toggle a slot nonzero (any value) and give it a heightmap to add a tile.
| V | the client version this layout targets. |
| std::vector< std::uint32_t > wowlib::formats::wdl::detail::WDL< V >::oceanMaskTiles | ( | ) | const |
The heightmap ordinal each ocean mask belongs to (parallel to oceanMasks): derived from the stored journal's interleave, or the identity pairing for fresh entities.
Empty for versions without MAOE.
Definition at line 285 of file wdl.hpp.
References wowlib::formats::detail::chunkMemberIndex(), wowlib::formats::fourcc(), heightmaps, and wowlib::formats::ChunkExtras::journal.
| Result< void > wowlib::formats::wdl::detail::WDL< V >::patchFile | ( | std::span< std::byte > | image | ) | const |
Serializer hook (see writeEntity): stamp the MAOF table in the finished image — the i-th nonzero slot receives the i-th MARE chunk's absolute offset.
| image | this entity's complete serialized image. |
Definition at line 447 of file wdl.hpp.
References wowlib::formats::fourcc(), wowlib::InvalidEntityState, wowlib::makeError(), and wowlib::formats::wdl::WdlTileSlots.
| Result< void > wowlib::formats::wdl::detail::WDL< V >::read | ( | fs::FileSystem & | fs, |
| const FileKey & | key ) |
Load the WDL from a client filesystem, replacing this entity's contents.
| fs | the filesystem gateway |
| key | the file identity (path and/or FileDataID) |
Definition at line 498 of file wdl.hpp.
References wowlib::FormatVersionMismatch, wowlib::makeError(), mver, wowlib::formats::ChunkedFile< Derived >::read(), and wowlib::formats::wdl::WdlVersion18.
| Result< std::optional< std::vector< JournalEntry > > > wowlib::formats::wdl::detail::WDL< V >::resequencedJournal | ( | ) | const |
Serializer hook (see writeEntity): once the stored journal no longer matches the tile data (tiles added/removed, or a fresh entity), rebuild the emission order — every non-tile chunk in canonical order, then each tile's MARE/(MAOC/MAOE)/MAHO interleaved after MAOF, preserved unknown chunks last.
Requires the tile-table pairing invariants (validateExtra) to hold.
Definition at line 345 of file wdl.hpp.
References wowlib::formats::detail::chunkMemberIndex(), wowlib::formats::fourcc(), wowlib::formats::detail::freshJournal(), heightmaps, wowlib::formats::ChunkExtras::journal, wowlib::formats::JournalEntry::member, and validateExtra().
| void wowlib::formats::wdl::detail::WDL< V >::validateExtra | ( | ValidationReport & | report | ) | const |
Validation hook (see formats::detail::validateValue): the tile-table pairing invariants — the MAOF table's shape, and the ordinal pairing that makes the i-th nonzero slot own the i-th heightmap.
These are the SAME contracts the write path must hold to lay out a rebuilt journal, so write() checks them through this hook rather than restating them (see resequencedJournal).
| report | the report findings land in. |
Definition at line 310 of file wdl.hpp.
References wowlib::formats::ValidationReport::addError(), heightmaps, tileOffsets, and wowlib::formats::wdl::WdlTileSlots.
Referenced by resequencedJournal().
| Result< void > wowlib::formats::wdl::detail::WDL< V >::write | ( | fs::FileSystem & | fs, |
| const FileKey & | key ) const |
Serialize and store the WDL through the filesystem's project overlay.
| fs | the filesystem gateway |
| key | the file identity; must resolve to a path |
Definition at line 510 of file wdl.hpp.
References wowlib::makeError(), wowlib::FileKey::path, wowlib::PathNotResolvable, and wowlib::formats::ChunkedFile< Derived >::write().
|
staticconstexpr |
The canonical chunk-stream order the serializer emits a fresh entity in (see writeOrder); the per-tile interleave is produced by resequencedJournal(), not this table.
Lists every chunk member exactly once.
| std::vector<TileHeights> wowlib::formats::wdl::detail::WDL< V >::heightmaps |
Definition at line 190 of file wdl.hpp.
Referenced by oceanMaskTiles(), resequencedJournal(), and validateExtra().
| std::uint32_t wowlib::formats::wdl::detail::WDL< V >::mver = WdlVersion18 |
| std::vector<std::uint32_t> wowlib::formats::wdl::detail::WDL< V >::tileOffsets |
Definition at line 187 of file wdl.hpp.
Referenced by validateExtra().
|
staticconstexpr |
| std::vector<std::uint32_t> wowlib::formats::wdl::detail::WDL< V >::wmoFilenameOffsets |
| StringBlock wowlib::formats::wdl::detail::WDL< V >::wmoFilenames |
| std::vector<SMMapObjDef> wowlib::formats::wdl::detail::WDL< V >::wmoPlacements |