diff options
| author | HampusM <hampus@hampusmat.com> | 2026-10-21 09:12:45 +0200 |
|---|---|---|
| committer | HampusM <hampus@hampusmat.com> | 2026-10-21 09:12:45 +0200 |
| commit | e35751554ac82f5f0af02e9690458f0953e09380 (patch) | |
| tree | b0d7cdccdc89ee06d38410e5f651db21acba4c28 /engine/src/model.rs | |
| parent | 7c55cefc6b7b1da19b2bbe7f43daaba4f816f27d (diff) | |
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())); + } } } |
