Skip to main content

SplitFileSet

Struct SplitFileSet 

Source
pub struct SplitFileSet {
    pub root: PathBuf,
    pub tex0: Option<PathBuf>,
    pub tex1: Option<PathBuf>,
    pub obj0: Option<PathBuf>,
    pub obj1: Option<PathBuf>,
    pub lod: Option<PathBuf>,
}
Expand description

Complete set of split ADT files for a single map tile.

Represents all the files that make up a Cataclysm+ ADT tile. Not all files may be present - use verify_existence to check which files actually exist.

§File Responsibilities

  • root: Terrain geometry (heightmaps, normals, water)
  • tex0: Primary texture data (texture list, layers, alpha maps)
  • tex1: Additional texture data (deprecated in BfA+)
  • obj0: Primary object placements (M2 models, WMO buildings)
  • obj1: Additional object placements
  • lod: Low-detail geometry for distant rendering (Legion+)

§Discovery

Use SplitFileSet::discover to automatically derive all split file paths from a root ADT path:

use std::path::{Path, PathBuf};
use wow_adt::split_set::SplitFileSet;

let root = Path::new("Azeroth_30_30.adt");
let set = SplitFileSet::discover(root);

assert_eq!(
    set.tex0,
    Some(PathBuf::from("Azeroth_30_30_tex0.adt"))
);

Fields§

§root: PathBuf

Root ADT file path (terrain geometry).

This is the base file - always present for all WoW versions.

§tex0: Option<PathBuf>

Primary texture file path (_tex0.adt).

Contains MTEX, MCLY, MCAL chunks. Expected for Cataclysm+ split files.

§tex1: Option<PathBuf>

Secondary texture file path (_tex1.adt).

Contains additional texture data. Deprecated in Battle for Azeroth (8.x+). May be None even for Cataclysm-Legion if not used.

§obj0: Option<PathBuf>

Primary object file path (_obj0.adt).

Contains MMDX, MWMO, MDDF, MODF chunks. Expected for Cataclysm+ split files.

§obj1: Option<PathBuf>

Secondary object file path (_obj1.adt).

Contains additional object placements. May be None if tile has few objects.

§lod: Option<PathBuf>

LOD file path (_lod.adt).

Contains low-detail geometry for distant rendering. Legion (7.x+) only. May be None for Cataclysm-WoD tiles.

Implementations§

Source§

impl SplitFileSet

Source

pub fn discover(root_path: impl AsRef<Path>) -> Self

Discover split file paths from a root ADT path.

Given a root ADT file path (ending in .adt), this method derives the expected paths for all associated split files by replacing the extension with the appropriate suffix.

§Arguments
  • root_path - Path to the root ADT file (e.g., “Azeroth_30_30.adt”)
§Returns

A SplitFileSet with all potential file paths. Use verify_existence to check which files actually exist.

§Examples
use std::path::{Path, PathBuf};
use wow_adt::split_set::SplitFileSet;

let root = Path::new("World/Maps/Azeroth/Azeroth_30_30.adt");
let set = SplitFileSet::discover(root);

assert_eq!(set.root, PathBuf::from("World/Maps/Azeroth/Azeroth_30_30.adt"));
assert_eq!(
    set.tex0,
    Some(PathBuf::from("World/Maps/Azeroth/Azeroth_30_30_tex0.adt"))
);
assert_eq!(
    set.obj0,
    Some(PathBuf::from("World/Maps/Azeroth/Azeroth_30_30_obj0.adt"))
);
§Panics

Panics if the root path has no parent directory or no file stem.

Source

pub fn verify_existence(&self) -> SplitFilePresence

Check which split files actually exist on the filesystem.

This method tests each file path in the set to determine which files are present. Useful for determining if a complete set exists before attempting to load.

§Returns

A SplitFilePresence struct indicating which files exist.

§Examples
use std::path::Path;
use wow_adt::split_set::SplitFileSet;

let set = SplitFileSet::discover("Azeroth_30_30.adt");
let presence = set.verify_existence();

if presence.has_root && presence.has_tex0 && presence.has_obj0 {
    println!("Complete Cataclysm ADT set found!");
} else if presence.has_root && !presence.has_tex0 {
    println!("Pre-Cataclysm monolithic ADT file");
} else {
    println!("Incomplete split file set");
}
Source

pub fn present_files(&self) -> Vec<&PathBuf>

Get a vector of all file paths that are present (non-None).

This returns paths regardless of whether they exist on disk. Use verify_existence to filter to only existing files.

§Returns

Vector of references to all non-None file paths in the set.

§Examples
use std::path::Path;
use wow_adt::split_set::SplitFileSet;

let set = SplitFileSet::discover("Azeroth_30_30.adt");
let paths = set.present_files();

// All paths are present (including root)
assert_eq!(paths.len(), 6); // root + tex0 + tex1 + obj0 + obj1 + lod
Source

pub fn is_complete_cataclysm_set(&self) -> bool

Check if this represents a complete Cataclysm+ split file set.

A complete set requires root, tex0, and obj0 files to exist. tex1, obj1, and lod are optional.

§Returns

true if root, tex0, and obj0 files exist.

§Examples
use std::path::Path;
use wow_adt::split_set::SplitFileSet;

let set = SplitFileSet::discover("Azeroth_30_30.adt");

if set.is_complete_cataclysm_set() {
    println!("Complete Cataclysm+ ADT tile");
} else {
    println!("Incomplete or pre-Cataclysm tile");
}

Trait Implementations§

Source§

impl Clone for SplitFileSet

Source§

fn clone(&self) -> SplitFileSet

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SplitFileSet

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for SplitFileSet

Source§

impl PartialEq for SplitFileSet

Source§

fn eq(&self, other: &SplitFileSet) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for SplitFileSet

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.