summaryrefslogtreecommitdiff
path: root/engine/src/material.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2026-10-21 09:12:45 +0200
committerHampusM <hampus@hampusmat.com>2026-10-21 09:12:45 +0200
commite35751554ac82f5f0af02e9690458f0953e09380 (patch)
treeb0d7cdccdc89ee06d38410e5f651db21acba4c28 /engine/src/material.rs
parent7c55cefc6b7b1da19b2bbe7f43daaba4f816f27d (diff)
refactor(engine): replace Asset::dependencies fn with visit_dependencies fnHEADmaster
Diffstat (limited to 'engine/src/material.rs')
-rw-r--r--engine/src/material.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/engine/src/material.rs b/engine/src/material.rs
index ae0751b..ded30a2 100644
--- a/engine/src/material.rs
+++ b/engine/src/material.rs
@@ -57,14 +57,14 @@ impl Default for Material
impl Asset for Material
{
- fn dependencies(&self) -> impl Iterator<Item = AssetDependency<'_>>
+ fn visit_dependencies<'this>(
+ &'this self,
+ func: &mut dyn FnMut(AssetDependency<'this>),
+ )
{
- self.loading_textures.iter().map(|(_, texture_label)| {
- AssetDependency::new::<Texture>(AssetLabel {
- path: (&*texture_label.path).into(),
- name: texture_label.name.as_deref().map(Into::into),
- })
- })
+ for (_, texture_label) in &self.loading_textures {
+ func(AssetDependency::new::<Texture>(texture_label.borrow()));
+ }
}
}