diff --git a/Cargo.lock b/Cargo.lock index 0fc4423..e02620f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6,10 +6,10 @@ version = 3 name = "BeepSortMacroQuad" version = "0.1.0" dependencies = [ - "async-recursion", "async-trait", "macroquad", "tokio-test", + "wav", ] [[package]] @@ -29,17 +29,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "async-recursion" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b015a331cc64ebd1774ba119538573603427eaace0a1950c423ab971f903796" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "async-stream" version = "0.3.4" @@ -99,9 +88,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "bitflags" -version = "1.3.2" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" [[package]] name = "bumpalo" @@ -434,6 +423,12 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "riff" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9b1a3d5f46d53f4a3478e2be4a5a5ce5108ea58b100dcd139830eae7f79a3a1" + [[package]] name = "smallvec" version = "0.6.14" @@ -513,6 +508,15 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wav" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a65e199c799848b4f997072aa4d673c034f80f40191f97fe2f0a23f410be1609" +dependencies = [ + "riff", +] + [[package]] name = "winapi" version = "0.3.9" diff --git a/Cargo.toml b/Cargo.toml index b030289..ddb59f9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,6 +9,6 @@ edition = "2021" macroquad = "0.3.25" async-trait = "0.1.64" tokio-test = "*" -async-recursion = "1.0.2" +wav = "1.0.0" [profile.release] opt-level=3 diff --git a/src/GuiHookVec.rs b/src/GuiHookVec.rs index e0719f9..0d8fdea 100644 --- a/src/GuiHookVec.rs +++ b/src/GuiHookVec.rs @@ -1,7 +1,5 @@ -use std::borrow::{Borrow, BorrowMut}; -use std::ops::Add; -use std::path::Iter; + use async_trait::async_trait; use macroquad::color::{BROWN, WHITE}; use macroquad::hash; @@ -13,7 +11,7 @@ use macroquad::time::{get_frame_time, get_fps}; use macroquad::ui::root_ui; use macroquad::window::{next_frame, screen_height, screen_width}; use crate::BarPlugin::Bar; -use crate::algorithm::Algorithm; + diff --git a/src/main.rs b/src/main.rs deleted file mode 100644 index 00bb625..0000000 --- a/src/main.rs +++ /dev/null @@ -1,54 +0,0 @@ - -mod BarPlugin; -mod GuiHookVec; -mod algorithm; -mod dropdown; - -use dropdown::ButtonDropDown; -use macroquad::prelude::*; - -use macroquad::hash; -use macroquad::ui::root_ui; - - -#[macroquad::main("BeepSort")] -async fn main() { - let mut length = 1_usize; - let mut lengthString = "100".to_owned(); - - let mut delayText = "1".to_owned(); - - let mut algorithm = algorithm::Algorithm::new(); - let mut buttonDropDown = ButtonDropDown::new(&algorithm.getAlgorithms()); - loop{ - clear_background(WHITE); - - length = match lengthString.parse::(){ - Ok(a) => a, - Err(_)=> {100} - }; - - let mut centerX = screen_width()/2.0; - - - draw_text("Sorting!", centerX-170.0, screen_height()*0.1, 100.0, BLACK); - draw_text(&get_fps().to_string(), centerX + 300., 30.0, 20.0, BLACK); - root_ui().window(hash!(), Vec2::new(centerX - 150.0, 150.), Vec2::new(300., 45.), |ui|{ - ui.input_text(hash!(), "Delay (ms)", &mut delayText); - ui.input_text(hash!(), "Length Of Array!", &mut lengthString); - }); - - let mut algo = buttonDropDown.render(); - - if algo != ""{ - algorithm::Algorithm::run(length, 1.0, algo.to_string()).await; - } - next_frame().await - } - - - -} - - - diff --git a/src/test.wav b/src/test.wav new file mode 100644 index 0000000..930ceaa Binary files /dev/null and b/src/test.wav differ