kitgit

tirbofish/dropbear · commit

160b23ff5cec41fd4777aee71023784eb0b3d625

wip: got asset working (sorta), everything else is broken

Unverified

Thribhu K <4tkbytes@pm.me> · 2026-02-14 15:14

view full diff

diff --git a/crates/dropbear-engine/src/asset.rs b/crates/dropbear-engine/src/asset.rs
index fc1eb9f..acdc1f1 100644
--- a/crates/dropbear-engine/src/asset.rs
+++ b/crates/dropbear-engine/src/asset.rs
@@ -12,12 +12,23 @@ use crate::model::Model;
 pub static ASSET_REGISTRY: LazyLock<Arc<RwLock<AssetRegistry>>> = LazyLock::new(|| Arc::new(RwLock::new(AssetRegistry::new())));
 
 /// A handle with type [`T`] that provides an index to the [AssetRegistry] contents.
-#[derive(Hash, Eq, PartialEq, Debug)]
+#[derive(Hash, Eq, Debug)]
 pub struct Handle<T> {
     pub id: u64,
     _phantom: PhantomData<T>
 }
 
+impl<T> PartialEq for Handle<T> {
+    fn eq(&self, other: &Self) -> bool {
+        if self.is_null() && other.is_null() {
+            return false;
+        }
+        self.id == other.id
+    }
+
+
+}
+
 impl<T> Copy for Handle<T> {}
 
 impl<T> Clone for Handle<T> {
@@ -30,7 +41,7 @@ impl<T> Handle<T> {
     /// Creates a null handle, for when there is no way to uniquely identify a hash (such as a viewport texture).
     ///
     /// # Safety
-    /// You will want to watch out, as adding this onto the asset_old registry with a type
+    /// You will want to watch out, as adding this onto the asset registry with a type
     /// where there already is a null handle item, it will be overwritten and data
     /// will not be saved. It is the reason why you will want to consider using the [Self::is_null]
     /// function to verify if the storage of the type has gone through correctly.
@@ -54,6 +65,14 @@ pub struct AssetRegistry {
     models: HashMap<u64, Model>,
     model_labels: HashMap<String, Handle<Model>>,
 }
+
+#[derive(Debug, Clone)]
+#[dropbear_macro::repr_c_enum]
+pub enum AssetKind {
+    Texture,
+    Model,
+}
+

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