diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/assetbundle.rs | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/assetbundle.rs b/src/assetbundle.rs index f87d7b8..3940628 100644 --- a/src/assetbundle.rs +++ b/src/assetbundle.rs @@ -77,7 +77,13 @@ impl<T: Read + Seek + 'static> AssetBundle<T> { let main_obs = main .objects .iter() - .map(|o| (main.ecx.clone(), o.to_owned())) + .map(|o| { + ( + main.ecx.clone(), + main.get_object_type_tree(o).unwrap().type_string.to_owned(), + o.to_owned(), + ) + }) .collect::<Vec<_>>(); let shared_obs = if let Some(shared_assets) = shared_assets { let shared = self.get_fs_file(&shared_assets).unwrap(); @@ -85,7 +91,17 @@ impl<T: Read + Seek + 'static> AssetBundle<T> { shared .objects .iter() - .map(|o| (shared.ecx.clone(), o.to_owned())) + .map(|o| { + ( + shared.ecx.clone(), + shared + .get_object_type_tree(o) + .unwrap() + .type_string + .to_owned(), + o.to_owned(), + ) + }) .collect() } else { Vec::new() @@ -94,8 +110,8 @@ impl<T: Read + Seek + 'static> AssetBundle<T> { main_obs .into_iter() .chain(shared_obs) - .map(|(ecx, o)| PPtr { - class: "".to_string(), + .map(|(ecx, class, o)| PPtr { + class, ecx, file_id: 0, path_id: o.path_id, @@ -127,7 +143,7 @@ impl<T: Read + Seek + 'static> AssetBundle<T> { .into_iter() .chain(shared_obs) .map(|(ecx, o)| PPtr { - class: "".to_string(), + class: class_name.to_owned(), ecx, file_id: 0, path_id: o.path_id, |