diff options
| author | HampusM <hampus@hampusmat.com> | 2026-07-23 17:40:15 +0200 |
|---|---|---|
| committer | HampusM <hampus@hampusmat.com> | 2026-07-23 17:40:15 +0200 |
| commit | a34c019279661332f95d5d843924998c2eaecb17 (patch) | |
| tree | 615614597f4be3a13d6b8b83dcb5dae8c63d8ab6 /engine | |
| parent | 624e6dd450944e67d84ad7afda54ae2abd277aba (diff) | |
refactor(engine): correct query type parameters
Diffstat (limited to 'engine')
| -rw-r--r-- | engine/src/camera/fly.rs | 2 | ||||
| -rw-r--r-- | engine/src/rendering.rs | 2 | ||||
| -rw-r--r-- | engine/src/rendering/backend/opengl.rs | 6 | ||||
| -rw-r--r-- | engine/src/rendering/main_render_pass.rs | 5 | ||||
| -rw-r--r-- | engine/src/rendering/shader/default.rs | 5 | ||||
| -rw-r--r-- | engine/src/ui/dear_imgui.rs | 2 | ||||
| -rw-r--r-- | engine/src/ui/view/world.rs | 2 |
7 files changed, 13 insertions, 11 deletions
diff --git a/engine/src/camera/fly.rs b/engine/src/camera/fly.rs index 166f4fb..b2559fb 100644 --- a/engine/src/camera/fly.rs +++ b/engine/src/camera/fly.rs @@ -81,8 +81,8 @@ fn update( &mut WorldPosition, &mut Fly, Option<&ControllableCamera>, + With<ActiveCamera>, ), - (With<ActiveCamera>,), >, keyboard: Single<Keyboard>, mouse: Single<Mouse>, diff --git a/engine/src/rendering.rs b/engine/src/rendering.rs index e67a457..ba66adb 100644 --- a/engine/src/rendering.rs +++ b/engine/src/rendering.rs @@ -398,7 +398,7 @@ impl Default for CommandQueue #[tracing::instrument(skip_all)] fn enqueue_commands_from_render_passes( - window_surface_spec_query: Query<(&SurfaceSpec,), (With<Window>, With<TargetWindow>)>, + window_surface_spec_query: Query<(&SurfaceSpec, With<Window>, With<TargetWindow>)>, mut command_queue: Single<CommandQueue>, mut render_passes: Single<RenderPasses>, mut active_draw_props: Local<ActiveDrawProperties>, diff --git a/engine/src/rendering/backend/opengl.rs b/engine/src/rendering/backend/opengl.rs index bab916a..1253c7b 100644 --- a/engine/src/rendering/backend/opengl.rs +++ b/engine/src/rendering/backend/opengl.rs @@ -188,8 +188,9 @@ impl crate::ecs::extension::Extension for Extension fn prepare_windows( window_query: Query< - (Option<&Window>, &mut WindowCreationAttributes), ( + Option<&Window>, + &mut WindowCreationAttributes, With<TargetWindow>, Without<CreationReady>, Without<WindowGlConfig>, @@ -272,8 +273,7 @@ fn prepare_windows( #[tracing::instrument(skip_all)] fn init_window_graphics( window_query: Query< - (&Window, &WindowGlConfig), - (With<TargetWindow>, Without<SurfaceSpec>), + (&Window, &WindowGlConfig, With<TargetWindow>, Without<SurfaceSpec>), >, windowing_context: Single<WindowingContext>, graphics_props: Single<GraphicsProperties>, diff --git a/engine/src/rendering/main_render_pass.rs b/engine/src/rendering/main_render_pass.rs index d83fad4..d9132ef 100644 --- a/engine/src/rendering/main_render_pass.rs +++ b/engine/src/rendering/main_render_pass.rs @@ -35,12 +35,13 @@ type RenderableEntity<'a> = ( Option<&'a DrawFlags>, Option<&'a Shader>, Option<&'a mut PendingShaderBindings>, + Without<NoDraw>, ); #[tracing::instrument(skip_all)] pub fn add_main_render_passes( - renderable_query: Query<RenderableEntity<'_>, (Without<NoDraw>,)>, - window_surface_spec_query: Query<(&SurfaceSpec,), (With<Window>, With<TargetWindow>)>, + renderable_query: Query<RenderableEntity<'_>>, + window_surface_spec_query: Query<(&SurfaceSpec, With<Window>, With<TargetWindow>)>, assets: Single<Assets>, shader_context: Single<ShaderContext>, mut render_passes: Single<RenderPasses>, diff --git a/engine/src/rendering/shader/default.rs b/engine/src/rendering/shader/default.rs index 6621d06..1c883b0 100644 --- a/engine/src/rendering/shader/default.rs +++ b/engine/src/rendering/shader/default.rs @@ -59,9 +59,9 @@ pub fn initialize(mut assets: Single<Assets>) -> Result<(), crate::Error> } pub fn enqueue_set_shader_bindings( - renderable_query: Query<RenderableEntity<'_>, (Without<NoDraw>,)>, + renderable_query: Query<RenderableEntity<'_>>, camera_query: Query<(&Camera, &WorldPosition, &ActiveCamera)>, - window_query: Query<(&Window, &SurfaceSpec), (With<RenderingTargetWindow>,)>, + window_query: Query<(&Window, &SurfaceSpec, With<RenderingTargetWindow>)>, point_light_query: Query<(&PointLight, &WorldPosition)>, directional_light_query: Query<(&DirectionalLight,)>, assets: Single<Assets>, @@ -401,4 +401,5 @@ type RenderableEntity<'a> = ( Option<&'a Scale>, Option<&'a Shader>, Option<&'a mut PendingShaderBindings>, + Without<NoDraw>, ); diff --git a/engine/src/ui/dear_imgui.rs b/engine/src/ui/dear_imgui.rs index c710784..b571cee 100644 --- a/engine/src/ui/dear_imgui.rs +++ b/engine/src/ui/dear_imgui.rs @@ -210,7 +210,7 @@ fn handle_window_changed( } fn update( - target_window_query: Query<(&Window, &SurfaceSpec), (With<TargetWindow>,)>, + target_window_query: Query<(&Window, &SurfaceSpec, With<TargetWindow>)>, mut context: Single<Context>, time: Single<Time>, mut assets: Single<Assets>, diff --git a/engine/src/ui/view/world.rs b/engine/src/ui/view/world.rs index 9803328..8552ec1 100644 --- a/engine/src/ui/view/world.rs +++ b/engine/src/ui/view/world.rs @@ -410,7 +410,7 @@ fn enter_add_component_popup_state( let popup_name = format!("Add component to {ent_title}"); let mut searchable_components = world - .query::<(&ComponentInfo,), ()>() + .query::<(&ComponentInfo,)>() .iter_with_euids() .map(|(id, (component_info,))| { let user_creatable = if component_info.type_reflection.is_none() { |
