Skip to content
Merged
8 changes: 5 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ glam-29 = ["firewheel-core/glam-29"]
glam-30 = ["firewheel-core/glam-30"]
# Enables `glam::Vec2` and `glam::Vec3` parameter derives for glam 0.31.
glam-31 = ["firewheel-core/glam-31"]
# Enables `glam::Vec2` and `glam::Vec3` parameter derives for glam 0.32.
glam-32 = ["firewheel-core/glam-32"]
# Enables the `MIDI` event type, using the `wmidi` crate.
midi_events = ["firewheel-core/midi_events"]
# Enables serde derives for types
Expand Down Expand Up @@ -195,11 +197,11 @@ arrayvec = { version = "0.7", default-features = false }
bitflags = "2"
thunderdome = { version = "0.6", default-features = false }
firewheel-macros = { path = "crates/firewheel-macros", version = "0.10.0" }
bevy_platform = { version = "0.18", default-features = false, features = [
bevy_platform = { version = "0.19.0", default-features = false, features = [
"alloc",
] }
bevy_ecs = { version = "0.18", default-features = false }
bevy_reflect = { version = "0.18", default-features = false }
bevy_ecs = { version = "0.19.0", default-features = false }
bevy_reflect = { version = "0.19.0", default-features = false }
fixed-resample = { version = "0.11.2", default-features = false }
symphonium = { version = "0.11.0", default-features = false, features = ["decode-native"] }
num-traits = { version = "0.2", default-features = false }
Expand Down
7 changes: 6 additions & 1 deletion crates/firewheel-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ std = [
"glam-29?/std",
"glam-30?/std",
"glam-31?/std",
"glam-32?/std",
"portable-atomic/std",
"num-traits/std",
"thiserror/std",
Expand All @@ -61,7 +62,8 @@ libm = [
"num-traits/libm",
"glam-29?/nostd-libm",
"glam-30?/nostd-libm",
"glam-31?/nostd-libm"
"glam-31?/nostd-libm",
"glam-32?/nostd-libm"
]
# Enables scheduling events for audio nodes.
#
Expand Down Expand Up @@ -93,6 +95,8 @@ glam-29 = ["dep:glam-29"]
glam-30 = ["dep:glam-30"]
# Enables `glam::Vec2` and `glam::Vec3` parameter derives for glam 0.31.
glam-31 = ["dep:glam-31"]
# Enables `glam::Vec2` and `glam::Vec3` parameter derives for glam 0.32.
glam-32 = ["dep:glam-32"]
# Enables the `MIDI` event type, using the `wmidi` crate.
midi_events = ["dep:wmidi"]
# Enables serde derives for types
Expand All @@ -116,6 +120,7 @@ audioadapter-sample.workspace = true
glam-29 = { package = "glam", version = "0.29", default-features = false, optional = true }
glam-30 = { package = "glam", version = "0.30", default-features = false, optional = true }
glam-31 = { package = "glam", version = "0.31", default-features = false, optional = true }
glam-32 = { package = "glam", version = "0.32", default-features = false, optional = true }
# TODO: Remove this once `bevy_platform` exposes the atomic float types from `portable-atomic`.
portable-atomic = { version = "1", default-features = false, features = [
"fallback",
Expand Down
20 changes: 20 additions & 0 deletions crates/firewheel-core/src/diff/leaf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,16 @@ primitive_diff!(glam_30::Vec2, Vector2D);
#[cfg(feature = "glam-30")]
primitive_diff!(glam_30::Vec3, Vector3D);

#[cfg(feature = "glam-31")]
primitive_diff!(glam_31::Vec2, Vector2D);
#[cfg(feature = "glam-31")]
primitive_diff!(glam_31::Vec3, Vector3D);

#[cfg(feature = "glam-32")]
primitive_diff!(glam_32::Vec2, Vector2D);
#[cfg(feature = "glam-32")]
primitive_diff!(glam_32::Vec3, Vector3D);

impl<A: ?Sized + Send + Sync + 'static> Diff for ArcGc<A> {
fn diff<E: EventQueue>(&self, baseline: &Self, path: PathBuilder, event_queue: &mut E) {
if !ArcGc::ptr_eq(self, baseline) {
Expand Down Expand Up @@ -376,3 +386,13 @@ non_trivial_notify!(glam_29::Vec3);
non_trivial_notify!(glam_30::Vec2);
#[cfg(feature = "glam-30")]
non_trivial_notify!(glam_30::Vec3);

#[cfg(feature = "glam-31")]
non_trivial_notify!(glam_31::Vec2);
#[cfg(feature = "glam-31")]
non_trivial_notify!(glam_31::Vec3);

#[cfg(feature = "glam-32")]
non_trivial_notify!(glam_32::Vec2);
#[cfg(feature = "glam-32")]
non_trivial_notify!(glam_32::Vec3);
31 changes: 16 additions & 15 deletions crates/firewheel-core/src/diff/notify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ mod reflect {
bevy_reflect::utility::GenericTypeInfoCell::new();
CELL.get_or_insert::<Self, _>(|| {
bevy_reflect::TypeInfo::Struct(
bevy_reflect::StructInfo::new::<Self>(&[
bevy_reflect::structs::StructInfo::new::<Self>(&[
bevy_reflect::NamedField::new::<T>("value").with_custom_attributes(
bevy_reflect::attributes::CustomAttributes::default(),
),
Expand Down Expand Up @@ -401,7 +401,7 @@ mod reflect {
}
}

impl<T> bevy_reflect::Struct for Notify<T>
impl<T> bevy_reflect::prelude::Struct for Notify<T>
where
Notify<T>: ::core::any::Any + ::core::marker::Send + ::core::marker::Sync,
T: Clone
Expand Down Expand Up @@ -449,12 +449,12 @@ mod reflect {
1usize
}

fn iter_fields<'a>(&'a self) -> bevy_reflect::FieldIter<'a> {
bevy_reflect::FieldIter::new(self)
fn iter_fields<'a>(&'a self) -> bevy_reflect::structs::FieldIter<'a> {
bevy_reflect::structs::FieldIter::new(self)
}

fn to_dynamic_struct(&self) -> bevy_reflect::DynamicStruct {
let mut dynamic: bevy_reflect::DynamicStruct = Default::default();
fn to_dynamic_struct(&self) -> bevy_reflect::structs::DynamicStruct {
let mut dynamic: bevy_reflect::structs::DynamicStruct = Default::default();
dynamic.set_represented_type(bevy_reflect::PartialReflect::get_represented_type_info(
self,
));
Expand All @@ -464,6 +464,10 @@ mod reflect {
);
dynamic
}

fn index_of_name(&self, name: &str) -> Option<usize> {
(name == "value").then_some(0)
}
}

impl<T> bevy_reflect::PartialReflect for Notify<T>
Expand All @@ -488,11 +492,8 @@ mod reflect {
if let bevy_reflect::ReflectRef::Struct(struct_value) =
bevy_reflect::PartialReflect::reflect_ref(value)
{
for (i, value) in ::core::iter::Iterator::enumerate(
bevy_reflect::Struct::iter_fields(struct_value),
) {
let name = bevy_reflect::Struct::name_at(struct_value, i).unwrap();
if let Some(v) = bevy_reflect::Struct::field_mut(self, name) {
for (name, value) in struct_value {
if let Some(v) = bevy_reflect::prelude::Struct::field_mut(self, name) {
bevy_reflect::PartialReflect::try_apply(v, value)?;
}
}
Expand Down Expand Up @@ -558,7 +559,7 @@ mod reflect {
}

fn reflect_partial_eq(&self, value: &dyn bevy_reflect::PartialReflect) -> Option<bool> {
(bevy_reflect::struct_partial_eq)(self, value)
(bevy_reflect::structs::struct_partial_eq)(self, value)
}

#[inline]
Expand All @@ -585,9 +586,9 @@ mod reflect {
{
let mut this = <Self as ::core::default::Default>::default();
if let Some(field) = (|| {
<T as bevy_reflect::FromReflect>::from_reflect(bevy_reflect::Struct::field(
ref_struct, "value",
)?)
<T as bevy_reflect::FromReflect>::from_reflect(
bevy_reflect::prelude::Struct::field(ref_struct, "value")?,
)
})() {
this.value = field;
}
Expand Down
10 changes: 10 additions & 0 deletions crates/firewheel-core/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,16 @@ param_data_from!(glam_30::Vec2, Vector2D);
#[cfg(feature = "glam-30")]
param_data_from!(glam_30::Vec3, Vector3D);

#[cfg(feature = "glam-31")]
param_data_from!(glam_31::Vec2, Vector2D);
#[cfg(feature = "glam-31")]
param_data_from!(glam_31::Vec3, Vector3D);

#[cfg(feature = "glam-32")]
param_data_from!(glam_32::Vec2, Vector2D);
#[cfg(feature = "glam-32")]
param_data_from!(glam_32::Vec3, Vector3D);

impl From<()> for ParamData {
fn from(_value: ()) -> Self {
Self::None
Expand Down
28 changes: 28 additions & 0 deletions crates/firewheel-core/src/vector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,31 @@ impl From<Vec3> for glam_31::Vec3 {
Self::new(value.x, value.y, value.z)
}
}

#[cfg(feature = "glam-32")]
impl From<glam_32::Vec2> for Vec2 {
fn from(value: glam_32::Vec2) -> Self {
Self::new(value.x, value.y)
}
}

#[cfg(feature = "glam-32")]
impl From<glam_32::Vec3> for Vec3 {
fn from(value: glam_32::Vec3) -> Self {
Self::new(value.x, value.y, value.z)
}
}

#[cfg(feature = "glam-32")]
impl From<Vec2> for glam_32::Vec2 {
fn from(value: Vec2) -> Self {
Self::new(value.x, value.y)
}
}

#[cfg(feature = "glam-32")]
impl From<Vec3> for glam_32::Vec3 {
fn from(value: Vec3) -> Self {
Self::new(value.x, value.y, value.z)
}
}
2 changes: 1 addition & 1 deletion crates/firewheel-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ proc-macro = true
syn = "2.0"
quote = "1.0"
proc-macro2 = "1.0"
bevy_macro_utils = "0.18"
bevy_macro_utils = "0.19.0"
toml_edit = { version = "0.23.9", default-features = false, features = ["parse"] }
Loading