Table of Contents

Class WDL

Namespace
WoWLib.Formats.WDL
Assembly
WoWLib.dll

A map's low-resolution heightmap file, abstract over the client version — the background mountain silhouettes. Construct the concrete version with WDL.for_version(expansion), then read()/write(); the per-version WDL* classes are subclasses. See https://wowdev.wiki/WDL.

public class WDL : FileEntity, IDisposable
Inheritance
WDL
Implements
Derived
Inherited Members

Constructors

WDL()

public WDL()

WDL(WDL)

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

public WDL(WDL other)

Parameters

other WDL

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>

Mver

The WDL format version; 18 for every supported client.

public uint Mver { get; set; }

Property Value

uint

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

ForVersion(ClientVersion)

A fresh WDL for an exact client version — the only axis that can name a Classic client, whose files follow the engine its build was cut on rather than its 1.15 / 4.4 version number.

public static WDL ForVersion(ClientVersion version)

Parameters

version ClientVersion

Returns

WDL

ForVersion(Expansion)

A fresh WDL for the given era, as the family base — the dynamic twin of the typed Era factories.

public static WDL ForVersion(Expansion era)

Parameters

era Expansion

Returns

WDL

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[]

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[]

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
key FileKey

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

Write()

Serialize this entity.

public byte[] Write()

Returns

byte[]

Write(FileSystem, FileKey)

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

public void Write(FileSystem fs, FileKey key)

Parameters

fs FileSystem
key FileKey