From 4e0a36c4a5337a34aeae14e5ca643f88ffe37d73 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Fri, 9 Feb 2024 14:59:16 -0600 Subject: [PATCH] Upgrade to Bevy 0.12. --- Cargo.toml | 11 ++++++----- src/core.rs | 2 -- src/exploration.rs | 2 +- src/navigation.rs | 4 ++-- src/pathfinding.rs | 3 ++- src/sound/icon.rs | 2 +- src/sound/pitch_shift.rs | 2 +- src/sound/volumetric.rs | 2 +- src/visibility.rs | 6 +++--- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f68baee..747e714 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,24 +13,25 @@ speech_dispatcher_0_10 = ["bevy_tts/speech_dispatcher_0_10"] speech_dispatcher_0_11 = ["bevy_tts/speech_dispatcher_0_11"] [dependencies.bevy] -version = "0.11" +version = "0.12" default-features = false features = [ "bevy_gilrs", "bevy_winit", "x11", "wayland", + "multi-threaded", "serialize", ] [dependencies] -bevy_rapier2d = "0.22" -bevy_synthizer = "0.4" -bevy_tts = { version = "0.6", default-features = false, features = ["tolk"] } +bevy_rapier2d = "0.24" +bevy_synthizer = "0.5" +bevy_tts = { version = "0.7", default-features = false, features = ["tolk"] } coord_2d = "0.3" futures-lite = "1" here_be_dragons = { version = "0.3", features = ["serde"] } -leafwing-input-manager = "0.10" +leafwing-input-manager = "0.11" maze_generator = "2" once_cell = "1" pathfinding = "4" diff --git a/src/core.rs b/src/core.rs index b09d6fb..44b6a8c 100644 --- a/src/core.rs +++ b/src/core.rs @@ -521,7 +521,6 @@ impl GlobalTransformExt for GlobalTransform { other: &GlobalTransform, other_collider: &Collider, ) -> ClosestPoints { - use bevy::math::Vec3Swizzles; let scale = PHYSICS_SCALE.read().unwrap(); let pos1 = Isometry::new( (self.translation() / *scale).xy().into(), @@ -540,7 +539,6 @@ impl GlobalTransformExt for GlobalTransform { other: &GlobalTransform, other_collider: &Collider, ) -> String { - use bevy::math::Vec3Swizzles; let scale = PHYSICS_SCALE.read().unwrap(); let pos1 = Isometry::new( (self.translation() / *scale).xy().into(), diff --git a/src/exploration.rs b/src/exploration.rs index a1443e3..56db96a 100644 --- a/src/exploration.rs +++ b/src/exploration.rs @@ -421,7 +421,7 @@ where if !config.states.is_empty() { let states = config.states; for state in states { - app.configure_set(Update, Exploration.run_if(in_state(state.clone()))) + app.configure_sets(Update, Exploration.run_if(in_state(state.clone()))) .add_systems(OnExit(state), cleanup); } } diff --git a/src/navigation.rs b/src/navigation.rs index adbac2d..409cc0e 100644 --- a/src/navigation.rs +++ b/src/navigation.rs @@ -308,7 +308,7 @@ fn remove_direction( mut removed: RemovedComponents, directions: Query<&CardinalDirection>, ) { - for entity in &mut removed { + for entity in removed.read() { if directions.contains(entity) { commands.entity(entity).remove::(); } @@ -352,7 +352,7 @@ fn log_area_descriptions( if !config.log_area_descriptions { return; } - for event in events.iter() { + for event in events.read() { let (entity1, entity2, started) = match event { CollisionEvent::Started(collider1, collider2, _) => (collider1, collider2, true), CollisionEvent::Stopped(collider1, collider2, _) => (collider1, collider2, false), diff --git a/src/pathfinding.rs b/src/pathfinding.rs index ec44a11..bdfa2ca 100644 --- a/src/pathfinding.rs +++ b/src/pathfinding.rs @@ -262,7 +262,7 @@ fn remove_destination( entities: &Entities, mut removed: RemovedComponents, ) { - for entity in &mut removed { + for entity in removed.read() { if entities.contains(entity) { commands.entity(entity).remove::(); } @@ -326,6 +326,7 @@ fn negotiate_path( direction, collider, rapier_context.integration_parameters.dt, + true, QueryFilter::new() .predicate(&|entity| obstructions.get(entity).is_ok()) .exclude_sensors() diff --git a/src/sound/icon.rs b/src/sound/icon.rs index 14e9297..c37cd9a 100644 --- a/src/sound/icon.rs +++ b/src/sound/icon.rs @@ -139,7 +139,7 @@ fn exploration_focus_removed( children: Query<&Children>, ) { const ICON_GAIN: f64 = 3.; - for entity in &mut removed { + for entity in removed.read() { if let Ok(mut icon) = query.get_mut(entity) { icon.gain /= ICON_GAIN; } diff --git a/src/sound/pitch_shift.rs b/src/sound/pitch_shift.rs index f012532..4f3e5c0 100644 --- a/src/sound/pitch_shift.rs +++ b/src/sound/pitch_shift.rs @@ -74,7 +74,7 @@ fn behind_removed( mut sounds: Query<&mut Sound>, ) { let downshift = 1. / config.downshift; - for entity in &mut removed { + for entity in removed.read() { if let Ok(mut icon) = icons.get_mut(entity) { icon.pitch *= downshift; last_icon_pitch.remove(&entity); diff --git a/src/sound/volumetric.rs b/src/sound/volumetric.rs index 9bb3b52..f8c574f 100644 --- a/src/sound/volumetric.rs +++ b/src/sound/volumetric.rs @@ -44,7 +44,7 @@ fn removed( mut removed: RemovedComponents, transforms: Query, With)>, ) { - for entity in &mut removed { + for entity in removed.read() { if transforms.get(entity).is_ok() { commands.entity(entity).insert(TransformBundle::default()); } diff --git a/src/visibility.rs b/src/visibility.rs index 7393748..ae7d890 100644 --- a/src/visibility.rs +++ b/src/visibility.rs @@ -267,7 +267,7 @@ fn viewshed_removed( visible_entities: Query<&VisibleEntities>, mut events: EventWriter, ) { - for entity in &mut query { + for entity in query.read() { if let Ok(visible) = visible_entities.get(entity) { for e in visible.iter() { events.send(VisibilityChanged::Lost { @@ -344,7 +344,7 @@ fn remove_visible( ) { if !removed.is_empty() { let mut cache = HashMap::new(); - for removed in &mut removed { + for removed in removed.read() { for (viewer_entity, mut viewshed, mut visible_entities, start) in &mut viewers { if !visible_entities.contains(&removed) { continue; @@ -394,7 +394,7 @@ fn log_visible( timer.tick(time.delta()); } recently_lost.retain(|_entity, timer| !timer.finished()); - for event in events.iter() { + for event in events.read() { let viewer = match event { VisibilityChanged::Gained { viewer, .. } => viewer, VisibilityChanged::Lost { viewer, .. } => viewer,