mirror of
https://github.com/Theaninova/mhlib.git
synced 2025-12-12 20:46:20 +00:00
add lightwave parser
This commit is contained in:
@@ -8,3 +8,4 @@ edition = "2021"
|
||||
[dependencies]
|
||||
starforcelib = {path = "../starforcelib"}
|
||||
lightwave = {path = "../lightwave"}
|
||||
glob = "0.3.1"
|
||||
|
||||
@@ -1,6 +1,24 @@
|
||||
use glob::glob;
|
||||
use lightwave::LightWaveObject;
|
||||
|
||||
fn main() {
|
||||
let obj = LightWaveObject::read_file("E:\\Games\\Moorhuhn Kart 3\\extract\\D\\Moorhuhnkart\\3dobjects_tracks\\track04_robinhood\\colreset.lwo").unwrap();
|
||||
println!("{:#?}", obj);
|
||||
let mut successful = 0;
|
||||
let mut failed = 0;
|
||||
|
||||
for entry in glob("E:/Games/Moorhuhn Kart 3/extract/**/*.lwo").unwrap() {
|
||||
let path = entry.unwrap();
|
||||
println!("{:?}", path.display());
|
||||
match LightWaveObject::read_file(path) {
|
||||
Ok(_) => {
|
||||
successful += 1;
|
||||
println!("...Ok")
|
||||
}
|
||||
Err(err) => {
|
||||
failed += 1;
|
||||
eprintln!("{:?}", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
println!("Successful: {}\nFailed: {}", successful, failed);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user