tirbofish/dropbear · commit
e00f91c4cf09669404320a557c66e25fb5fde83f
wip: asset server remake and improved model importing
wip: animation within gltf
Signature present but could not be verified.
Unverified
@@ -1,513 +1,222 @@ -use std::sync::{ - Arc, LazyLock, - atomic::{AtomicU64, Ordering}, -}; - -use dashmap::DashMap; - +use std::collections::HashMap; +use std::hash::{DefaultHasher, Hash, Hasher}; +use std::marker::PhantomData; +use std::sync::{Arc, LazyLock}; +use parking_lot::RwLock; use crate::{ - graphics::{SharedGraphicsContext}, - model::{Material, Mesh, Model, ModelId}, - utils::ResourceReference, texture::Texture, }; +use crate::graphics::SharedGraphicsContext; +use crate::model::Model; -/// Opaque identifier returned from the [`AssetRegistry`] for stored assets. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] -pub struct AssetHandle(u64); -impl AssetHandle { - /// Creates a new [`AssetHandle`]. - /// - /// This function does not guarantee if the raw value exists in the registry. - /// You will have to check yourself. - pub fn new(raw: impl Into<u64>) -> Self { - Self(raw.into()) - } - /// Returns the raw/primitive [`u64`] value. - pub fn raw(&self) -> u64 { - self.0 - } -} - -#[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum AssetKind { - Model, - Material, - Mesh, -} +pub static ASSET_REGISTRY: LazyLock<Arc<RwLock<AssetRegistry>>> = LazyLock::new(|| Arc::new(RwLock::new(AssetRegistry::new())));
Large diffs are not rendered by default. Showing the first 50 of 2935 lines. Show full diff