diff options
Diffstat (limited to 'engine/src/model.rs')
| -rw-r--r-- | engine/src/model.rs | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/engine/src/model.rs b/engine/src/model.rs index c231a9f..62cfe21 100644 --- a/engine/src/model.rs +++ b/engine/src/model.rs @@ -20,9 +20,11 @@ pub struct Model {} impl Asset for Model { - fn dependencies(&self) -> impl Iterator<Item = AssetDependency<'_>> + fn visit_dependencies<'this>( + &'this self, + _func: &mut dyn FnMut(crate::asset::Dependency<'this>), + ) { - [].into_iter() } } @@ -67,14 +69,14 @@ impl MaterialDescription impl Asset for MaterialDescription { - fn dependencies(&self) -> impl Iterator<Item = AssetDependency<'_>> + fn visit_dependencies<'this>( + &'this self, + func: &mut dyn FnMut(AssetDependency<'this>), + ) { - self.loading_material.iter().map(|material_label| { - AssetDependency::new::<Material>(AssetLabel { - path: (&*material_label.path).into(), - name: material_label.name.as_deref().map(Into::into), - }) - }) + if let Some(material_label) = &self.loading_material { + func(AssetDependency::new::<Material>(material_label.borrow())); + } } } |
