kitgit

tirbofish/dropbear · commit

b9424d94ad55a59ec0d7085a30a618f4f1c18a9f

Merge pull request #62 from 4tkbytes/entity-split refactor: changing from AdoptedEntity to more component based system

Unverified

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

view full diff

diff --git a/Cargo.toml b/Cargo.toml
index 52e9f71..ea72445 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -60,6 +60,8 @@ libloading = "0.8"
 indexmap = "2.11"
 sha2 = "0.10"
 wesl = "0.2"
+dashmap = "6.1"
+open = "5.3"
 
 [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..1c5d958
--- /dev/null
+++ b/dropbear-engine/src/asset.rs
@@ -0,0 +1,77 @@
+use std::sync::Arc;
+
+use dashmap::DashMap;
+
+use crate::model::{Material, MaterialComponent, Mesh, MeshComponent};
+
+/// A typedef for a Asset handle.
+pub type Handle = u64;
+
+/// A cache that holds all the assets loaded at that moment in time.
+pub struct AssetCache {
+    materials: DashMap<MaterialComponent, Arc<Material>>,
+    meshes: DashMap<MeshComponent, Arc<Mesh>>,
+}
+
+impl AssetCache {
+    pub fn new() -> Self {
+        Self {
+            materials: DashMap::new(),

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