Table of Contents

Class WDLTbcToWod

Namespace
WoWLib.Formats.WDL
Assembly
WoWLib.dll

A map's low-resolution heightmap file for one client version: the 64x64 tile offset table, one 17x17+16x16 int16 heightmap (and hole mask) per present tile, the low-resolution object placements of the era, and the Shadowlands+ sky scenes. Tile chunks pair by ordinal — the i-th heightmap belongs to the i-th nonzero tileOffsets slot (row-major); the offsets themselves are recomputed on every write, so only the nonzero pattern is authored data. An instance read from a client file rewrites byte-for-byte until modified. See https://wowdev.wiki/WDL.

public class WDLTbcToWod : WDL, IDisposable
Inheritance
WDLTbcToWod
Implements
Inherited Members

Constructors

WDLTbcToWod()

public WDLTbcToWod()

WDLTbcToWod(WDLTbcToWod)

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

public WDLTbcToWod(WDLTbcToWod other)

Parameters

other WDLTbcToWod

Properties

Heightmaps

The per-tile heightmaps (MARE), one per nonzero tileOffsets slot, in row-major slot order.

public Vector<TileHeights> Heightmaps { get; }

Property Value

Vector<TileHeights>

Holes

Per-tile hole masks (MAHO, TBC+): the i-th mask belongs to the i-th heightmap. Blizzard writes one per tile even when all zero; hole masks are all-or-nothing — leave the list empty or give every heightmap its mask. (wowdev.wiki dates MAHO to WotLK, but vanilla WDLs carry none and every 2.4.3 WDL pairs one MAHO per MARE — so it debuts in TBC.)

public Vector<TileHoles> Holes { get; }

Property Value

Vector<TileHoles>

Mver

The WDL format version; 18 for every supported client.

public uint Mver { get; set; }

Property Value

uint

OcclusionMeshes

Per-tile occlusion mesh vertices (MAOC, pre-Legion; optional and absent from every surveyed file), one record per occurrence, kept opaque. Follows its tile's heightmap in the stream.

public Vector<ChunkBlob> OcclusionMeshes { get; set; }

Property Value

Vector<ChunkBlob>

TileOffsets

The tile offset table (MAOF): 64 x 64 absolute file offsets in row-major order (y outer, x inner), 0 for absent tiles. The offset VALUES are derived — every write restamps them from the finished layout — so only the nonzero pattern is authored: the i-th nonzero slot owns the i-th heightmap.

public Vector<uint> TileOffsets { get; }

Property Value

Vector<uint>

WmoFilenameOffsets

MWMO filename start offsets (MWID), one per name.

public Vector<uint> WmoFilenameOffsets { get; }

Property Value

Vector<uint>

WmoFilenames

WMO silhouette filenames (MWMO): zero-terminated strings, referenced by offset. Every pre-Legion file carries the chunk (often empty); Legion+ terrain maps replace the object set with the MLDD/MLMD placements, but WMO-only maps keep shipping it.

public StringBlock WmoFilenames { get; set; }

Property Value

StringBlock

WmoPlacements

WMO silhouette placements (MODF), one per MWMO name; the same 64-byte record the WDT and ADT use.

public Vector<SmMapObjDef> WmoPlacements { get; }

Property Value

Vector<SmMapObjDef>

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()

EnsureValid()

Validate and raise on the first error instead of returning a report — the assert-style face of validate().

public void EnsureValid()

OceanMaskTiles()

The heightmap ordinal each ocean mask belongs to (parallel to oceanMasks), derived from the read file's chunk interleave. Empty when there are no ocean masks.

public uint[] OceanMaskTiles()

Returns

uint[]

one heightmap ordinal per ocean mask

Read(byte[])

Deserialize file bytes into this entity, replacing its contents. Unmodeled chunks are preserved so an unmodified entity rewrites byte-for-byte.

public void Read(byte[] data)

Parameters

data byte[]

the file bytes

Read(FileSystem, FileKey)

Load the WDL from a client filesystem, replacing this entity's contents.

public void Read(FileSystem fs, FileKey key)

Parameters

fs FileSystem

the filesystem gateway

key FileKey

the file identity (path and/or FileDataID)

Validate()

Check the logical integrity contracts this file must satisfy to LOAD in the client — companion-chunk counts, index ranges, flag/presence coherence — which write() deliberately never enforces. Call it before writing when you want to know the result will load. A file read from a client and left unmodified reports no errors; warnings mark states real client files ship.

public ValidationReport Validate()

Returns

ValidationReport

every violated contract, in member order

Write()

Serialize this entity.

public byte[] Write()

Returns

byte[]

the file bytes

Write(FileSystem, FileKey)

Serialize and store the WDL through the filesystem's project overlay.

public void Write(FileSystem fs, FileKey key)

Parameters

fs FileSystem

the filesystem gateway

key FileKey

the file identity; must resolve to a path