wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
Loading...
Searching...
No Matches
wowlib::formats::wmo::group::chunks::MLIQData Struct Reference

#include <wowlib/formats/wmo/group/chunks/liquid.hpp>

Public Member Functions

Result< void > read (std::span< const std::byte > payload)
 Decode the MLIQ payload (the serializer's read hook).
Result< void > write (FileBuffer &out) const
 Encode the MLIQ payload (the serializer's write hook): the 30-byte header field-by-field, then the vertex and tile grids verbatim.
bool empty () const

Public Attributes

C2IVector vertsDim {}
C2IVector tilesDim {}
C3Vector baseCoords {}
std::uint16_t materialId = 0
std::vector< SMOLVert > vertices
std::vector< SMOLTile > tiles

Static Public Attributes

static constexpr std::size_t HeaderSize = 30
 The on-disk header size: four 4-byte ints, a 12-byte vector and a 2-byte material id, with no trailing padding — unlike sizeof(a natural struct), which would pad the material id up to a 4-byte boundary.

Detailed Description

Definition at line 85 of file liquid.hpp.

Member Function Documentation

◆ empty()

bool wowlib::formats::wmo::group::chunks::MLIQData::empty ( ) const
inlinenodiscard

Definition at line 188 of file liquid.hpp.

References vertices.

◆ read()

Result< void > wowlib::formats::wmo::group::chunks::MLIQData::read ( std::span< const std::byte > payload)
inline

Decode the MLIQ payload (the serializer's read hook).

Reads the 30-byte header field-by-field, derives the two array lengths from it and copies the vertex and tile grids.

Parameters
payloadthe chunk payload bytes.
Returns
an error if the payload is too short for the header or the grids it describes; success otherwise.

Definition at line 128 of file liquid.hpp.

References baseCoords, wowlib::ChunkTruncated, HeaderSize, wowlib::makeError(), materialId, tiles, tilesDim, vertices, and vertsDim.

◆ write()

Result< void > wowlib::formats::wmo::group::chunks::MLIQData::write ( FileBuffer & out) const
inline

Encode the MLIQ payload (the serializer's write hook): the 30-byte header field-by-field, then the vertex and tile grids verbatim.

Parameters
outthe destination buffer (appended, not cleared).
Returns
nothing; emitting cannot fail.

Definition at line 168 of file liquid.hpp.

References baseCoords, materialId, tiles, tilesDim, vertices, and vertsDim.

Member Data Documentation

◆ baseCoords

C3Vector wowlib::formats::wmo::group::chunks::MLIQData::baseCoords {}

Definition at line 102 of file liquid.hpp.

Referenced by read(), and write().

◆ HeaderSize

std::size_t wowlib::formats::wmo::group::chunks::MLIQData::HeaderSize = 30
staticconstexpr

The on-disk header size: four 4-byte ints, a 12-byte vector and a 2-byte material id, with no trailing padding — unlike sizeof(a natural struct), which would pad the material id up to a 4-byte boundary.

Definition at line 119 of file liquid.hpp.

Referenced by read().

◆ materialId

std::uint16_t wowlib::formats::wmo::group::chunks::MLIQData::materialId = 0

Definition at line 106 of file liquid.hpp.

Referenced by read(), and write().

◆ tiles

std::vector<SMOLTile> wowlib::formats::wmo::group::chunks::MLIQData::tiles

Definition at line 114 of file liquid.hpp.

Referenced by read(), and write().

◆ tilesDim

C2IVector wowlib::formats::wmo::group::chunks::MLIQData::tilesDim {}

Definition at line 99 of file liquid.hpp.

Referenced by read(), and write().

◆ vertices

std::vector<SMOLVert> wowlib::formats::wmo::group::chunks::MLIQData::vertices

Definition at line 110 of file liquid.hpp.

Referenced by empty(), read(), and write().

◆ vertsDim

C2IVector wowlib::formats::wmo::group::chunks::MLIQData::vertsDim {}

Definition at line 95 of file liquid.hpp.

Referenced by read(), and write().


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