diff --git a/korangar/src/graphics/engine.rs b/korangar/src/graphics/engine.rs index 2bcce3bd..6208bff2 100644 --- a/korangar/src/graphics/engine.rs +++ b/korangar/src/graphics/engine.rs @@ -51,12 +51,6 @@ pub struct GraphicsEngineDescriptor { /// Set 3: Resource Bindings (for example a texture group of a map) pub struct GraphicsEngine { capabilities: Capabilities, - instance: Instance, - adapter: Arc, - device: Arc, - queue: Arc, - staging_belt: StagingBelt, - surface: Option, frame_pacer: FramePacer, cpu_stage: FrameStage, limit_framerate: bool, @@ -66,6 +60,12 @@ pub struct GraphicsEngine { picker_value: Arc, entity_sort_buffer: Vec, model_sort_buffer: Vec, + staging_belt: StagingBelt, + queue: Arc, + device: Arc, + adapter: Arc, + instance: Instance, + surface: Option, } struct EngineContext { @@ -120,12 +120,6 @@ impl GraphicsEngine { Self { capabilities: descriptor.capabilities, - instance: descriptor.instance, - adapter: descriptor.adapter, - device: descriptor.device, - queue: descriptor.queue, - staging_belt, - surface: None, frame_pacer, cpu_stage, limit_framerate: false, @@ -135,6 +129,12 @@ impl GraphicsEngine { picker_value: descriptor.picker_value, entity_sort_buffer: vec![], model_sort_buffer: vec![], + staging_belt, + queue: descriptor.queue, + device: descriptor.device, + adapter: descriptor.adapter, + instance: descriptor.instance, + surface: None, } } diff --git a/korangar/src/main.rs b/korangar/src/main.rs index 6bf889cc..c2e9b4b2 100644 --- a/korangar/src/main.rs +++ b/korangar/src/main.rs @@ -148,20 +148,6 @@ fn main() { } struct Client { - window: Option>, - #[cfg(feature = "debug")] - device: Arc, - #[cfg(feature = "debug")] - queue: Arc, - graphics_engine: GraphicsEngine, - audio_engine: Arc>, - #[cfg(feature = "debug")] - packet_history_callback: PacketHistoryCallback, - #[cfg(feature = "debug")] - networking_system: NetworkingSystem, - #[cfg(not(feature = "debug"))] - networking_system: NetworkingSystem, - action_loader: Arc, async_loader: Arc, effect_loader: Arc, @@ -272,6 +258,20 @@ struct Client { main_menu_click_sound_effect: SoundEffectKey, map: Option>, + + #[cfg(feature = "debug")] + packet_history_callback: PacketHistoryCallback, + #[cfg(feature = "debug")] + networking_system: NetworkingSystem, + #[cfg(not(feature = "debug"))] + networking_system: NetworkingSystem, + audio_engine: Arc>, + graphics_engine: GraphicsEngine, + #[cfg(feature = "debug")] + queue: Arc, + #[cfg(feature = "debug")] + device: Arc, + window: Option>, } impl Client { @@ -590,16 +590,6 @@ impl Client { }); Self { - window: None, - #[cfg(feature = "debug")] - device, - #[cfg(feature = "debug")] - queue, - graphics_engine, - audio_engine, - #[cfg(feature = "debug")] - packet_history_callback, - networking_system, action_loader, async_loader, effect_loader, @@ -700,6 +690,16 @@ impl Client { chat_messages, main_menu_click_sound_effect, map: Some(map), + #[cfg(feature = "debug")] + packet_history_callback, + networking_system, + audio_engine, + graphics_engine, + #[cfg(feature = "debug")] + queue, + #[cfg(feature = "debug")] + device, + window: None, } }