chore: Update to Bevy 0.10.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Nolan Darilek 2023-03-06 14:24:23 -06:00
parent 35f132d858
commit b381e1501f
3 changed files with 47 additions and 42 deletions

View File

@ -11,11 +11,11 @@ repository = "https://labs.lightsout.games/projects/bevy_synthizer"
[dependencies] [dependencies]
anyhow = "1" anyhow = "1"
bevy = { version = "0.9", default-features = false, features = ["bevy_asset"] } bevy = { version = "0.10", default-features = false, features = ["bevy_asset"] }
synthizer = "0.5.6" synthizer = "0.5.6"
[dev-dependencies] [dev-dependencies]
bevy = { version = "0.9", default-features = true } bevy = { version = "0.10", default-features = true }
[package.metadata.release] [package.metadata.release]
publish = false publish = false

View File

@ -31,7 +31,7 @@ fn load_and_create(
return; return;
} }
handles.loaded = asset_server handles.loaded = asset_server
.get_group_load_state(handles.sounds.iter().map(|handle| handle.id)) .get_group_load_state(handles.sounds.iter().map(|handle| handle.id()))
== LoadState::Loaded; == LoadState::Loaded;
if handles.loaded { if handles.loaded {
commands.spawn(( commands.spawn((

View File

@ -365,8 +365,8 @@ fn swap_buffers(
} }
fn change_panner_strategy( fn change_panner_strategy(
changed: Query<(Entity, ChangeTrackers<PannerStrategy>)>, changed: Query<(Entity, Ref<PannerStrategy>)>,
removed: RemovedComponents<PannerStrategy>, mut removed: RemovedComponents<PannerStrategy>,
mut sources: Query<&mut Source>, mut sources: Query<&mut Source>,
) { ) {
let mut check = vec![]; let mut check = vec![];
@ -589,7 +589,7 @@ fn update_sound_playback_state(query: Query<&Sound>) {
} }
} }
fn remove_sound(mut last_buffer: ResMut<LastAudio>, removed: RemovedComponents<Source>) { fn remove_sound(mut last_buffer: ResMut<LastAudio>, mut removed: RemovedComponents<Source>) {
for entity in removed.iter() { for entity in removed.iter() {
last_buffer.remove(&entity); last_buffer.remove(&entity);
} }
@ -691,7 +691,7 @@ fn events(
}); });
} }
#[derive(SystemLabel, Clone, Hash, Debug, PartialEq, Eq)] #[derive(SystemSet, Clone, Hash, Debug, PartialEq, Eq)]
pub enum SynthizerSystems { pub enum SynthizerSystems {
UpdateHandles, UpdateHandles,
UpdateProperties, UpdateProperties,
@ -756,65 +756,70 @@ impl Plugin for SynthizerPlugin {
.init_resource::<LastAudio>() .init_resource::<LastAudio>()
.insert_resource(defaults) .insert_resource(defaults)
.add_event::<SynthizerEvent>() .add_event::<SynthizerEvent>()
.add_system_to_stage(CoreStage::PreUpdate, sync_config) .add_system(sync_config.in_base_set(CoreSet::PreUpdate))
.add_system_to_stage( .add_system(
CoreStage::PostUpdate, swap_buffers
swap_buffers.before(SynthizerSystems::UpdateHandles), .in_base_set(CoreSet::PostUpdate)
.before(SynthizerSystems::UpdateHandles),
) )
.add_system_to_stage( .add_system(
CoreStage::PostUpdate, change_panner_strategy
change_panner_strategy.before(SynthizerSystems::UpdateHandles), .in_base_set(CoreSet::PostUpdate)
.before(SynthizerSystems::UpdateHandles),
) )
.add_system_to_stage( .add_system(
CoreStage::PostUpdate,
add_source_handle add_source_handle
.label(SynthizerSystems::UpdateHandles) .in_base_set(CoreSet::PostUpdate)
.in_set(SynthizerSystems::UpdateHandles)
.before(SynthizerSystems::UpdateProperties), .before(SynthizerSystems::UpdateProperties),
) )
.add_system_to_stage( .add_system(
CoreStage::PostUpdate,
add_generator add_generator
.label(SynthizerSystems::UpdateHandles) .in_base_set(CoreSet::PostUpdate)
.in_set(SynthizerSystems::UpdateHandles)
.before(SynthizerSystems::UpdateProperties), .before(SynthizerSystems::UpdateProperties),
) )
.add_system_to_stage( .add_system(
CoreStage::PostUpdate,
add_sound_without_source add_sound_without_source
.label(SynthizerSystems::UpdateHandles) .in_base_set(CoreSet::PostUpdate)
.in_set(SynthizerSystems::UpdateHandles)
.before(SynthizerSystems::UpdateProperties), .before(SynthizerSystems::UpdateProperties),
) )
.add_system_to_stage( .add_system(
CoreStage::PostUpdate,
update_listener update_listener
.label(SynthizerSystems::UpdateProperties) .in_base_set(CoreSet::PostUpdate)
.in_set(SynthizerSystems::UpdateProperties)
.after(TransformSystem::TransformPropagate) .after(TransformSystem::TransformPropagate)
.before(SynthizerSystems::UpdateState), .before(SynthizerSystems::UpdateState),
) )
.add_system_to_stage( .add_system(
CoreStage::PostUpdate,
update_source_properties update_source_properties
.label(SynthizerSystems::UpdateProperties) .in_base_set(CoreSet::PostUpdate)
.in_set(SynthizerSystems::UpdateProperties)
.after(TransformSystem::TransformPropagate) .after(TransformSystem::TransformPropagate)
.before(SynthizerSystems::UpdateState), .before(SynthizerSystems::UpdateState),
) )
.add_system_to_stage( .add_system(
CoreStage::PostUpdate,
update_sound_properties update_sound_properties
.label(SynthizerSystems::UpdateProperties) .in_base_set(CoreSet::PostUpdate)
.in_set(SynthizerSystems::UpdateProperties)
.before(SynthizerSystems::UpdateState), .before(SynthizerSystems::UpdateState),
) )
.add_system_to_stage( .add_system(
CoreStage::PostUpdate, update_source_playback_state
update_source_playback_state.label(SynthizerSystems::UpdateState), .in_base_set(CoreSet::PostUpdate)
.in_set(SynthizerSystems::UpdateState),
) )
.add_system_to_stage( .add_system(
CoreStage::PostUpdate, update_sound_playback_state
update_sound_playback_state.label(SynthizerSystems::UpdateState), .in_base_set(CoreSet::PostUpdate)
.in_set(SynthizerSystems::UpdateState),
) )
.add_system_to_stage(CoreStage::PostUpdate, remove_sound) .add_system(remove_sound.in_base_set(CoreSet::PostUpdate))
.add_system_to_stage( .add_system(
CoreStage::PostUpdate, events
events.after(SynthizerSystems::UpdateState), .in_base_set(CoreSet::PostUpdate)
.after(SynthizerSystems::UpdateState),
); );
} }
} }