Skip to content

Commit

Permalink
implement Reflect for Fxaa (bevyengine#7527)
Browse files Browse the repository at this point in the history
- public components and resources should implement `Reflect` if possible

- derive `Reflect`
  • Loading branch information
jakobhellermann authored and myreprise1 committed Feb 15, 2023
1 parent 81c5456 commit 0c74b80
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions crates/bevy_fxaa/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ use bevy_asset::{load_internal_asset, HandleUntyped};
use bevy_derive::Deref;
use bevy_ecs::prelude::*;
use bevy_fullscreen_vertex_shader::fullscreen_shader_vertex_state;
use bevy_reflect::TypeUuid;
use bevy_reflect::{
std_traits::ReflectDefault, FromReflect, Reflect, ReflectFromReflect, TypeUuid,
};
use bevy_render::{
extract_component::{ExtractComponent, ExtractComponentPlugin},
prelude::Camera,
Expand All @@ -19,7 +21,8 @@ mod node;

pub use node::FxaaNode;

#[derive(Eq, PartialEq, Hash, Clone, Copy)]
#[derive(Reflect, FromReflect, Eq, PartialEq, Hash, Clone, Copy)]
#[reflect(FromReflect, PartialEq, Hash)]
pub enum Sensitivity {
Low,
Medium,
Expand All @@ -40,7 +43,8 @@ impl Sensitivity {
}
}

#[derive(Component, Clone, ExtractComponent)]
#[derive(Reflect, FromReflect, Component, Clone, ExtractComponent)]
#[reflect(Component, FromReflect, Default)]
#[extract_component_filter(With<Camera>)]
pub struct Fxaa {
/// Enable render passes for FXAA.
Expand Down

0 comments on commit 0c74b80

Please sign in to comment.