From 9dcd94932f41f7dbff87afe7b7ba75067179c12c Mon Sep 17 00:00:00 2001 From: Alex Page Date: Wed, 23 Nov 2022 23:57:14 -0500 Subject: [PATCH] Crate updates --- Cargo.lock | 372 ++++++++++++++++++++++++++++++--- Cargo.toml | 6 +- src/input/player.rs | 11 +- src/resources/sound_effects.rs | 6 +- src/resources/sound_output.rs | 9 +- src/systems/monster_ai.rs | 2 +- src/systems/whip.rs | 2 +- src/tile_data.rs | 2 +- 8 files changed, 361 insertions(+), 49 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0d42044..3c8ba5b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -93,6 +93,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "base-x" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" + [[package]] name = "bindgen" version = "0.56.0" @@ -139,7 +145,7 @@ version = "0.8.2" source = "git+https://github.com/amethyst/bracket-lib#cf8eec60ae17f2534a14f3ae643c871202aed192" dependencies = [ "lazy_static", - "parking_lot", + "parking_lot 0.11.2", ] [[package]] @@ -148,7 +154,7 @@ version = "0.8.0" source = "git+https://github.com/amethyst/bracket-lib#cf8eec60ae17f2534a14f3ae643c871202aed192" dependencies = [ "lazy_static", - "parking_lot", + "parking_lot 0.11.2", ] [[package]] @@ -233,7 +239,7 @@ dependencies = [ "image", "lazy_static", "object-pool", - "parking_lot", + "parking_lot 0.11.2", "rand", "spin_sleep", "ultraviolet", @@ -494,28 +500,28 @@ dependencies = [ [[package]] name = "cpal" -version = "0.13.5" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74117836a5124f3629e4b474eed03e479abaf98988b4bb317e29f08cfe0e4116" +checksum = "e73413ddcb69c398125f5529714492e070c64c6a090ad5b01d8c082b320a0809" dependencies = [ "alsa", "core-foundation-sys 0.8.3", "coreaudio-rs", "jni", "js-sys", - "lazy_static", "libc", "mach", - "ndk 0.6.0", - "ndk-glue 0.6.0", - "nix 0.23.1", + "ndk 0.7.0", + "ndk-context", + "nix 0.25.0", "oboe", - "parking_lot", + "once_cell", + "parking_lot 0.12.1", "stdweb", "thiserror", "wasm-bindgen", "web-sys", - "winapi 0.3.9", + "windows", ] [[package]] @@ -723,6 +729,12 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "discard" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" + [[package]] name = "dispatch" version = "0.2.0" @@ -893,7 +905,7 @@ dependencies = [ "log", "objc", "osmesa-sys", - "parking_lot", + "parking_lot 0.11.2", "wayland-client", "wayland-egl", "winapi 0.3.9", @@ -947,20 +959,21 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.11.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ "ahash", ] [[package]] name = "hecs" -version = "0.5.2" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddd0e227c3f78ad06fcc590966b327a2f8fef03ef51812dad4fbff5b0a6424bd" +checksum = "11b81e962a0576ee276c1e6cbdce16bed83c7357ce8ff4e9efc8f49e43d2d1a1" dependencies = [ "hashbrown", + "spin", ] [[package]] @@ -1006,6 +1019,12 @@ dependencies = [ "libc", ] +[[package]] +name = "itoa" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" + [[package]] name = "jni" version = "0.19.0" @@ -1097,9 +1116,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.117" +version = "0.2.137" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e74d72e0f9b65b5b4ca49a346af3976df0f9c61d550727f349ecd559f251a26c" +checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" [[package]] name = "libloading" @@ -1326,6 +1345,26 @@ dependencies = [ "thiserror", ] +[[package]] +name = "ndk" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "451422b7e4718271c8b5b3aadf5adedba43dc76312454b387e98fae0fc951aa0" +dependencies = [ + "bitflags", + "jni-sys", + "ndk-sys 0.4.1+23.1.7779620", + "num_enum 0.5.6", + "raw-window-handle 0.5.0", + "thiserror", +] + +[[package]] +name = "ndk-context" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" + [[package]] name = "ndk-glue" version = "0.2.1" @@ -1409,6 +1448,15 @@ dependencies = [ "jni-sys", ] +[[package]] +name = "ndk-sys" +version = "0.4.1+23.1.7779620" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cf2aae958bd232cac5069850591667ad422d263686d75b52a065f9badeee5a3" +dependencies = [ + "jni-sys", +] + [[package]] name = "net2" version = "0.2.37" @@ -1457,6 +1505,20 @@ dependencies = [ "memoffset", ] +[[package]] +name = "nix" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e322c04a9e3440c327fca7b6c8a63e6890a32fa2ad689db972425f07e0d22abb" +dependencies = [ + "autocfg", + "bitflags", + "cfg-if 1.0.0", + "libc", + "memoffset", + "pin-utils", +] + [[package]] name = "nom" version = "5.1.2" @@ -1627,7 +1689,7 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee9a3e7196d09ec86002b939f1576e8e446d58def8fd48fe578e2c72d5328d68" dependencies = [ - "parking_lot", + "parking_lot 0.11.2", ] [[package]] @@ -1655,18 +1717,18 @@ dependencies = [ [[package]] name = "oddio" -version = "0.5.0" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33f6d5a128f26322b02ba2741cbdc9f14f1431e757db3b15fd893d5c416f3e20" +checksum = "f0f3379cc7e854d0b0d4a0e310f276faafc46896843b720efe4646faa1b0c734" dependencies = [ "mint", ] [[package]] name = "once_cell" -version = "1.9.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" +checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" [[package]] name = "osmesa-sys" @@ -1694,7 +1756,17 @@ checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" dependencies = [ "instant", "lock_api", - "parking_lot_core", + "parking_lot_core 0.8.5", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core 0.9.4", ] [[package]] @@ -1711,6 +1783,19 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "parking_lot_core" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall", + "smallvec", + "windows-sys", +] + [[package]] name = "peeking_take_while" version = "0.1.2" @@ -1723,6 +1808,12 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + [[package]] name = "pkg-config" version = "0.3.24" @@ -1830,6 +1921,15 @@ dependencies = [ "cty", ] +[[package]] +name = "raw-window-handle" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed7e3d950b66e19e0c372f3fa3fbbcf85b1746b571f74e0c2af6042a5c93420a" +dependencies = [ + "cty", +] + [[package]] name = "redox_syscall" version = "0.2.10" @@ -1878,6 +1978,15 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +dependencies = [ + "semver", +] + [[package]] name = "rustfft" version = "6.0.1" @@ -1902,6 +2011,12 @@ dependencies = [ "owned_ttf_parser", ] +[[package]] +name = "ryu" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" + [[package]] name = "safe_arch" version = "0.5.2" @@ -1932,6 +2047,21 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + [[package]] name = "send_wrapper" version = "0.2.0" @@ -1944,6 +2074,43 @@ version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" +[[package]] +name = "serde_derive" +version = "1.0.136" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha1" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1da05c97445caa12d05e848c4a4fcbbea29e748ac28f7e80e9b010392063770" +dependencies = [ + "sha1_smol", +] + +[[package]] +name = "sha1_smol" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" + [[package]] name = "shared_library" version = "0.1.9" @@ -2011,6 +2178,12 @@ dependencies = [ "syn", ] +[[package]] +name = "spin" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6002a767bff9e83f8eeecf883ecb8011875a21ae8da43bffb817a57e78cc09" + [[package]] name = "spin_sleep" version = "1.0.0" @@ -2023,9 +2196,52 @@ dependencies = [ [[package]] name = "stdweb" -version = "0.1.3" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef5430c8e36b713e13b48a9f709cc21e046723fe44ce34587b73a830203b533e" +checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5" +dependencies = [ + "discard", + "rustc_version", + "stdweb-derive", + "stdweb-internal-macros", + "stdweb-internal-runtime", + "wasm-bindgen", +] + +[[package]] +name = "stdweb-derive" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" +dependencies = [ + "proc-macro2", + "quote", + "serde", + "serde_derive", + "syn", +] + +[[package]] +name = "stdweb-internal-macros" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" +dependencies = [ + "base-x", + "proc-macro2", + "quote", + "serde", + "serde_derive", + "serde_json", + "sha1", + "syn", +] + +[[package]] +name = "stdweb-internal-runtime" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" [[package]] name = "strength_reduce" @@ -2396,6 +2612,106 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57b543186b344cc61c85b5aab0d2e3adf4e0f99bc076eff9aa5927bcc0b8a647" +dependencies = [ + "windows_aarch64_msvc 0.37.0", + "windows_i686_gnu 0.37.0", + "windows_i686_msvc 0.37.0", + "windows_x86_64_gnu 0.37.0", + "windows_x86_64_msvc 0.37.0", +] + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.42.0", + "windows_i686_gnu 0.42.0", + "windows_i686_msvc 0.42.0", + "windows_x86_64_gnu 0.42.0", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.42.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2623277cb2d1c216ba3b578c0f3cf9cdebeddb6e66b1b218bb33596ea7769c3a" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" + +[[package]] +name = "windows_i686_gnu" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3925fd0b0b804730d44d4b6278c50f9699703ec49bcd628020f46f4ba07d9e1" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" + +[[package]] +name = "windows_i686_msvc" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce907ac74fe331b524c1298683efbf598bb031bc84d5e274db2083696d07c57c" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2babfba0828f2e6b32457d5341427dcbb577ceef556273229959ac23a10af33d" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4dd6dc7df2d84cf7b33822ed5b86318fb1781948e9663bacd047fc9dd52259d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" + [[package]] name = "winit" version = "0.24.0" @@ -2418,7 +2734,7 @@ dependencies = [ "ndk-glue 0.2.1", "ndk-sys 0.2.2", "objc", - "parking_lot", + "parking_lot 0.11.2", "percent-encoding", "raw-window-handle 0.3.4", "smithay-client-toolkit", @@ -2451,7 +2767,7 @@ dependencies = [ "ndk-glue 0.3.0", "ndk-sys 0.2.2", "objc", - "parking_lot", + "parking_lot 0.11.2", "percent-encoding", "raw-window-handle 0.3.4", "scopeguard", diff --git a/Cargo.toml b/Cargo.toml index f115282..061fa0b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,10 +15,10 @@ path = "src/main.rs" [dependencies] # bracket-lib = { path = "extern/bracket-lib" } bracket-lib = { git = "https://github.com/amethyst/bracket-lib" } -hecs = "0.5.1" +hecs = "0.9.0" specs-derive = "0.4.1" -cpal = { version = "0.13.0", features = ["wasm-bindgen"] } -oddio = "0.5.0" +cpal = { version = "0.14.1", features = ["wasm-bindgen"] } +oddio = "0.6.2" fundsp = "0.1.0" typenum = "1.15.0" console_error_panic_hook = "0.1.7" diff --git a/src/input/player.rs b/src/input/player.rs index cef23c5..f588db6 100644 --- a/src/input/player.rs +++ b/src/input/player.rs @@ -16,12 +16,7 @@ use crate::{ pub fn try_move(delta_x: i32, delta_y: i32, world: &mut World, resources: &mut Resources) { let mut to_kill: Vec = Vec::new(); - for (player_entity, (player, pos)) in &mut world.query::<(&mut Player, &mut Position)>() { - // The player shouldn't be able to move while whipping - if let Ok(_wants_to_whip) = world.get::(player_entity) { - continue; - } - + for (player_entity, (player, pos)) in &mut world.query::>() { let now = Instant::now(); if now - player.last_moved > Duration::from_secs_f32(PLAYER_STEP_PERIOD) { let destination = Point { @@ -32,7 +27,7 @@ pub fn try_move(delta_x: i32, delta_y: i32, world: &mut World, resources: &mut R if resources.map.in_bounds(destination) { if try_step(destination, world, resources) { if let Some(monster_entity) = resources.map.get_tile_content_at(destination) { - if let Ok(monster) = world.get::(monster_entity) { + if let Ok(monster) = world.get::<&Monster>(monster_entity) { resources.stats.add_score(damage_for_kind(monster.kind)); resources.stats.take_gems(damage_for_kind(monster.kind)); if let (Some(sound_effects), Some(sound_output)) = @@ -276,7 +271,7 @@ fn try_step(point: Point, _world: &World, resources: &mut Resources) -> bool { pub fn whip(world: &mut World, resources: &mut Resources) { let mut to_add: Vec = Vec::new(); - for (entity, _) in world.query_mut::>>>() { + for (entity, _) in world.query_mut::>>>() { if resources.stats.whips > 0 { to_add.push(entity); } diff --git a/src/resources/sound_effects.rs b/src/resources/sound_effects.rs index b0d7638..3b3be5e 100644 --- a/src/resources/sound_effects.rs +++ b/src/resources/sound_effects.rs @@ -1,4 +1,4 @@ -use std::{array, iter, time::Duration}; +use std::{iter, time::Duration}; use bracket_lib::random::RandomNumberGenerator; @@ -92,7 +92,7 @@ impl SoundEffects { duration: Duration::from_millis(40), }) .chain((0..4).flat_map(|_| { - array::IntoIter::new([ + [ Sound { sound_type: SoundType::Tone(100), duration: Duration::from_millis(15), @@ -101,7 +101,7 @@ impl SoundEffects { sound_type: SoundType::Silence, duration: Duration::from_millis(15), }, - ]) + ] })) .collect(), }), diff --git a/src/resources/sound_output.rs b/src/resources/sound_output.rs index 96f800e..3d3eb6d 100644 --- a/src/resources/sound_output.rs +++ b/src/resources/sound_output.rs @@ -103,11 +103,12 @@ impl SoundOutput { } pub fn play_sound(&mut self, samples: SoundSamples) -> SoundEffectHandle { + let mut gain = oddio::Gain::new( + oddio::FramesSignal::from(samples) + ); + gain.set_gain(-10.0); self.mixer_handle .control::, _>() - .play(oddio::MonoToStereo::new(oddio::Gain::new( - oddio::FramesSignal::from(samples), - 0.50, - ))) + .play(oddio::MonoToStereo::new(gain)) } } diff --git a/src/systems/monster_ai.rs b/src/systems/monster_ai.rs index cbd4aea..eb38779 100644 --- a/src/systems/monster_ai.rs +++ b/src/systems/monster_ai.rs @@ -52,7 +52,7 @@ pub fn run(world: &mut World, resources: &mut Resources) { }; if let Some(e) = resources.map.get_tile_content_at(destination) { - if let Ok(_player) = world.get::(e) { + if let Ok(_player) = world.get::<&Player>(e) { // TODO: Sound resources.map.clear_tile_content_at(Point::from(*position)); resources.stats.take_gems(damage_for_kind(monster.kind)); diff --git a/src/systems/whip.rs b/src/systems/whip.rs index d9f3db1..d016bbc 100644 --- a/src/systems/whip.rs +++ b/src/systems/whip.rs @@ -70,7 +70,7 @@ pub fn run(world: &mut World, resources: &mut Resources) { if let Some(dest) = destination { if let Some(e) = resources.map.get_tile_content_at(dest) { - if let Ok(monster) = world.get::(e) { + if let Ok(monster) = world.get::<&Monster>(e) { resources.stats.add_score(damage_for_kind(monster.kind)); to_kill.push(e); resources.map.clear_tile_content_at(dest); diff --git a/src/tile_data.rs b/src/tile_data.rs index a6bc744..08a29d7 100644 --- a/src/tile_data.rs +++ b/src/tile_data.rs @@ -2,7 +2,7 @@ use bracket_lib::prelude::*; use crate::graphics::vga_color as vga; -#[derive(PartialEq, Copy, Clone)] +#[derive(Eq, PartialEq, Copy, Clone)] pub struct TileData { pub glyph: FontCharType, pub color_fg: (u8, u8, u8),