Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,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 @@ -213,11 +215,11 @@ bitflags = "2"
thunderdome = { version = "0.6", default-features = false }
fast-interleave = "0.1"
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-dev", 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-dev", default-features = false }
bevy_reflect = { version = "0.19.0-dev", default-features = false }
num-traits = { version = "0.2", default-features = false }
serde = { version = "1", features = ["derive"] }
egui = "0.33.3"
Expand Down Expand Up @@ -250,3 +252,20 @@ criterion = "0.7"
[[bench]]
name = "core"
harness = false


[patch."crates-io"]
firewheel = { git = "https://github.com/ChristopherBiscardi/Firewheel", branch = "chris-0.19" }
firewheel-ircam-hrtf = { git = "https://github.com/ChristopherBiscardi/firewheel-ircam-hrtf", branch = "chris-0.19" }
bevy_time = { git = "https://github.com/bevyengine/bevy" }
bevy_transform = { git = "https://github.com/bevyengine/bevy" }
bevy = { git = "https://github.com/bevyengine/bevy" }
bevy_app = { git = "https://github.com/bevyengine/bevy" }
bevy_asset = { git = "https://github.com/bevyengine/bevy" }
bevy_ecs = { git = "https://github.com/bevyengine/bevy" }
bevy_log = { git = "https://github.com/bevyengine/bevy" }
bevy_math = { git = "https://github.com/bevyengine/bevy" }
bevy_platform = { git = "https://github.com/bevyengine/bevy" }
bevy_reflect = { git = "https://github.com/bevyengine/bevy" }
bevy_macro_utils = { git = "https://github.com/bevyengine/bevy" }
rtgc = { git = "https://codeberg.org/chrisbiscardi/rtgc", branch = "chris-0.19" }
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 @@ -60,7 +61,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 @@ -92,6 +94,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 @@ -112,6 +116,7 @@ bevy_reflect = { workspace = true, optional = 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 @@ -150,6 +150,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 @@ -483,3 +493,13 @@ trivial_notify!(glam_29::Vec3);
trivial_notify!(glam_30::Vec2);
#[cfg(feature = "glam-30")]
trivial_notify!(glam_30::Vec3);

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

#[cfg(feature = "glam-32")]
trivial_notify!(glam_32::Vec2);
#[cfg(feature = "glam-32")]
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 @@ -231,7 +231,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 @@ -340,7 +340,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 @@ -388,12 +388,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 @@ -403,6 +403,10 @@ mod reflect {
);
dynamic
}

fn index_of_name(&self, name: &str) -> Option<usize> {
todo!("index_of_name is a new function");
}
}

impl<T> bevy_reflect::PartialReflect for Notify<T>
Expand All @@ -427,11 +431,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 @@ -497,7 +498,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 @@ -524,9 +525,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 @@ -323,6 +323,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-dev"
toml_edit = { version = "0.23.9", default-features = false, features = ["parse"] }