aboutsummaryrefslogtreecommitdiff
path: root/src/bin/parse.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/parse.rs')
-rw-r--r--src/bin/parse.rs31
1 files changed, 30 insertions, 1 deletions
diff --git a/src/bin/parse.rs b/src/bin/parse.rs
index c0cb0e5..273cffd 100644
--- a/src/bin/parse.rs
+++ b/src/bin/parse.rs
@@ -4,7 +4,11 @@ use std::{
fs::File,
io::{BufReader, Read, Seek, SeekFrom},
};
-use unity_tools::{object::read_value, serialized_file::read_serialized_file, unityfs::UnityFS};
+use unity_tools::{
+ object::{Value, read_value},
+ serialized_file::{TypeTreeNode, read_serialized_file},
+ unityfs::UnityFS,
+};
fn main() -> anyhow::Result<()> {
env_logger::init_from_env("LOG");
@@ -36,10 +40,35 @@ fn main() -> anyhow::Result<()> {
// .expect("unknown type")
&file.types[ob.type_id as usize]
};
+ // fn print_types(tt: &TypeTreeNode) {
+ // println!("{}", tt.type_string);
+ // for c in &tt.children {
+ // print_types(&c);
+ // }
+ // }
+ // fn print_crit_types(tt: &TypeTreeNode) {
+ // let mut crit = tt.byte_size == -1;
+ // for c in &tt.children {
+ // print_crit_types(&c);
+ // crit &= c.byte_size != -1
+ // }
+ // if crit {
+ // println!("{}", tt.type_string);
+ // }
+ // }
+ if let Some(tree) = &typetree.type_tree {
+ println!("{}", tree.type_string);
+ // print_crit_types(tree);
+ // print_types(tree);
+ }
// eprintln!("{typetree:#?}");
let value = read_value(typetree.type_tree.as_ref().unwrap(), e, &mut cab)?;
+ // if let Value::Object { class, .. } = &value {
+ // println!("{class}")
+ // }
+
debug!(
"{}",
serde_json::to_string_pretty(&value.to_json()).unwrap()