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: PathBufRoot 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
impl SplitFileSet
Sourcepub fn discover(root_path: impl AsRef<Path>) -> Self
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.
Sourcepub fn verify_existence(&self) -> SplitFilePresence
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");
}Sourcepub fn present_files(&self) -> Vec<&PathBuf>
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 + lodSourcepub fn is_complete_cataclysm_set(&self) -> bool
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
impl Clone for SplitFileSet
Source§fn clone(&self) -> SplitFileSet
fn clone(&self) -> SplitFileSet
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SplitFileSet
impl Debug for SplitFileSet
impl Eq for SplitFileSet
Source§impl PartialEq for SplitFileSet
impl PartialEq for SplitFileSet
Source§fn eq(&self, other: &SplitFileSet) -> bool
fn eq(&self, other: &SplitFileSet) -> bool
self and other values to be equal, and is used by ==.