Class ADTVanilla
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 ADTVanilla : ADT, IDisposable
- Inheritance
-
ADTVanilla
- Implements
- Inherited Members
Constructors
ADTVanilla()
public ADTVanilla()
ADTVanilla(ADTVanilla)
Copy-construct: a deep copy of other (the C++ copy constructor).
public ADTVanilla(ADTVanilla other)
Parameters
otherADTVanilla
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
Chunks
The 256 terrain chunks (MCNK), row-major (index = y * 16 + x).
public Vector<MapChunkVanillaToTbc> Chunks { get; }
Property Value
DoodadPlacements
Doodad (M2) placements on this tile (MDDF).
public Vector<SmDoodadDef> DoodadPlacements { get; }
Property Value
Header
The tile header (MHDR): flags; the chunk offsets are derived.
public MHDRData Header { get; set; }
Property Value
ModelFilenames
The M2 model filenames (MMDX) placements reference by MMID index.
public StringBlock ModelFilenames { get; }
Property Value
ModelNameOffsets
Byte offsets into model_filenames (MMID): a doodad placement's name_id indexes this list.
public Vector<uint> ModelNameOffsets { get; }
Property Value
Mver
The ADT format version (MVER); 18 for every supported client.
public uint Mver { get; set; }
Property Value
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
WmoFilenames
The WMO filenames (MWMO) placements reference by MWID index.
public StringBlock WmoFilenames { get; }
Property Value
WmoNameOffsets
Byte offsets into wmo_filenames (MWID): a WMO placement's name_id indexes this list.
public Vector<uint> WmoNameOffsets { get; }
Property Value
WmoPlacements
WMO placements on this tile (MODF).
public Vector<SmMapObjDef> WmoPlacements { get; }
Property Value
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
fsFileSystemthe filesystem gateway
keyFileKeythe tile identity (root .adt path and/or FileDataID)
alphaAlphaFormatthe 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
fsFileSystemthe filesystem gateway
keyFileKeythe tile identity; must resolve to a path
alphaAlphaFormatthe on-disk alpha-map bit depth to encode