Table of Contents

Class MapChunkWotlk

Namespace
WoWLib.Formats.ADT
Assembly
WoWLib.dll

One terrain chunk (MCNK) of a map tile, fully decoded: the chunk header, the 9x9+8x8 height and normal grids, the texture layers with their decoded 64x64 alpha maps, the shadow map, doodad/object references, sound emitters and (version dependent) vertex colors, baked lighting and legacy liquid. A tile has 256 of these. wowlib decodes alpha/shadow maps to a plain 64x64 edit surface and re-encodes on write; the round-trip is semantic, not byte-identical. See https://wowdev.wiki/ADT/v18#MCNK_chunk.

public class MapChunkWotlk : MapChunk, IDisposable
Inheritance
MapChunkWotlk
Implements
Inherited Members

Constructors

MapChunkWotlk()

public MapChunkWotlk()

MapChunkWotlk(MapChunkWotlk)

Copy-construct: a deep copy of other (the C++ copy constructor).

public MapChunkWotlk(MapChunkWotlk other)

Parameters

other MapChunkWotlk

Properties

AlphaMaps

One decoded 64x64 (4096-byte) alpha map per layer, aligned with layers (layer 0's is empty); 0 = base texture, 255 = this layer.

public Vector<Vector<byte>> AlphaMaps { get; }

Property Value

Vector<Vector<byte>>

DoodadRefs

Doodad references (MCRF doodad part pre-Cata, MCRD Cata+): indices into the tile's MDDF placements drawn in this chunk.

public Vector<uint> DoodadRefs { get; }

Property Value

Vector<uint>

Header

The chunk header (flags, grid position, area, holes, origin).

public SMChunk Header { get; set; }

Property Value

SMChunk

Heights

The 9x9 + 8x8 = 145 terrain heights (MCVT), relative to the chunk origin, in the interleaved outer/inner row order.

public Vector<float> Heights { get; }

Property Value

Vector<float>

Layers

The texture layers (MCLY); layer 0 is opaque, later layers blend through their alpha map.

public Vector<SMLayer> Layers { get; }

Property Value

Vector<SMLayer>

LegacyLiquid

The legacy per-chunk liquid (MCLQ, up to and including WotLK).

public MclqData LegacyLiquid { get; set; }

Property Value

MclqData

Normals

The 145 terrain normals (MCNR), X Z Y signed bytes.

public Vector<McnrEntry> Normals { get; }

Property Value

Vector<McnrEntry>

ObjectRefs

Object references (MCRF object part pre-Cata, MCRW Cata+): indices into the tile's MODF placements drawn in this chunk.

public Vector<uint> ObjectRefs { get; }

Property Value

Vector<uint>

ShadowMap

The decoded 64x64 (4096-byte) shadow map (MCSH), 0/1 per texel; empty when the chunk casts no baked shadow.

public Vector<byte> ShadowMap { get; }

Property Value

Vector<byte>

SoundEmitters

Sound emitters placed in this chunk (MCSE): pre-WotLK versions carry the full 52-byte inline emitter (CWSoundEmitterVanilla), WotLK+ the 28-byte SoundEntriesAdvanced reference (CWSoundEmitter).

public Vector<CwSoundEmitter> SoundEmitters { get; }

Property Value

Vector<CwSoundEmitter>

VertexColors

Per-vertex colors (MCCV, WotLK+): 145 BGRA entries blended onto the terrain (0x7F = neutral).

public Vector<CImVector> VertexColors { get; }

Property Value

Vector<CImVector>

Methods

Dispose()

Release the native object now. Optional: the finalizer releases it on collection anyway - dispose (or using) when you want native memory back promptly.

public override void Dispose()