Class ADTBfaPlus
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 ADTBfaPlus : ADT, IDisposable
- Inheritance
-
ADTBfaPlus
- Implements
- Inherited Members
Constructors
ADTBfaPlus()
public ADTBfaPlus()
ADTBfaPlus(ADTBfaPlus)
Copy-construct: a deep copy of other (the C++ copy constructor).
public ADTBfaPlus(ADTBfaPlus other)
Parameters
otherADTBfaPlus
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<MapChunkCataPlus> Chunks { get; }
Property Value
DiffuseTextureIds
Diffuse-texture FileDataIDs (MDID, 8.1+): the _s.blp tileset textures MapChunk layers index, in place of MTEX names.
public Vector<uint> DiffuseTextureIds { get; }
Property Value
DoodadPlacements
Doodad (M2) placements on this tile (MDDF).
public Vector<SmDoodadDef> DoodadPlacements { get; }
Property Value
FlyingBounds
The flying bounds (MFBO, BC+); engaged by the header has_mfbo flag.
public MfboPlanes FlyingBounds { get; set; }
Property Value
Header
The tile header (MHDR): flags; the chunk offsets are derived.
public MHDRData Header { get; set; }
Property Value
HeightTextureIds
Height-texture FileDataIDs (MHID, 8.1+): the _h.blp map paired with each diffuse texture (0 for none).
public Vector<uint> HeightTextureIds { get; }
Property Value
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
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
TextureFlags
Per-texture flags (MTXF, WotLK+): one entry per MTEX texture.
public Vector<SMTextureFlags> TextureFlags { get; }
Property Value
TextureParams
Height-blend texture parameters (MTXP, MoP+): one per texture.
public Vector<SMTextureParams> TextureParams { get; }
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
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
Water
The tile's water (MH2O, WotLK+): one liquid entry per chunk.
public Mh2OData Water { get; set; }
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