hotfix: broken API changes from 0.12.1 to 0.13.0

This commit is contained in:
Muhammad Nauman Raza 2024-03-14 20:52:03 +00:00
parent afd0853390
commit 5d8eb93b32
Signed by: devraza
GPG key ID: 91EAD6081011574B
4 changed files with 13 additions and 239 deletions

227
Cargo.lock generated
View file

@ -1254,18 +1254,6 @@ dependencies = [
"thiserror", "thiserror",
] ]
[[package]]
name = "calloop-wayland-source"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f0ea9b9476c7fad82841a8dbb380e2eae480c21910feba80725b46931ed8f02"
dependencies = [
"calloop",
"rustix",
"wayland-backend",
"wayland-client",
]
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.0.90" version = "1.0.90"
@ -2432,15 +2420,6 @@ version = "2.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149"
[[package]]
name = "memmap2"
version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322"
dependencies = [
"libc",
]
[[package]] [[package]]
name = "metal" name = "metal"
version = "0.27.0" version = "0.27.0"
@ -2957,15 +2936,6 @@ version = "1.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43d84d1d7a6ac92673717f9f6d1518374ef257669c24ebc5ac25d5033828be58" checksum = "43d84d1d7a6ac92673717f9f6d1518374ef257669c24ebc5ac25d5033828be58"
[[package]]
name = "quick-xml"
version = "0.31.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33"
dependencies = [
"memchr",
]
[[package]] [[package]]
name = "quote" name = "quote"
version = "1.0.35" version = "1.0.35"
@ -3140,31 +3110,12 @@ dependencies = [
"winapi-util", "winapi-util",
] ]
[[package]]
name = "scoped-tls"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294"
[[package]] [[package]]
name = "scopeguard" name = "scopeguard"
version = "1.2.0" version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
[[package]]
name = "sctk-adwaita"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "82b2eaf3a5b264a521b988b2e73042e742df700c4f962cde845d1541adb46550"
dependencies = [
"ab_glyph",
"log",
"memmap2",
"smithay-client-toolkit",
"tiny-skia",
]
[[package]] [[package]]
name = "serde" name = "serde"
version = "1.0.197" version = "1.0.197"
@ -3244,31 +3195,6 @@ dependencies = [
"serde", "serde",
] ]
[[package]]
name = "smithay-client-toolkit"
version = "0.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "922fd3eeab3bd820d76537ce8f582b1cf951eceb5475c28500c7457d9d17f53a"
dependencies = [
"bitflags 2.4.2",
"calloop",
"calloop-wayland-source",
"cursor-icon",
"libc",
"log",
"memmap2",
"rustix",
"thiserror",
"wayland-backend",
"wayland-client",
"wayland-csd-frame",
"wayland-cursor",
"wayland-protocols",
"wayland-protocols-wlr",
"wayland-scanner",
"xkeysym",
]
[[package]] [[package]]
name = "smol_str" name = "smol_str"
version = "0.2.1" version = "0.2.1"
@ -3293,12 +3219,6 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
[[package]]
name = "strict-num"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731"
[[package]] [[package]]
name = "svg_fmt" name = "svg_fmt"
version = "0.4.2" version = "0.4.2"
@ -3403,31 +3323,6 @@ dependencies = [
"weezl", "weezl",
] ]
[[package]]
name = "tiny-skia"
version = "0.11.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "83d13394d44dae3207b52a326c0c85a8bf87f1541f23b0d143811088497b09ab"
dependencies = [
"arrayref",
"arrayvec",
"bytemuck",
"cfg-if",
"log",
"tiny-skia-path",
]
[[package]]
name = "tiny-skia-path"
version = "0.11.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c9e7fc0c2e86a30b117d0462aa261b72b7a99b7ebd7deb3a14ceda95c5bdc93"
dependencies = [
"arrayref",
"bytemuck",
"strict-num",
]
[[package]] [[package]]
name = "tinyvec" name = "tinyvec"
version = "1.6.0" version = "1.6.0"
@ -3719,114 +3614,6 @@ version = "0.2.92"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96"
[[package]]
name = "wayland-backend"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9d50fa61ce90d76474c87f5fc002828d81b32677340112b4ef08079a9d459a40"
dependencies = [
"cc",
"downcast-rs",
"rustix",
"scoped-tls",
"smallvec",
"wayland-sys",
]
[[package]]
name = "wayland-client"
version = "0.31.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "82fb96ee935c2cea6668ccb470fb7771f6215d1691746c2d896b447a00ad3f1f"
dependencies = [
"bitflags 2.4.2",
"rustix",
"wayland-backend",
"wayland-scanner",
]
[[package]]
name = "wayland-csd-frame"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e"
dependencies = [
"bitflags 2.4.2",
"cursor-icon",
"wayland-backend",
]
[[package]]
name = "wayland-cursor"
version = "0.31.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "71ce5fa868dd13d11a0d04c5e2e65726d0897be8de247c0c5a65886e283231ba"
dependencies = [
"rustix",
"wayland-client",
"xcursor",
]
[[package]]
name = "wayland-protocols"
version = "0.31.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f81f365b8b4a97f422ac0e8737c438024b5951734506b0e1d775c73030561f4"
dependencies = [
"bitflags 2.4.2",
"wayland-backend",
"wayland-client",
"wayland-scanner",
]
[[package]]
name = "wayland-protocols-plasma"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23803551115ff9ea9bce586860c5c5a971e360825a0309264102a9495a5ff479"
dependencies = [
"bitflags 2.4.2",
"wayland-backend",
"wayland-client",
"wayland-protocols",
"wayland-scanner",
]
[[package]]
name = "wayland-protocols-wlr"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6"
dependencies = [
"bitflags 2.4.2",
"wayland-backend",
"wayland-client",
"wayland-protocols",
"wayland-scanner",
]
[[package]]
name = "wayland-scanner"
version = "0.31.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "63b3a62929287001986fb58c789dce9b67604a397c15c611ad9f747300b6c283"
dependencies = [
"proc-macro2",
"quick-xml",
"quote",
]
[[package]]
name = "wayland-sys"
version = "0.31.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "15a0c8eaff5216d07f226cb7a549159267f3467b289d9a2e52fd3ef5aae2b7af"
dependencies = [
"dlib",
"log",
"pkg-config",
]
[[package]] [[package]]
name = "web-sys" name = "web-sys"
version = "0.3.67" version = "0.3.67"
@ -4299,7 +4086,6 @@ version = "0.29.15"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d59ad965a635657faf09c8f062badd885748428933dad8e8bdd64064d92e5ca" checksum = "0d59ad965a635657faf09c8f062badd885748428933dad8e8bdd64064d92e5ca"
dependencies = [ dependencies = [
"ahash",
"android-activity", "android-activity",
"atomic-waker", "atomic-waker",
"bitflags 2.4.2", "bitflags 2.4.2",
@ -4313,7 +4099,6 @@ dependencies = [
"js-sys", "js-sys",
"libc", "libc",
"log", "log",
"memmap2",
"ndk", "ndk",
"ndk-sys", "ndk-sys",
"objc2 0.4.1", "objc2 0.4.1",
@ -4323,16 +4108,10 @@ dependencies = [
"raw-window-handle 0.6.0", "raw-window-handle 0.6.0",
"redox_syscall 0.3.5", "redox_syscall 0.3.5",
"rustix", "rustix",
"sctk-adwaita",
"smithay-client-toolkit",
"smol_str", "smol_str",
"unicode-segmentation", "unicode-segmentation",
"wasm-bindgen", "wasm-bindgen",
"wasm-bindgen-futures", "wasm-bindgen-futures",
"wayland-backend",
"wayland-client",
"wayland-protocols",
"wayland-protocols-plasma",
"web-sys", "web-sys",
"web-time", "web-time",
"windows-sys 0.48.0", "windows-sys 0.48.0",
@ -4382,12 +4161,6 @@ version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e63e71c4b8bd9ffec2c963173a4dc4cbde9ee96961d4fcb4429db9929b606c34" checksum = "e63e71c4b8bd9ffec2c963173a4dc4cbde9ee96961d4fcb4429db9929b606c34"
[[package]]
name = "xcursor"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a0ccd7b4a5345edfcd0c3535718a4e9ff7798ffc536bb5b5a0e26ff84732911"
[[package]] [[package]]
name = "xi-unicode" name = "xi-unicode"
version = "0.3.0" version = "0.3.0"

View file

@ -1,6 +1,6 @@
[package] [package]
name = "ambition" name = "ambition"
version = "0.1.0" version = "0.2.0"
edition = "2021" edition = "2021"
# Squeeze out more performance for `release` builds - very slow compile times # Squeeze out more performance for `release` builds - very slow compile times
@ -15,6 +15,6 @@ opt-level = 1
opt-level = 3 opt-level = 3
[dependencies] [dependencies]
bevy = { version = "0.13.0", features = [ "wayland" ] } bevy = { version = "0.13.0" }
bevy_egui = "0.25.0" bevy_egui = "0.25.0"
lazy_static = "1.4.0" lazy_static = "1.4.0"

View file

@ -54,6 +54,7 @@
pkgs.vulkan-loader pkgs.vulkan-loader
pkgs.udev pkgs.udev
pkgs.alsa-lib pkgs.alsa-lib
pkgs.libxkbcommon
]}"''; ]}"'';
# Use nightly cargo & rustc provided by fenix. Add for packages for the dev shell here # Use nightly cargo & rustc provided by fenix. Add for packages for the dev shell here
buildInputs = with pkgs; [ buildInputs = with pkgs; [
@ -61,7 +62,7 @@
cargo rustc rust-src clippy rustfmt # rust components cargo rustc rust-src clippy rustfmt # rust components
]) ])
xorg.libX11 xorg.libXcursor xorg.libXi xorg.libXrandr # To use the x11 feature xorg.libX11 xorg.libXcursor xorg.libXi xorg.libXrandr # To use the x11 feature
libxkbcommon wayland # To use the wayland feature libxkbcommon # To use the wayland feature
udev alsa-lib vulkan-loader udev alsa-lib vulkan-loader
pkgs.nixgl.nixVulkanIntel pkgs.nixgl.nixVulkanIntel

