From 65d8cd9e22dc534612e3436d09388b362c3addbe Mon Sep 17 00:00:00 2001 From: Zimon Dai Date: Tue, 12 Jul 2022 18:39:04 +0800 Subject: [PATCH] update to satisfy new bevy extract logic --- src/render_systems.rs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/render_systems.rs b/src/render_systems.rs index a11a45efa..bb94d88bb 100644 --- a/src/render_systems.rs +++ b/src/render_systems.rs @@ -8,11 +8,12 @@ use bevy::{ render::{ render_asset::RenderAssets, render_resource::{ - BindGroup, BindGroupDescriptor, BindGroupEntry, BindingResource, - BufferId, DynamicUniformBuffer, encase::{ShaderType}, + encase::ShaderType, BindGroup, BindGroupDescriptor, BindGroupEntry, BindingResource, + BufferId, DynamicUniformBuffer, }, renderer::{RenderDevice, RenderQueue}, texture::Image, + Extract, }, utils::HashMap, window::WindowId, @@ -53,12 +54,12 @@ impl ExtractedEguiTextures { pub(crate) fn extract_egui_render_data( mut commands: Commands, - mut egui_render_output: ResMut>, - window_sizes: ResMut>, - egui_settings: Res, - egui_context: Res, + egui_render_output: Extract>>, + window_sizes: Extract>>, + egui_settings: Extract>, + egui_context: Extract>, ) { - let render_output = std::mem::take(&mut *egui_render_output); + let render_output = egui_render_output.clone(); commands.insert_resource(ExtractedRenderOutput(render_output)); commands.insert_resource(ExtractedEguiSettings(egui_settings.clone())); commands.insert_resource(ExtractedEguiContext(egui_context.ctx.clone())); @@ -67,8 +68,8 @@ pub(crate) fn extract_egui_render_data( pub(crate) fn extract_egui_textures( mut commands: Commands, - egui_context: Res, - egui_managed_textures: ResMut, + egui_context: Extract>, + egui_managed_textures: Extract>, ) { commands.insert_resource(ExtractedEguiTextures { egui_textures: egui_managed_textures