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

The per-cell MCNK header — 128 bytes, memcpy'd verbatim. More...

#include <wowlib/formats/adt/chunks/header.hpp>

Public Member Functions

std::uint64_t holesHighRes () const
 The 64-bit high-resolution hole mask (the 8 bytes at header offset 0x14), valid when the high_res_holes flag is set.
void setHolesHighRes (std::uint64_t holes)
 Set the 64-bit high-resolution hole mask (and the high_res_holes flag).
bool operator== (const SMChunk &) const =default

Public Attributes

MapChunkFlags flags {}
 Flags; MapChunkFlags bits.
std::uint32_t indexX = 0
 The cell's column index in the 16x16 grid (0-15).
std::uint32_t indexY = 0
 The cell's row index in the 16x16 grid (0-15).
std::uint32_t nLayers = 0
std::uint32_t nDoodadRefs = 0
std::uint32_t ofsHeight = 0
std::uint32_t ofsNormal = 0
std::uint32_t ofsLayer = 0
std::uint32_t ofsRefs = 0
std::uint32_t ofsAlpha = 0
std::uint32_t sizeAlpha = 0
std::uint32_t ofsShadow = 0
std::uint32_t sizeShadow = 0
std::uint32_t areaId = 0
 The cell's area id (a foreign key into AreaTable; in the alpha clients, packed zone/subzone u16s).
std::uint32_t nMapObjRefs = 0
std::uint16_t holesLowRes = 0
 The 16-bit low-resolution terrain hole mask (a 4x4 bitfield); used unless the high_res_holes flag selects holes_high_res.
std::uint16_t unknownButUsed = 0
 Unknown but written (padding in the alpha clients).
std::array< std::uint8_t, 16 > predominantTexture {}
std::array< std::uint8_t, 8 > noEffectDoodad {}
 An 8x8 bitfield (8 bytes): 1 disables detail doodads in that sub-cell (WoD may store it as an explicit MCDD chunk).
std::uint32_t ofsSndEmitters = 0
std::uint32_t nSndEmitters = 0
std::uint32_t ofsLiquid = 0
std::uint32_t sizeLiquid = 0
C3Vector position {}
 The cell origin in world space; MCVT heights are relative to it.
std::uint32_t ofsMccv = 0
std::uint32_t ofsMclv = 0
std::uint32_t unused = 0

Detailed Description

The per-cell MCNK header — 128 bytes, memcpy'd verbatim.

Sub-chunk offsets and sizes and the derived counts are stamped by the serializer and hidden from the bindings; author the flags, indices, area, holes, detail-doodad maps and origin.

Definition at line 42 of file header.hpp.

Member Function Documentation

◆ holesHighRes()

std::uint64_t wowlib::formats::adt::chunks::SMChunk::holesHighRes ( ) const
inlinenodiscard

The 64-bit high-resolution hole mask (the 8 bytes at header offset 0x14), valid when the high_res_holes flag is set.

Definition at line 95 of file header.hpp.

References ofsHeight, and ofsNormal.

◆ operator==()

bool wowlib::formats::adt::chunks::SMChunk::operator== ( const SMChunk & ) const
default

◆ setHolesHighRes()

void wowlib::formats::adt::chunks::SMChunk::setHolesHighRes ( std::uint64_t holes)
inline

Set the 64-bit high-resolution hole mask (and the high_res_holes flag).

Definition at line 100 of file header.hpp.

References flags, wowlib::formats::adt::chunks::HighResHoles, ofsHeight, ofsNormal, and wowlib::formats::setFlag().

Member Data Documentation

◆ areaId

std::uint32_t wowlib::formats::adt::chunks::SMChunk::areaId = 0

The cell's area id (a foreign key into AreaTable; in the alpha clients, packed zone/subzone u16s).

Definition at line 66 of file header.hpp.

◆ flags

MapChunkFlags wowlib::formats::adt::chunks::SMChunk::flags {}

Flags; MapChunkFlags bits.

Definition at line 44 of file header.hpp.

Referenced by setHolesHighRes().

◆ holesLowRes

std::uint16_t wowlib::formats::adt::chunks::SMChunk::holesLowRes = 0

The 16-bit low-resolution terrain hole mask (a 4x4 bitfield); used unless the high_res_holes flag selects holes_high_res.

Definition at line 71 of file header.hpp.

◆ indexX

