From 3c557fa5ab85a4ce5a7afebab4b911e37ccb037d Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Fri, 6 Dec 2024 09:33:24 -0600 Subject: [PATCH] chore: Upgrade to Bevy 0.15. --- Cargo.toml | 4 ++-- examples/buffer.rs | 8 ++------ examples/generator.rs | 8 ++------ src/lib.rs | 13 ++++++------- 4 files changed, 12 insertions(+), 21 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6ca9763..14d27e1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,12 +10,12 @@ repository = "https://labs.lightsout.games/projects/bevy_synthizer" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -bevy = { version = "0.14", default-features = false, features = ["bevy_asset"] } +bevy = { version = "0.15", default-features = false, features = ["bevy_asset"] } synthizer = "0.5.6" thiserror = "1" [dev-dependencies] -bevy = { version = "0.14", default-features = true } +bevy = { version = "0.15", default-features = true } [package.metadata.release] publish = false diff --git a/examples/buffer.rs b/examples/buffer.rs index b31fd35..e4ab0b7 100644 --- a/examples/buffer.rs +++ b/examples/buffer.rs @@ -31,14 +31,10 @@ fn load_and_create( if !listeners.is_empty() { return; } - commands.spawn(( - TransformBundle::default(), - Listener, - RotationTimer::default(), - )); + commands.spawn((Transform::default(), Listener, RotationTimer::default())); let handle = asset_server.load("footstep.wav"); commands.spawn(( - TransformBundle::from(Transform::from_translation(Vec3::new(10., 0., 0.))), + Transform::from_translation(Vec3::new(10., 0., 0.)), Source::default(), Sound { audio: handle.into(), diff --git a/examples/generator.rs b/examples/generator.rs index 377336a..ad34a4d 100644 --- a/examples/generator.rs +++ b/examples/generator.rs @@ -13,16 +13,12 @@ impl Default for RotationTimer { } fn setup(mut commands: Commands, context: Res) { - commands.spawn(( - TransformBundle::default(), - Listener, - RotationTimer::default(), - )); + commands.spawn((Transform::default(), Listener, RotationTimer::default())); let generator: syz::Generator = syz::FastSineBankGenerator::new_sine(&context, 440.) .expect("Failed to create generator") .into(); commands.spawn(( - TransformBundle::from(Transform::from_translation(Vec3::new(10., 0., 0.))), + Transform::from_translation(Vec3::new(10., 0., 0.)), Source::default(), Sound { audio: generator.into(), diff --git a/src/lib.rs b/src/lib.rs index 4ea563f..9378a66 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,9 +2,8 @@ use std::collections::HashMap; use bevy::{ - asset::{io::Reader, AssetLoader, AsyncReadExt, LoadContext}, + asset::{io::Reader, AssetLoader, LoadContext}, prelude::*, - reflect::TypePath, transform::TransformSystem, }; pub use synthizer as syz; @@ -30,11 +29,11 @@ impl AssetLoader for BufferAssetLoader { type Settings = (); type Error = BufferAssetLoaderError; - async fn load<'a>( - &'a self, - reader: &'a mut Reader<'_>, - _settings: &'a (), - _load_context: &'a mut LoadContext<'_>, + async fn load( + &self, + reader: &mut dyn Reader, + _settings: &(), + _load_context: &mut LoadContext<'_>, ) -> Result { let mut bytes = Vec::new(); reader.read_to_end(&mut bytes).await?;