diff options
Diffstat (limited to 'engine/src/windowing.rs')
| -rw-r--r-- | engine/src/windowing.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/engine/src/windowing.rs b/engine/src/windowing.rs index 3e27075..b76d942 100644 --- a/engine/src/windowing.rs +++ b/engine/src/windowing.rs @@ -23,7 +23,6 @@ use winit::keyboard::PhysicalKey; use winit::window::{Window as WinitWindow, WindowId as WinitWindowId}; use crate::ecs::actions::Actions; -use crate::ecs::component::Component; use crate::ecs::event::component::{Added, Changed, EventMatchExt, Removed}; use crate::ecs::pair::{ChildOf, Pair}; use crate::ecs::phase::{Phase, PRE_UPDATE as PRE_UPDATE_PHASE}; @@ -90,7 +89,7 @@ impl crate::ecs::extension::Extension for Extension collector.spawn_declared_entity(&PHASE); - collector.add_system(*PHASE, update_stuff); + collector.add_system(*PHASE, update); collector.add_observer(handle_window_changed); collector.add_observer(handle_window_removed); @@ -112,7 +111,7 @@ fn handle_window_creation_ready( unreachable!(); }; - if ent.has_component(Window::id()) || ent.has_component(WindowClosed::id()) { + if ent.has_component::<Window>() || ent.has_component::<WindowClosed>() { continue; } @@ -128,7 +127,7 @@ fn handle_window_creation_ready( } #[tracing::instrument(skip_all)] -fn update_stuff( +fn update( mut context: Single<Context>, mut keyboard: Single<Keyboard>, mut mouse: Single<Mouse>, @@ -153,7 +152,7 @@ fn update_stuff( update_inputs(context, keyboard, mouse, mouse_buttons); - receive_app_messages(context, &mut actions, world); + handle_app_messages(context, &mut actions, world); if context.shared_state.thread_panicked.load(Ordering::Relaxed) { cold_path(); @@ -181,7 +180,7 @@ fn update_stuff( Ok(()) } -fn receive_app_messages(context: &mut Context, actions: &mut Actions, world: &World) +fn handle_app_messages(context: &mut Context, actions: &mut Actions, world: &World) { let Context { ref mut windows, ref shared_state, .. |
