Table of Contents

Class ADTCataToLegion

Namespace
WoWLib.Formats.ADT
Assembly
WoWLib.dll

A terrain map tile for one client version: the 256 terrain chunks plus the tile-wide texture, model and placement tables, unified across the split ADT files the tile is stored in. Adding a texture, model or placement does not depend on which file it lands in — the writer routes it. An instance read from a client and left unmodified rewrites to a semantically equal tile (alpha maps and offset tables are re-derived, not byte-preserved). See https://wowdev.wiki/ADT/v18.

public class ADTCataToLegion : ADT, IDisposable
Inheritance
ADTCataToLegion
Implements
Inherited Members

Constructors

ADTCataToLegion()

public ADTCataToLegion()

ADTCataToLegion(ADTCataToLegion)

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

public ADTCataToLegion(ADTCataToLegion other)

Parameters

other ADTCataToLegion

Properties

AlphaFormat

How this tile's alpha maps were laid out on disk, recorded from the AlphaFormat passed to read(); write() takes its own explicit argument. wowlib always presents decoded 64x64 maps.

public AlphaFormat AlphaFormat { get; set; }

Property Value

AlphaFormat

Chunks

The 256 terrain chunks (MCNK), row-major (index = y * 16 + x).

public Vector<MapChunkCataPlus> Chunks { get; }

Property Value

Vector<MapChunkCataPlus>

DoodadPlacements

Doodad (M2) placements on this tile (MDDF).

public Vector<SmDoodadDef> DoodadPlacements { get; }

Property Value

Vector<SmDoodadDef>

FlyingBounds

The flying bounds (MFBO, BC+); engaged by the header has_mfbo flag.

public MfboPlanes FlyingBounds { get; set; }

Property Value

MfboPlanes

Header

The tile header (MHDR): flags; the chunk offsets are derived.

public MHDRData Header { get; set; }

Property Value

MHDRData

Mamp

The MAMP alpha-map downscale value (Cata+): overrides the MHDR inline value; alpha texture size is 64 / (2^value).

public uint Mamp { get; set; }

Property Value

uint

ModelFilenames

The M2 model filenames (MMDX) placements reference by MMID index.

public StringBlock ModelFilenames { get; }

Property Value

StringBlock

ModelNameOffsets

Byte offsets into model_filenames (MMID): a doodad placement's name_id indexes this list.

public Vector<uint> ModelNameOffsets { get; }

Property Value

Vector<uint>

Mver

The ADT format version (MVER); 18 for every supported client.

public uint Mver { get; set; }

Property Value

uint

TextureFlags

Per-texture flags (MTXF, WotLK+): one entry per MTEX texture.

public Vector<SMTextureFlags> TextureFlags { get; }

Property Value

Vector<SMTextureFlags>

TextureParams

Height-blend texture parameters (MTXP, MoP+): one per texture.

public Vector<SMTextureParams> TextureParams { get; }

Property Value

Vector<SMTextureParams>

Textures

The tileset texture filenames (MTEX): the paths MapChunk layers index. Present unless the tile uses MDID/MHID FileDataIDs (8.1+ height-texturing maps).

public StringBlock Textures { get; }

Property Value

StringBlock

UsesTextureFdids

Whether this tile stores its textures as MDID/MHID FileDataIDs (8.1+ height-texturing maps) rather than MTEX names; set from the chunk present on read and honored on write.

public bool UsesTextureFdids { get; set; }

Property Value

bool

Water

The tile's water (MH2O, WotLK+): one liquid entry per chunk.

public Mh2OData Water { get; set; }

Property Value

Mh2OData

WmoFilenames

The WMO filenames (MWMO) placements reference by MWID index.

public StringBlock WmoFilenames { get; }

Property Value

StringBlock

WmoNameOffsets

Byte offsets into wmo_filenames (MWID): a WMO placement's name_id indexes this list.

public Vector<uint> WmoNameOffsets { get; }

Property Value

Vector<uint>

WmoPlacements

WMO placements on this tile (MODF).

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

Read(FileSystem, FileKey, AlphaFormat)

Load the tile — every split file present — from a client filesystem, replacing this entity's contents. The alpha-map bit depth (from the map's WDT) is supplied by the caller.

public void Read(FileSystem fs, FileKey key, AlphaFormat alpha)

Parameters

fs FileSystem

the filesystem gateway

key FileKey

the tile identity (root .adt path and/or FileDataID)

alpha AlphaFormat

the on-disk alpha-map bit depth for this tile's map (from its WDT MPHD flags)

Validate()

Check the logical integrity contracts this tile must satisfy to LOAD in the client — across every terrain chunk AND the tile-wide tables — which write() deliberately never enforces. Call it before writing when you want to know the tile will load. A tile 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, each with its member path ("chunks[i]...")

Write(FileSystem, FileKey, AlphaFormat)

Serialize the tile (and, Cata+, every split file) through the filesystem's project overlay; the file names derive from the key, which must resolve to a path. The alpha-map bit depth to encode is supplied by the caller.

public void Write(FileSystem fs, FileKey key, AlphaFormat alpha)

Parameters

fs FileSystem

the filesystem gateway

key FileKey

the tile identity; must resolve to a path

alpha AlphaFormat

the on-disk alpha-map bit depth to encode