View file

@ -15,7 +15,7 @@ pub struct Player {
// Define the player movement system // Define the player movement system
pub fn movement( pub fn movement(
time: Res<Time>, time: Res<Time>,
keys: Res<Input<KeyCode>>, keys: Res<ButtonInput<KeyCode>>,
mut player_query: Query<(&mut Player, &mut Transform), With<Player>>, mut player_query: Query<(&mut Player, &mut Transform), With<Player>>,
) { ) {
let (mut player, mut transform) = player_query.single_mut(); let (mut player, mut transform) = player_query.single_mut();
@ -23,14 +23,14 @@ pub fn movement(
let mut rotation_factor = 0.; let mut rotation_factor = 0.;
let mut movement_factor = 0.; let mut movement_factor = 0.;
if keys.pressed(KeyCode::W) { if keys.pressed(KeyCode::KeyW) {
movement_factor += 1.; movement_factor += 1.;
} else if keys.pressed(KeyCode::S) { } else if keys.pressed(KeyCode::KeyS) {
movement_factor -= 1.; movement_factor -= 1.;
} }
if keys.pressed(KeyCode::A) { if keys.pressed(KeyCode::KeyA) {
rotation_factor += 1.; rotation_factor += 1.;
} else if keys.pressed(KeyCode::D) { } else if keys.pressed(KeyCode::KeyD) {
rotation_factor -= 1.; rotation_factor -= 1.;
} }
@ -46,18 +46,18 @@ pub fn movement(
movement_distance = 256.; movement_distance = 256.;
} }
if keys.pressed(KeyCode::Left) { if keys.pressed(KeyCode::ArrowLeft) {
transform.rotation = Quat::from_rotation_z((90_f32).to_radians()); transform.rotation = Quat::from_rotation_z((90_f32).to_radians());
movement_factor = 1.; movement_factor = 1.;
} else if keys.pressed(KeyCode::Right) { } else if keys.pressed(KeyCode::ArrowRight) {
transform.rotation = Quat::from_rotation_z((270_f32).to_radians()); transform.rotation = Quat::from_rotation_z((270_f32).to_radians());
movement_factor = 1.; movement_factor = 1.;
} }
if keys.pressed(KeyCode::Up) { if keys.pressed(KeyCode::ArrowUp) {
transform.rotation = Quat::from_rotation_z((0_f32).to_radians()); transform.rotation = Quat::from_rotation_z((0_f32).to_radians());
movement_factor = 1.; movement_factor = 1.;
} else if keys.pressed(KeyCode::Down) { } else if keys.pressed(KeyCode::ArrowDown) {
transform.rotation = Quat::from_rotation_z((180_f32).to_radians()); transform.rotation = Quat::from_rotation_z((180_f32).to_radians());
movement_factor = 1.; movement_factor = 1.;
} }