Directory Loading
Added the ability to parse the directory and store it in a Directory struct. This data has utility functions that can be used to work with the directory to find any lump we could need. This patch should fix up issue #3.
This commit is contained in:
23
src/main.rs
23
src/main.rs
@@ -9,10 +9,29 @@ fn main() {
|
||||
Header:
|
||||
Identifier: {}
|
||||
Lump Count: {}
|
||||
Initial Offset: {}",
|
||||
Initial Offset: {}
|
||||
Number of Found Lumps: {}",
|
||||
wadutils::get_wad_path(&wad_file),
|
||||
wadutils::get_wad_type(&wad_file),
|
||||
wadutils::get_num_lumps(&wad_file),
|
||||
wadutils::get_init_offset(&wad_file)
|
||||
wadutils::get_init_offset(&wad_file),
|
||||
wadutils::get_directory_len(&wad_file)
|
||||
);
|
||||
|
||||
println!("First 15 Directory Entries:");
|
||||
|
||||
for i in 0..15 {
|
||||
println!(
|
||||
"\t{}\tName {}\tPosition {}\tSize {}",
|
||||
i,
|
||||
wadutils::get_lump_name(&wad_file, i),
|
||||
wadutils::get_lump_offset(&wad_file, i),
|
||||
wadutils::get_lump_size(&wad_file, i)
|
||||
);
|
||||
}
|
||||
|
||||
println!(
|
||||
"Index of e1m1 is: {}",
|
||||
wadutils::get_index_from_name(&wad_file, "e1m1").unwrap()
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user