mirror of
https://github.com/FyroxEngine/Fyrox.git
synced 2026-10-11 22:50:08 +00:00
handle non-exhaustive enums in Visit proc-macro correctly
This commit is contained in:
@@ -20,11 +20,7 @@
|
|||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
fyrox::{
|
fyrox::{
|
||||||
core::{
|
core::{algebra::Vector2, pool::Handle, visitor::prelude::*},
|
||||||
algebra::Vector2,
|
|
||||||
pool::Handle,
|
|
||||||
visitor::{Visit, VisitResult, Visitor},
|
|
||||||
},
|
|
||||||
gui::{
|
gui::{
|
||||||
border::BorderBuilder,
|
border::BorderBuilder,
|
||||||
button::{ButtonBuilder, ButtonMessage},
|
button::{ButtonBuilder, ButtonMessage},
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ use crate::{
|
|||||||
pool::{ErasedHandle, Handle, Pool, Ticket},
|
pool::{ErasedHandle, Handle, Pool, Ticket},
|
||||||
reflect::prelude::*,
|
reflect::prelude::*,
|
||||||
uuid::{uuid, Uuid},
|
uuid::{uuid, Uuid},
|
||||||
visitor::{Visit, VisitResult, Visitor},
|
visitor::prelude::*,
|
||||||
ImmutableString, NameProvider,
|
ImmutableString, NameProvider,
|
||||||
},
|
},
|
||||||
track::Track,
|
track::Track,
|
||||||
|
|||||||
@@ -26,10 +26,7 @@
|
|||||||
#![warn(missing_docs)]
|
#![warn(missing_docs)]
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
core::{
|
core::{reflect::prelude::*, visitor::prelude::*},
|
||||||
reflect::prelude::*,
|
|
||||||
visitor::{Visit, VisitResult, Visitor},
|
|
||||||
},
|
|
||||||
Animation, AnimationContainer, AnimationPose, EntityId,
|
Animation, AnimationContainer, AnimationPose, EntityId,
|
||||||
};
|
};
|
||||||
use fxhash::FxHashSet;
|
use fxhash::FxHashSet;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ use crate::{
|
|||||||
core::{
|
core::{
|
||||||
pool::{Handle, Pool},
|
pool::{Handle, Pool},
|
||||||
reflect::prelude::*,
|
reflect::prelude::*,
|
||||||
visitor::{Visit, VisitResult, Visitor},
|
visitor::prelude::*,
|
||||||
},
|
},
|
||||||
machine::{
|
machine::{
|
||||||
node::AnimationEventCollectionStrategy, node::BasePoseNode, AnimationPoseSource, Parameter,
|
node::AnimationEventCollectionStrategy, node::BasePoseNode, AnimationPoseSource, Parameter,
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ use syn::{parse_macro_input, DeriveInput};
|
|||||||
/// For example,
|
/// For example,
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// use fyrox_core::visitor::{Visit, VisitResult, Visitor};
|
/// use fyrox_core::visitor::prelude::*;
|
||||||
/// #[derive(Visit)]
|
/// #[derive(Visit)]
|
||||||
/// struct Foo<T: Visit> {
|
/// struct Foo<T: Visit> {
|
||||||
/// example_one: String,
|
/// example_one: String,
|
||||||
@@ -49,7 +49,7 @@ use syn::{parse_macro_input, DeriveInput};
|
|||||||
/// would expand to something like:
|
/// would expand to something like:
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// # use fyrox_core::visitor::{Visit, VisitResult, Visitor};
|
/// # use fyrox_core::visitor::prelude::*;
|
||||||
/// # struct Foo<T> { example_one: String, example_two: T,}
|
/// # struct Foo<T> { example_one: String, example_two: T,}
|
||||||
/// impl<T> Visit for Foo<T> where T: Visit {
|
/// impl<T> Visit for Foo<T> where T: Visit {
|
||||||
/// fn visit(&mut self, name: &str, visitor: &mut Visitor) -> VisitResult {
|
/// fn visit(&mut self, name: &str, visitor: &mut Visitor) -> VisitResult {
|
||||||
@@ -66,7 +66,7 @@ use syn::{parse_macro_input, DeriveInput};
|
|||||||
/// [to_case(Case::UpperCamel)](https://docs.rs/convert_case/0.6.0/convert_case/enum.Case.html#variant.Pascal).
|
/// [to_case(Case::UpperCamel)](https://docs.rs/convert_case/0.6.0/convert_case/enum.Case.html#variant.Pascal).
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// # use fyrox_core::visitor::{Visit, VisitResult, Visitor};
|
/// # use fyrox_core::visitor::prelude::*;
|
||||||
/// #[derive(Visit)]
|
/// #[derive(Visit)]
|
||||||
/// struct Pair (usize, usize);
|
/// struct Pair (usize, usize);
|
||||||
/// # fn main() {}
|
/// # fn main() {}
|
||||||
@@ -75,7 +75,7 @@ use syn::{parse_macro_input, DeriveInput};
|
|||||||
/// would expand to something like:
|
/// would expand to something like:
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// # use fyrox_core::visitor::{Visit, VisitResult, Visitor};
|
/// # use fyrox_core::visitor::prelude::*;
|
||||||
/// # struct Pair (usize, usize);
|
/// # struct Pair (usize, usize);
|
||||||
/// impl Visit for Pair {
|
/// impl Visit for Pair {
|
||||||
/// fn visit(&mut self, name: &str, visitor: &mut Visitor) -> VisitResult {
|
/// fn visit(&mut self, name: &str, visitor: &mut Visitor) -> VisitResult {
|
||||||
@@ -89,7 +89,7 @@ use syn::{parse_macro_input, DeriveInput};
|
|||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// # use fyrox_core::visitor::{Visit, VisitResult, Visitor};
|
/// # use fyrox_core::visitor::prelude::*;
|
||||||
/// #[derive(Visit)]
|
/// #[derive(Visit)]
|
||||||
/// enum EnumExample { A, B(usize) }
|
/// enum EnumExample { A, B(usize) }
|
||||||
/// # fn main() {}
|
/// # fn main() {}
|
||||||
@@ -98,7 +98,7 @@ use syn::{parse_macro_input, DeriveInput};
|
|||||||
/// would expand to something like:
|
/// would expand to something like:
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// # use fyrox_core::visitor::{Visit, VisitResult, Visitor};
|
/// # use fyrox_core::visitor::prelude::*;
|
||||||
/// # enum EnumExample { A, B(usize) }
|
/// # enum EnumExample { A, B(usize) }
|
||||||
/// impl Visit for EnumExample {
|
/// impl Visit for EnumExample {
|
||||||
/// fn visit(&mut self, name: &str, visitor: &mut Visitor) -> VisitResult {
|
/// fn visit(&mut self, name: &str, visitor: &mut Visitor) -> VisitResult {
|
||||||
|
|||||||
@@ -255,6 +255,7 @@ fn impl_visit_enum(ty_args: &args::TypeArgs, variant_args: &[args::VariantArgs])
|
|||||||
|
|
||||||
match self {
|
match self {
|
||||||
#(#variant_visits)*
|
#(#variant_visits)*
|
||||||
|
_ => return Err(VisitError::UnhandledEnumVariant)
|
||||||
}
|
}
|
||||||
|
|
||||||
return Ok(());
|
return Ok(());
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
algebra::{Vector3, Vector4},
|
algebra::{Vector3, Vector4},
|
||||||
reflect::prelude::*,
|
reflect::prelude::*,
|
||||||
visitor::{Visit, VisitResult, Visitor},
|
visitor::prelude::*,
|
||||||
};
|
};
|
||||||
use bytemuck::{Pod, Zeroable};
|
use bytemuck::{Pod, Zeroable};
|
||||||
use num_traits::Zero;
|
use num_traits::Zero;
|
||||||
|
|||||||
@@ -18,11 +18,7 @@
|
|||||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
// SOFTWARE.
|
// SOFTWARE.
|
||||||
|
|
||||||
use crate::{
|
use crate::{color::Color, reflect::prelude::*, visitor::prelude::*};
|
||||||
color::Color,
|
|
||||||
reflect::prelude::*,
|
|
||||||
visitor::{Visit, VisitResult, Visitor},
|
|
||||||
};
|
|
||||||
use std::cmp::Ordering;
|
use std::cmp::Ordering;
|
||||||
|
|
||||||
#[derive(PartialEq, Debug, Visit, Reflect)]
|
#[derive(PartialEq, Debug, Visit, Reflect)]
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ pub use rand;
|
|||||||
pub use sstorage::ImmutableString;
|
pub use sstorage::ImmutableString;
|
||||||
pub use uuid;
|
pub use uuid;
|
||||||
|
|
||||||
use crate::visitor::{Visit, VisitResult, Visitor};
|
use crate::visitor::prelude::*;
|
||||||
use bytemuck::Pod;
|
use bytemuck::Pod;
|
||||||
use fxhash::FxHashMap;
|
use fxhash::FxHashMap;
|
||||||
pub use safelock::*;
|
pub use safelock::*;
|
||||||
|
|||||||
@@ -23,11 +23,7 @@
|
|||||||
|
|
||||||
#![warn(missing_docs)]
|
#![warn(missing_docs)]
|
||||||
|
|
||||||
use crate::{
|
use crate::{parking_lot::Mutex, visitor::prelude::*, SafeLock};
|
||||||
parking_lot::Mutex,
|
|
||||||
visitor::{Visit, VisitResult, Visitor},
|
|
||||||
SafeLock,
|
|
||||||
};
|
|
||||||
use fxhash::{FxHashMap, FxHasher};
|
use fxhash::{FxHashMap, FxHasher};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::{
|
use std::{
|
||||||
|
|||||||
@@ -102,6 +102,9 @@ pub enum VisitError {
|
|||||||
UuidError(uuid::Error),
|
UuidError(uuid::Error),
|
||||||
/// Arbitrary error.
|
/// Arbitrary error.
|
||||||
Any(Box<dyn Error + Send + Sync>),
|
Any(Box<dyn Error + Send + Sync>),
|
||||||
|
/// Unhandled enum variant. Typically, means that a match arm of non-exhaustive pattern is not
|
||||||
|
/// handled.
|
||||||
|
UnhandledEnumVariant,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Error for VisitError {}
|
impl Error for VisitError {}
|
||||||
@@ -171,6 +174,9 @@ impl Display for VisitError {
|
|||||||
Self::Any(e) => {
|
Self::Any(e) => {
|
||||||
write!(f, "{e}")
|
write!(f, "{e}")
|
||||||
}
|
}
|
||||||
|
VisitError::UnhandledEnumVariant => {
|
||||||
|
write!(f, "unhandled enum variant")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -829,7 +829,7 @@ impl Visitor {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use crate::visitor::{BinaryBlob, Visit, VisitResult, Visitor};
|
use crate::visitor::{prelude::*, BinaryBlob};
|
||||||
use nalgebra::{
|
use nalgebra::{
|
||||||
Matrix2, Matrix3, Matrix4, UnitComplex, UnitQuaternion, Vector2, Vector3, Vector4,
|
Matrix2, Matrix3, Matrix4, UnitComplex, UnitQuaternion, Vector2, Vector3, Vector4,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ use crate::{
|
|||||||
uuid::Uuid,
|
uuid::Uuid,
|
||||||
variable::InheritableVariable,
|
variable::InheritableVariable,
|
||||||
visitor::error::VisitError,
|
visitor::error::VisitError,
|
||||||
visitor::{Visit, VisitResult, Visitor},
|
visitor::prelude::*,
|
||||||
NameProvider,
|
NameProvider,
|
||||||
},
|
},
|
||||||
engine::SerializationContext,
|
engine::SerializationContext,
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ use crate::{
|
|||||||
pool::{ErasedHandle, Handle},
|
pool::{ErasedHandle, Handle},
|
||||||
reflect::prelude::*,
|
reflect::prelude::*,
|
||||||
variable::InheritableVariable,
|
variable::InheritableVariable,
|
||||||
visitor::{Visit, VisitResult, Visitor},
|
visitor::prelude::*,
|
||||||
ImmutableString,
|
ImmutableString,
|
||||||
},
|
},
|
||||||
engine::SerializationContext,
|
engine::SerializationContext,
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ use crate::{
|
|||||||
reflect::prelude::*,
|
reflect::prelude::*,
|
||||||
uuid::{uuid, Uuid},
|
uuid::{uuid, Uuid},
|
||||||
variable::InheritableVariable,
|
variable::InheritableVariable,
|
||||||
visitor::{Visit, VisitResult, Visitor},
|
visitor::prelude::*,
|
||||||
},
|
},
|
||||||
graph::SceneGraph,
|
graph::SceneGraph,
|
||||||
resource::texture::{
|
resource::texture::{
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ use crate::{
|
|||||||
math::{aabb::AxisAlignedBoundingBox, Matrix4Ext},
|
math::{aabb::AxisAlignedBoundingBox, Matrix4Ext},
|
||||||
pool::{Handle, MultiBorrowContext, ObjectOrVariant, Pool, PoolError, Ticket},
|
pool::{Handle, MultiBorrowContext, ObjectOrVariant, Pool, PoolError, Ticket},
|
||||||
reflect::prelude::*,
|
reflect::prelude::*,
|
||||||
visitor::{Visit, VisitResult, Visitor},
|
visitor::prelude::*,
|
||||||
},
|
},
|
||||||
graph::{NodeHandleMap, NodeWrapper, SceneGraph},
|
graph::{NodeHandleMap, NodeWrapper, SceneGraph},
|
||||||
material::{MaterialResourceBinding, MaterialTextureBinding},
|
material::{MaterialResourceBinding, MaterialTextureBinding},
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ use crate::{
|
|||||||
reflect::prelude::*,
|
reflect::prelude::*,
|
||||||
uuid::{uuid, Uuid},
|
uuid::{uuid, Uuid},
|
||||||
variable::InheritableVariable,
|
variable::InheritableVariable,
|
||||||
visitor::{Visit, VisitResult, Visitor},
|
visitor::prelude::*,
|
||||||
},
|
},
|
||||||
scene::{
|
scene::{
|
||||||
base::{Base, BaseBuilder},
|
base::{Base, BaseBuilder},
|
||||||
|
|||||||
@@ -38,11 +38,8 @@
|
|||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
core::{
|
core::{
|
||||||
algebra::Vector3,
|
algebra::Vector3, color::Color, reflect::prelude::*, variable::InheritableVariable,
|
||||||
color::Color,
|
visitor::prelude::*,
|
||||||
reflect::prelude::*,
|
|
||||||
variable::InheritableVariable,
|
|
||||||
visitor::{Visit, VisitResult, Visitor},
|
|
||||||
},
|
},
|
||||||
scene::base::{Base, BaseBuilder},
|
scene::base::{Base, BaseBuilder},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ use crate::{
|
|||||||
reflect::prelude::*,
|
reflect::prelude::*,
|
||||||
uuid::{uuid, Uuid},
|
uuid::{uuid, Uuid},
|
||||||
variable::InheritableVariable,
|
variable::InheritableVariable,
|
||||||
visitor::{Visit, VisitResult, Visitor},
|
visitor::prelude::*,
|
||||||
},
|
},
|
||||||
scene::{
|
scene::{
|
||||||
base::Base,
|
base::Base,
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ use crate::{
|
|||||||
reflect::prelude::*,
|
reflect::prelude::*,
|
||||||
uuid::{uuid, Uuid},
|
uuid::{uuid, Uuid},
|
||||||
variable::InheritableVariable,
|
variable::InheritableVariable,
|
||||||
visitor::{Visit, VisitResult, Visitor},
|
visitor::prelude::*,
|
||||||
},
|
},
|
||||||
resource::texture::TextureResource,
|
resource::texture::TextureResource,
|
||||||
scene::{
|
scene::{
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ use crate::{
|
|||||||
reflect::prelude::*,
|
reflect::prelude::*,
|
||||||
sparse::AtomicIndex,
|
sparse::AtomicIndex,
|
||||||
variable::InheritableVariable,
|
variable::InheritableVariable,
|
||||||
visitor::{Visit, VisitResult, Visitor},
|
visitor::prelude::*,
|
||||||
},
|
},
|
||||||
material::{Material, MaterialResource, MaterialResourceExtension},
|
material::{Material, MaterialResource, MaterialResourceExtension},
|
||||||
resource::texture::{TextureKind, TexturePixelKind, TextureResource, TextureResourceExtension},
|
resource::texture::{TextureKind, TexturePixelKind, TextureResource, TextureResourceExtension},
|
||||||
|
|||||||
@@ -22,12 +22,7 @@
|
|||||||
//! control over instantiation process at deserialization.
|
//! control over instantiation process at deserialization.
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
core::{
|
core::{pool::PayloadContainer, reflect::prelude::*, uuid::Uuid, visitor::prelude::*},
|
||||||
pool::PayloadContainer,
|
|
||||||
reflect::prelude::*,
|
|
||||||
uuid::Uuid,
|
|
||||||
visitor::{Visit, VisitResult, Visitor},
|
|
||||||
},
|
|
||||||
engine::SerializationContext,
|
engine::SerializationContext,
|
||||||
scene::node::Node,
|
scene::node::Node,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ use crate::{
|
|||||||
uuid::Uuid,
|
uuid::Uuid,
|
||||||
variable,
|
variable,
|
||||||
variable::mark_inheritable_properties_non_modified,
|
variable::mark_inheritable_properties_non_modified,
|
||||||
visitor::{Visit, VisitResult, Visitor},
|
visitor::prelude::*,
|
||||||
NameProvider,
|
NameProvider,
|
||||||
},
|
},
|
||||||
graph::NodeWrapper,
|
graph::NodeWrapper,
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ use crate::{
|
|||||||
uuid::{uuid, Uuid},
|
uuid::{uuid, Uuid},
|
||||||
value_as_u8_slice,
|
value_as_u8_slice,
|
||||||
variable::InheritableVariable,
|
variable::InheritableVariable,
|
||||||
visitor::{Visit, VisitResult, Visitor},
|
visitor::prelude::*,
|
||||||
},
|
},
|
||||||
graph::{constructor::ConstructorProvider, SceneGraph},
|
graph::{constructor::ConstructorProvider, SceneGraph},
|
||||||
material::{Material, MaterialResource},
|
material::{Material, MaterialResource},
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ use crate::core::{
|
|||||||
log::{Log, MessageKind},
|
log::{Log, MessageKind},
|
||||||
reflect::prelude::*,
|
reflect::prelude::*,
|
||||||
variable::InheritableVariable,
|
variable::InheritableVariable,
|
||||||
visitor::{Visit, VisitResult, Visitor},
|
visitor::prelude::*,
|
||||||
};
|
};
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ use crate::{
|
|||||||
pool::{Handle, PoolError},
|
pool::{Handle, PoolError},
|
||||||
reflect::prelude::*,
|
reflect::prelude::*,
|
||||||
uuid::Uuid,
|
uuid::Uuid,
|
||||||
visitor::{Visit, VisitResult, Visitor},
|
visitor::prelude::*,
|
||||||
},
|
},
|
||||||
engine::{input::InputState, task::TaskPoolHandler, GraphicsContext, ScriptMessageDispatcher},
|
engine::{input::InputState, task::TaskPoolHandler, GraphicsContext, ScriptMessageDispatcher},
|
||||||
event::Event,
|
event::Event,
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ use crate::{
|
|||||||
arrayvec::ArrayVec,
|
arrayvec::ArrayVec,
|
||||||
math::{self, plane::Plane, ray::Ray, PositionProvider, TriangleDefinition, Vector3Ext},
|
math::{self, plane::Plane, ray::Ray, PositionProvider, TriangleDefinition, Vector3Ext},
|
||||||
reflect::prelude::*,
|
reflect::prelude::*,
|
||||||
visitor::{Visit, VisitResult, Visitor},
|
visitor::prelude::*,
|
||||||
},
|
},
|
||||||
scene::mesh::{
|
scene::mesh::{
|
||||||
buffer::{VertexAttributeUsage, VertexReadTrait},
|
buffer::{VertexAttributeUsage, VertexReadTrait},
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ impl ResourceConstructorContainer {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use fyrox_core::reflect::prelude::*;
|
use fyrox_core::reflect::prelude::*;
|
||||||
use fyrox_core::visitor::{Visit, VisitResult, Visitor};
|
use fyrox_core::visitor::prelude::*;
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
|
|||||||
@@ -2092,7 +2092,7 @@ mod test {
|
|||||||
};
|
};
|
||||||
use fyrox_core::{
|
use fyrox_core::{
|
||||||
uuid::{uuid, Uuid},
|
uuid::{uuid, Uuid},
|
||||||
visitor::{Visit, VisitResult, Visitor},
|
visitor::prelude::*,
|
||||||
};
|
};
|
||||||
use std::{error::Error, fs::File, time::Duration};
|
use std::{error::Error, fs::File, time::Duration};
|
||||||
|
|
||||||
|
|||||||
@@ -27,10 +27,7 @@
|
|||||||
//! description of each filter. There is no need to describe them all here.
|
//! description of each filter. There is no need to describe them all here.
|
||||||
|
|
||||||
use crate::dsp::DelayLine;
|
use crate::dsp::DelayLine;
|
||||||
use fyrox_core::{
|
use fyrox_core::{reflect::prelude::*, visitor::prelude::*};
|
||||||
reflect::prelude::*,
|
|
||||||
visitor::{Visit, VisitResult, Visitor},
|
|
||||||
};
|
|
||||||
|
|
||||||
/// One-pole Filter.
|
/// One-pole Filter.
|
||||||
/// For details see - <https://www.earlevel.com/main/2012/12/15/a-one-pole-filter/>
|
/// For details see - <https://www.earlevel.com/main/2012/12/15/a-one-pole-filter/>
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
//! `fc` - normalized frequency, i.e. `fc = 0.2` with `sample rate = 44100 Hz` will be `f = 8820 Hz`
|
//! `fc` - normalized frequency, i.e. `fc = 0.2` with `sample rate = 44100 Hz` will be `f = 8820 Hz`
|
||||||
|
|
||||||
use fyrox_core::visitor::pod::PodVecView;
|
use fyrox_core::visitor::pod::PodVecView;
|
||||||
use fyrox_core::visitor::{Visit, VisitResult, Visitor};
|
use fyrox_core::visitor::prelude::*;
|
||||||
|
|
||||||
pub mod filters;
|
pub mod filters;
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
//! Sound engine manages contexts, feeds output device with data.
|
//! Sound engine manages contexts, feeds output device with data.
|
||||||
|
|
||||||
use crate::context::SoundContext;
|
use crate::context::SoundContext;
|
||||||
use fyrox_core::visitor::{Visit, VisitResult, Visitor};
|
use fyrox_core::visitor::prelude::*;
|
||||||
use fyrox_core::SafeLock;
|
use fyrox_core::SafeLock;
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
use std::sync::{Arc, Mutex, MutexGuard};
|
use std::sync::{Arc, Mutex, MutexGuard};
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ use fyrox_core::{
|
|||||||
log::Log,
|
log::Log,
|
||||||
reflect::prelude::*,
|
reflect::prelude::*,
|
||||||
uuid::{uuid, Uuid},
|
uuid::{uuid, Uuid},
|
||||||
visitor::{Visit, VisitResult, Visitor},
|
visitor::prelude::*,
|
||||||
};
|
};
|
||||||
use fyrox_resource::untyped::ResourceKind;
|
use fyrox_resource::untyped::ResourceKind;
|
||||||
use fyrox_resource::{
|
use fyrox_resource::{
|
||||||
|
|||||||
@@ -32,10 +32,7 @@ use crate::{
|
|||||||
source::SoundSource,
|
source::SoundSource,
|
||||||
};
|
};
|
||||||
use fyrox_core::math::lerpf;
|
use fyrox_core::math::lerpf;
|
||||||
use fyrox_core::{
|
use fyrox_core::{reflect::prelude::*, visitor::prelude::*};
|
||||||
reflect::prelude::*,
|
|
||||||
visitor::{Visit, VisitResult, Visitor},
|
|
||||||
};
|
|
||||||
use strum_macros::{AsRefStr, EnumString, VariantNames};
|
use strum_macros::{AsRefStr, EnumString, VariantNames};
|
||||||
|
|
||||||
pub mod hrtf;
|
pub mod hrtf;
|
||||||
|
|||||||
@@ -55,12 +55,7 @@ use crate::{
|
|||||||
error::SoundError,
|
error::SoundError,
|
||||||
listener::Listener,
|
listener::Listener,
|
||||||
};
|
};
|
||||||
use fyrox_core::{
|
use fyrox_core::{algebra::Vector3, log::Log, reflect::prelude::*, visitor::prelude::*};
|
||||||
algebra::Vector3,
|
|
||||||
log::Log,
|
|
||||||
reflect::prelude::*,
|
|
||||||
visitor::{Visit, VisitResult, Visitor},
|
|
||||||
};
|
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
/// Status (state) of sound source.
|
/// Status (state) of sound source.
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ use fyrox_core::{
|
|||||||
reflect::prelude::*,
|
reflect::prelude::*,
|
||||||
sparse::AtomicIndex,
|
sparse::AtomicIndex,
|
||||||
uuid::Uuid,
|
uuid::Uuid,
|
||||||
visitor::{Visit, VisitResult, Visitor},
|
visitor::prelude::*,
|
||||||
};
|
};
|
||||||
use fyrox_resource::{
|
use fyrox_resource::{
|
||||||
embedded_data_source, io::ResourceIo, manager::BuiltInResource, options::ImportOptions,
|
embedded_data_source, io::ResourceIo, manager::BuiltInResource, options::ImportOptions,
|
||||||
|
|||||||
@@ -23,12 +23,7 @@
|
|||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
constructor::WidgetConstructorContainer,
|
constructor::WidgetConstructorContainer,
|
||||||
core::{
|
core::{pool::PayloadContainer, reflect::prelude::*, uuid::Uuid, visitor::prelude::*},
|
||||||
pool::PayloadContainer,
|
|
||||||
reflect::prelude::*,
|
|
||||||
uuid::Uuid,
|
|
||||||
visitor::{Visit, VisitResult, Visitor},
|
|
||||||
},
|
|
||||||
UiNode,
|
UiNode,
|
||||||
};
|
};
|
||||||
use fyrox_core::visitor::error::VisitError;
|
use fyrox_core::visitor::error::VisitError;
|
||||||
|
|||||||
Reference in New Issue
Block a user