kitgit

tirbofish/dropbear · commit

51bd99fb844aa18e8e4fceb86572a8f2cfa714bb

asset server

Unverified

tk <4tkbytes@pm.me> · 2025-11-01 11:44

view full diff

diff --git a/Cargo.toml b/Cargo.toml
index 52e9f71..03a7d19 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -60,6 +60,7 @@ libloading = "0.8"
 indexmap = "2.11"
 sha2 = "0.10"
 wesl = "0.2"
+dashmap = "6.1"
 
 [workspace.dependencies.image]
 version = "0.25"
diff --git a/dropbear-engine/Cargo.toml b/dropbear-engine/Cargo.toml
index 78ec532..d9dc7a5 100644
--- a/dropbear-engine/Cargo.toml
+++ b/dropbear-engine/Cargo.toml
@@ -39,6 +39,7 @@ backtrace.workspace = true
 os_info.workspace = true
 rustc_version_runtime.workspace = true
 ron.workspace = true
+dashmap.workspace = true
 
 [target.'cfg(not(target_os = "android"))'.dependencies]
 rfd.workspace = true
diff --git a/dropbear-engine/src/asset.rs b/dropbear-engine/src/asset.rs
new file mode 100644
index 0000000..d9d5912
--- /dev/null
+++ b/dropbear-engine/src/asset.rs
@@ -0,0 +1,74 @@
+use std::sync::Arc;
+
+use dashmap::DashMap;
+
+use crate::model::{Material, MaterialComponent, Mesh, MeshComponent};
+
+pub type Handle = u64; 
+
+pub struct AssetCache {
+    materials: DashMap<MaterialComponent, Arc<Material>>,
+    meshes: DashMap<MeshComponent, Arc<Mesh>>,
+}
+
+impl AssetCache {
+    pub fn new() -> Self {
+        Self {
+            materials: DashMap::new(),
+            meshes: DashMap::new(),
+        }
+    }

Large diffs are not rendered by default. Showing the first 50 of 1112 lines. Show full diff