Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update bevy to 0.12.0 and update breaking changes #46

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

HParker
Copy link

@HParker HParker commented Nov 29, 2023

👋 Hey thanks for the great project!

I want to try it out and I started with Bevy 0.12.0, so I took the liberty of updating this library to use bevy 0.12.0 and updated the incompatible APIs.

src/lib.rs Outdated
/// .run()
/// ```
#[allow(dead_code)]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why exactly is this lint here? Just asking.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think sample_rate only gets set via the tests.

without this Rust reports,

warning: field `sample_rate` is never read
  --> src/lib.rs:56:5
   |
55 | pub struct DspPlugin {
   |            --------- field in this struct
56 |     sample_rate: f32,
   |     ^^^^^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

Let me know if there is another or better way to resolve this warning.

src/lib.rs Outdated
@@ -88,8 +87,8 @@ impl Default for DspPlugin {

impl Plugin for DspPlugin {
fn build(&self, app: &mut App) {
app.insert_resource(DspManager::new(self.sample_rate))
.add_asset::<DspSource>();
app.init_resource::<DspManager>()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is init_resource used instead of insert_resource?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this ❤️. I thought insert_resource was deprecated, but only add_asset was. This also works with insert_resource so I will switch it back.

@HParker HParker force-pushed the update-for-bevy-0.12.0 branch from ef4ce3a to cdf81a3 Compare November 29, 2023 16:16
@HParker
Copy link
Author

HParker commented Nov 29, 2023

I updated Kira as well since it already supports Bevy 0.12.0. Looks like oddio might need a patch to support bevy 0.12.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants