mirror of
https://github.com/FyroxEngine/Fyrox.git
synced 2026-10-11 22:50:08 +00:00
cargo fmt
This commit is contained in:
@@ -35,8 +35,7 @@ use fyrox_core::algebra::{Quaternion, UnitQuaternion};
|
||||
|
||||
/// The kind of track output value, the animation system works only with numeric properties and the number
|
||||
/// of variants is small.
|
||||
#[derive(Clone, Copy, Debug, Visit, Reflect, PartialEq, Eq)]
|
||||
#[derive(Default)]
|
||||
#[derive(Clone, Copy, Debug, Visit, Reflect, PartialEq, Eq, Default)]
|
||||
pub enum TrackValueKind {
|
||||
/// A real number. Requires only 1 parametric curve.
|
||||
Real,
|
||||
@@ -79,7 +78,6 @@ impl TrackValueKind {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Interpolation mode for track data.
|
||||
#[derive(Visit, Reflect, Debug, Clone, Default, PartialEq)]
|
||||
pub enum InterpolationMode {
|
||||
|
||||
@@ -46,8 +46,9 @@ pub trait SpriteSheetTexture: PartialEq + Clone + Visit + Reflect {}
|
||||
impl<T: PartialEq + Clone + Visit + Reflect> SpriteSheetTexture for T {}
|
||||
|
||||
/// Animation playback status.
|
||||
#[derive(Visit, Reflect, Copy, Clone, Eq, PartialEq, Debug, AsRefStr, EnumString, VariantNames)]
|
||||
#[derive(Default)]
|
||||
#[derive(
|
||||
Visit, Reflect, Copy, Clone, Eq, PartialEq, Debug, AsRefStr, EnumString, VariantNames, Default,
|
||||
)]
|
||||
pub enum Status {
|
||||
/// Animation is playing.
|
||||
Playing,
|
||||
@@ -63,7 +64,6 @@ pub enum Status {
|
||||
|
||||
uuid_provider!(Status = "74a31122-a7a8-476c-ab87-77e53cf0523c");
|
||||
|
||||
|
||||
/// Some animation event.
|
||||
#[derive(Visit, Reflect, Clone, Debug, Eq, PartialEq)]
|
||||
#[non_exhaustive]
|
||||
|
||||
@@ -38,8 +38,7 @@ use std::{
|
||||
};
|
||||
|
||||
/// An actual type of a property value.
|
||||
#[derive(Visit, Reflect, Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
||||
#[derive(Default)]
|
||||
#[derive(Visit, Reflect, Clone, Copy, Debug, PartialEq, Eq, Hash, Default)]
|
||||
pub enum ValueType {
|
||||
/// `bool`
|
||||
Bool,
|
||||
@@ -194,7 +193,6 @@ impl ValueType {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// A real value that can be produced by an animation track. Animations always operate on real numbers (`f32`) for any kind
|
||||
/// of machine numeric types (including `bool`). This is needed to be able to blend values; final blending result is then
|
||||
/// converted to an actual machine type of a target property.
|
||||
|
||||
@@ -248,8 +248,7 @@ impl<Pos, Ter, Pat> Deref for HashConstraintMap<Pos, Ter, Pat> {
|
||||
}
|
||||
|
||||
/// The ways in which a cell's choice of tile can be constrained.
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Default)]
|
||||
#[derive(Debug, Clone, Default)]
|
||||
pub enum TileConstraint<T, P> {
|
||||
/// No constraint. This means that the cell is outside of the area of consideration
|
||||
/// for the autotiler, such as beyond the edge of the world. Cells with this constraint
|
||||
@@ -264,7 +263,6 @@ pub enum TileConstraint<T, P> {
|
||||
Pattern(P),
|
||||
}
|
||||
|
||||
|
||||
impl<T, P> Default for &TileConstraint<T, P> {
|
||||
fn default() -> Self {
|
||||
&TileConstraint::None
|
||||
|
||||
@@ -668,8 +668,8 @@ impl Default for Model {
|
||||
AsRefStr,
|
||||
EnumString,
|
||||
VariantNames,
|
||||
Default,
|
||||
)]
|
||||
#[derive(Default)]
|
||||
pub enum MaterialSearchOptions {
|
||||
/// Search in specified materials directory. It is suitable for cases when
|
||||
/// your model resource use shared textures.
|
||||
@@ -709,7 +709,6 @@ pub enum MaterialSearchOptions {
|
||||
|
||||
uuid_provider!(MaterialSearchOptions = "11634aa0-cf8f-4532-a8cd-c0fa6ef804f1");
|
||||
|
||||
|
||||
impl MaterialSearchOptions {
|
||||
/// A helper to create MaterialsDirectory variant.
|
||||
pub fn materials_directory<P: AsRef<Path>>(path: P) -> Self {
|
||||
|
||||
@@ -70,7 +70,6 @@ pub enum VertexAttributeDataType {
|
||||
U8,
|
||||
}
|
||||
|
||||
|
||||
impl VertexAttributeDataType {
|
||||
/// Returns size of data in bytes.
|
||||
pub fn size(self) -> u8 {
|
||||
@@ -138,7 +137,6 @@ pub enum VertexAttributeUsage {
|
||||
Count,
|
||||
}
|
||||
|
||||
|
||||
/// Input vertex attribute descriptor used to construct layouts and feed vertex buffer.
|
||||
#[derive(Debug, Hash)]
|
||||
pub struct VertexAttributeDescriptor {
|
||||
|
||||
@@ -84,7 +84,6 @@ pub enum RigidBodyType {
|
||||
|
||||
uuid_provider!(RigidBodyType = "562d2907-1b41-483a-8ca2-12eebaff7f5d");
|
||||
|
||||
|
||||
impl From<dynamics::RigidBodyType> for RigidBodyType {
|
||||
fn from(s: dynamics::RigidBodyType) -> Self {
|
||||
match s {
|
||||
|
||||
@@ -31,8 +31,7 @@ use crate::{
|
||||
};
|
||||
|
||||
/// Defines exact behavior of the composite node.
|
||||
#[derive(Debug, PartialEq, Visit, Eq, Clone)]
|
||||
#[derive(Default)]
|
||||
#[derive(Debug, PartialEq, Visit, Eq, Clone, Default)]
|
||||
pub enum CompositeNodeKind {
|
||||
/// `Sequence` node will execute children nodes consecutively
|
||||
/// until `Status::Failure` is returned from any descendant node. In other words `Sequence`
|
||||
@@ -45,7 +44,6 @@ pub enum CompositeNodeKind {
|
||||
Selector,
|
||||
}
|
||||
|
||||
|
||||
/// See module docs.
|
||||
#[derive(Debug, PartialEq, Visit, Eq, Clone)]
|
||||
pub struct CompositeNode<B>
|
||||
|
||||
@@ -74,8 +74,7 @@ pub struct StreamingBuffer {
|
||||
streaming_source: StreamingSource,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Default)]
|
||||
#[derive(Debug, Default)]
|
||||
enum StreamingSource {
|
||||
#[default]
|
||||
Null,
|
||||
@@ -83,7 +82,6 @@ enum StreamingSource {
|
||||
Raw(Box<dyn RawStreamingDataSource>),
|
||||
}
|
||||
|
||||
|
||||
impl StreamingSource {
|
||||
#[inline]
|
||||
fn new(data_source: DataSource) -> Result<Self, SoundError> {
|
||||
|
||||
@@ -103,7 +103,6 @@ pub enum DistanceModel {
|
||||
|
||||
uuid_provider!(DistanceModel = "957f3b00-3f89-438c-b1b7-e841e8d75ba9");
|
||||
|
||||
|
||||
/// See module docs.
|
||||
#[derive(Clone, Default, Debug, Visit)]
|
||||
pub struct SoundContext {
|
||||
|
||||
@@ -45,8 +45,7 @@ pub mod hrtf;
|
||||
// This "large size difference" is not a problem because renderer
|
||||
// can be only one at a time on context.
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
#[derive(Debug, Clone, AsRefStr, EnumString, VariantNames, Visit, Reflect)]
|
||||
#[derive(Default)]
|
||||
#[derive(Debug, Clone, AsRefStr, EnumString, VariantNames, Visit, Reflect, Default)]
|
||||
pub enum Renderer {
|
||||
/// Stateless default renderer.
|
||||
#[default]
|
||||
@@ -59,7 +58,6 @@ pub enum Renderer {
|
||||
|
||||
uuid_provider!(Renderer = "13bf8432-987a-4216-b6aa-f5c0e8914a31");
|
||||
|
||||
|
||||
fn render_with_params(
|
||||
source: &mut SoundSource,
|
||||
left_gain: f32,
|
||||
|
||||
@@ -889,7 +889,6 @@ pub enum TextureMagnificationFilter {
|
||||
|
||||
uuid_provider!(TextureMagnificationFilter = "824f5b6c-8957-42db-9ebc-ef2a5dece5ab");
|
||||
|
||||
|
||||
/// The texture minifying function is used whenever the pixel being textured maps to an area
|
||||
/// greater than one texture element.
|
||||
#[derive(
|
||||
@@ -958,7 +957,6 @@ impl TextureMinificationFilter {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Defines a law of texture coordinate modification.
|
||||
#[derive(
|
||||
Copy,
|
||||
@@ -1005,7 +1003,6 @@ pub enum TextureWrapMode {
|
||||
|
||||
uuid_provider!(TextureWrapMode = "e360d139-4374-4323-a66d-d192809d9d87");
|
||||
|
||||
|
||||
/// Texture kind defines pixel format of texture.
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Debug, Reflect)]
|
||||
#[repr(u32)]
|
||||
@@ -1278,7 +1275,6 @@ pub enum CompressionOptions {
|
||||
|
||||
uuid_provider!(CompressionOptions = "fbdcc081-d0b8-4b62-9925-2de6c013fbf5");
|
||||
|
||||
|
||||
fn transmute_slice<T>(bytes: &[u8]) -> &'_ [T] {
|
||||
// SAFETY: This is absolutely safe because `image` crate's Rgb8/Rgba8/etc. and `tbc`s Rgb8/Rgba8/etc.
|
||||
// have exactly the same memory layout.
|
||||
|
||||
Reference in New Issue
Block a user