kitgit

tirbofish/dropbear · diff

ed57d91 · tk

worked on async and channels, with the dependency checking working perfectly :)

Unverified

diff --git a/Cargo.toml b/Cargo.toml
index b28240e..43311b3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -58,6 +58,7 @@ flate2 = "1.1"
 reqwest = { version = "0.11", features = ["stream"] }
 tar = "0.4"
 async-trait = "0.1"
+futures-util = "0.3"
 
 gltf = "1"
 thiserror = "2.0"
diff --git a/dropbear-engine/src/entity.rs b/dropbear-engine/src/entity.rs
index 171bef6..4af1406 100644
--- a/dropbear-engine/src/entity.rs
+++ b/dropbear-engine/src/entity.rs
@@ -68,7 +68,7 @@ pub struct LazyAdoptedEntity {
 impl LazyAdoptedEntity {
     /// Create a LazyAdoptedEntity from a file path (can be run on background thread)
     pub async fn from_file(path: &PathBuf, label: Option<&str>) -> anyhow::Result<Self> {
-        let buffer = std::fs::read(path)?;
+        let buffer = tokio::fs::read(path).await?;
         Self::from_memory(buffer, label).await
     }
 
diff --git a/dropbear-engine/src/lib.rs b/dropbear-engine/src/lib.rs
index 542a1d3..3c60f2b 100644
--- a/dropbear-engine/src/lib.rs
+++ b/dropbear-engine/src/lib.rs
@@ -407,14 +407,14 @@ impl App {
     /// - setup: A closure that can initialise the first scenes, such as a menu or the game itself.
     /// It takes an input of a scene manager and an input manager, and expects you to return back the changed
     /// managers.
-    pub fn run<F>(config: WindowConfiguration, app_name: &str, setup: F) -> anyhow::Result<()>
+    pub async fn run<F>(config: WindowConfiguration, app_name: &str, setup: F) -> anyhow::Result<()>
     where
         F: FnOnce(scene::Manager, input::Manager) -> (scene::Manager, input::Manager),
     {
         let log_dir = app_dirs2::app_root(AppDataType::UserData, &config.app_info)
             .expect("Failed to get app data directory")
             .join("logs");
-        std::fs::create_dir_all(&log_dir).expect("Failed to create log dir");
+        tokio::fs::create_dir_all(&log_dir).await.expect("Failed to create log dir");
 
         let datetime_str = Local::now().format("%Y-%m-%d_%H-%M-%S");
         let log_filename = format!("{}.{}.log", app_name, datetime_str);
diff --git a/dropbear-engine/src/model.rs b/dropbear-engine/src/model.rs
index fccda56..0557e56 100644
--- a/dropbear-engine/src/model.rs
+++ b/dropbear-engine/src/model.rs

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