std::uint32_t wowlib::formats::adt::chunks::SMChunk::indexX = 0

The cell's column index in the 16x16 grid (0-15).

Definition at line 47 of file header.hpp.

◆ indexY

std::uint32_t wowlib::formats::adt::chunks::SMChunk::indexY = 0

The cell's row index in the 16x16 grid (0-15).

Definition at line 50 of file header.hpp.

◆ nDoodadRefs

std::uint32_t wowlib::formats::adt::chunks::SMChunk::nDoodadRefs = 0

Definition at line 53 of file header.hpp.

◆ nLayers

std::uint32_t wowlib::formats::adt::chunks::SMChunk::nLayers = 0

Definition at line 52 of file header.hpp.

◆ nMapObjRefs

std::uint32_t wowlib::formats::adt::chunks::SMChunk::nMapObjRefs = 0

Definition at line 68 of file header.hpp.

◆ noEffectDoodad

std::array<std::uint8_t, 8> wowlib::formats::adt::chunks::SMChunk::noEffectDoodad {}

An 8x8 bitfield (8 bytes): 1 disables detail doodads in that sub-cell (WoD may store it as an explicit MCDD chunk).

Definition at line 79 of file header.hpp.

◆ nSndEmitters

std::uint32_t wowlib::formats::adt::chunks::SMChunk::nSndEmitters = 0

Definition at line 82 of file header.hpp.

◆ ofsAlpha

std::uint32_t wowlib::formats::adt::chunks::SMChunk::ofsAlpha = 0

Definition at line 60 of file header.hpp.

◆ ofsHeight

std::uint32_t wowlib::formats::adt::chunks::SMChunk::ofsHeight = 0

Definition at line 56 of file header.hpp.

Referenced by holesHighRes(), and setHolesHighRes().

◆ ofsLayer

std::uint32_t wowlib::formats::adt::chunks::SMChunk::ofsLayer = 0

Definition at line 58 of file header.hpp.

◆ ofsLiquid

std::uint32_t wowlib::formats::adt::chunks::SMChunk::ofsLiquid = 0

Definition at line 83 of file header.hpp.

◆ ofsMccv

std::uint32_t wowlib::formats::adt::chunks::SMChunk::ofsMccv = 0

Definition at line 89 of file header.hpp.

◆ ofsMclv

std::uint32_t wowlib::formats::adt::chunks::SMChunk::ofsMclv = 0

Definition at line 90 of file header.hpp.

◆ ofsNormal

std::uint32_t wowlib::formats::adt::chunks::SMChunk::ofsNormal = 0

Definition at line 57 of file header.hpp.

Referenced by holesHighRes(), and setHolesHighRes().

◆ ofsRefs

std::uint32_t wowlib::formats::adt::chunks::SMChunk::ofsRefs = 0

Definition at line 59 of file header.hpp.

◆ ofsShadow

std::uint32_t wowlib::formats::adt::chunks::SMChunk::ofsShadow = 0

Definition at line 62 of file header.hpp.

◆ ofsSndEmitters

std::uint32_t wowlib::formats::adt::chunks::SMChunk::ofsSndEmitters = 0

Definition at line 81 of file header.hpp.

◆ position

C3Vector wowlib::formats::adt::chunks::SMChunk::position {}

The cell origin in world space; MCVT heights are relative to it.

Definition at line 87 of file header.hpp.

◆ predominantTexture

std::array<std::uint8_t, 16> wowlib::formats::adt::chunks::SMChunk::predominantTexture {}

Definition at line 76 of file header.hpp.

◆ sizeAlpha

std::uint32_t wowlib::formats::adt::chunks::SMChunk::sizeAlpha = 0

Definition at line 61 of file header.hpp.

◆ sizeLiquid

std::uint32_t wowlib::formats::adt::chunks::SMChunk::sizeLiquid = 0

Definition at line 84 of file header.hpp.

◆ sizeShadow

std::uint32_t wowlib::formats::adt::chunks::SMChunk::sizeShadow = 0

Definition at line 63 of file header.hpp.

◆ unknownButUsed

std::uint16_t wowlib::formats::adt::chunks::SMChunk::unknownButUsed = 0

Unknown but written (padding in the alpha clients).

Definition at line 74 of file header.hpp.

◆ unused

std::uint32_t wowlib::formats::adt::chunks::SMChunk::unused = 0

Definition at line 91 of file header.hpp.


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