diff --git a/strafe-client/src/graphics_worker.rs b/strafe-client/src/graphics_worker.rs index fb39813..b13f515 100644 --- a/strafe-client/src/graphics_worker.rs +++ b/strafe-client/src/graphics_worker.rs @@ -1,7 +1,11 @@ +use strafesnet_graphics::graphics; +use strafesnet_session::session; +use strafesnet_settings::settings; + pub enum Instruction{ - Render(crate::session::FrameState), - //UpdateModel(crate::graphics::GraphicsModelUpdate), - Resize(winit::dpi::PhysicalSize<u32>,crate::settings::UserSettings), + Render(session::FrameState), + //UpdateModel(graphics::GraphicsModelUpdate), + Resize(winit::dpi::PhysicalSize<u32>,settings::UserSettings), ChangeMap(strafesnet_common::map::CompleteMap), } @@ -15,7 +19,7 @@ WorkerDescription{ //up to three frames in flight, dropping new frame requests when all three are busy, and dropping output frames when one renders out of order pub fn new( - mut graphics:strafesnet_graphics::graphics::GraphicsState, + mut graphics:graphics::GraphicsState, mut config:wgpu::SurfaceConfiguration, surface:wgpu::Surface, device:wgpu::Device, diff --git a/strafe-client/src/physics_worker.rs b/strafe-client/src/physics_worker.rs index ff9c185..a597c03 100644 --- a/strafe-client/src/physics_worker.rs +++ b/strafe-client/src/physics_worker.rs @@ -1,6 +1,7 @@ use crate::graphics_worker::Instruction as GraphicsInstruction; -use crate::session::{ - Session,Simulation,SessionInputInstruction,SessionControlInstruction,SessionPlaybackInstruction, +use strafesnet_settings::settings; +use strafesnet_session::session::{ + Session,Simulation,SessionInputInstruction,SessionControlInstruction,SessionPlaybackInstruction,ImplicitModeInstruction, Instruction as SessionInstruction, }; use strafesnet_common::instruction::{TimedInstruction,InstructionConsumer}; @@ -20,7 +21,7 @@ pub enum Instruction{ pub fn new<'a>( mut graphics_worker:crate::compat_worker::INWorker<'a,crate::graphics_worker::Instruction>, - user_settings:crate::settings::UserSettings, + user_settings:settings::UserSettings, )->crate::compat_worker::QNWorker<'a,TimedInstruction<Instruction,SessionTimeInner>>{ let physics=strafesnet_physics::physics::PhysicsState::default(); let timer=Timer::unpaused(SessionTime::ZERO,PhysicsTime::ZERO); @@ -67,7 +68,7 @@ pub fn new<'a>( }, Instruction::ChangeMap(complete_map)=>{ run_session_instruction!(ins.time,SessionInstruction::ChangeMap(&complete_map)); - run_session_instruction!(ins.time,SessionInstruction::Input(SessionInputInstruction::Mode(crate::session::ImplicitModeInstruction::ResetAndSpawn(strafesnet_common::gameplay_modes::ModeId::MAIN,strafesnet_common::gameplay_modes::StageId::FIRST)))); + run_session_instruction!(ins.time,SessionInstruction::Input(SessionInputInstruction::Mode(ImplicitModeInstruction::ResetAndSpawn(strafesnet_common::gameplay_modes::ModeId::MAIN,strafesnet_common::gameplay_modes::StageId::FIRST)))); run_graphics_worker_instruction!(GraphicsInstruction::ChangeMap(complete_map)); }, Instruction::LoadReplay(bot)=>{ diff --git a/strafe-client/src/window.rs b/strafe-client/src/window.rs index cefda6e..65097b4 100644 --- a/strafe-client/src/window.rs +++ b/strafe-client/src/window.rs @@ -3,7 +3,8 @@ use strafesnet_common::session::{Time as SessionTime,TimeInner as SessionTimeInn use strafesnet_common::physics::{MiscInstruction,SetControlInstruction}; use crate::file::LoadFormat; use crate::physics_worker::Instruction as PhysicsWorkerInstruction; -use crate::session::{SessionInputInstruction,SessionControlInstruction,SessionPlaybackInstruction}; +use strafesnet_session::session::{self,SessionInputInstruction,SessionControlInstruction,SessionPlaybackInstruction}; +use strafesnet_settings::settings; pub enum Instruction{ Resize(winit::dpi::PhysicalSize<u32>), @@ -150,7 +151,7 @@ impl WindowContext<'_>{ "R"|"r"=>s.then(||{ //mouse needs to be reset since the position is absolute self.mouse_pos=glam::DVec2::ZERO; - SessionInstructionSubset::Input(SessionInputInstruction::Mode(crate::session::ImplicitModeInstruction::ResetAndRestart)) + SessionInstructionSubset::Input(SessionInputInstruction::Mode(session::ImplicitModeInstruction::ResetAndRestart)) }), "F"|"f"=>input_misc!(PracticeFly,s), "B"|"b"=>session_ctrl!(CopyRecordingIntoReplayAndSpectate,s), @@ -210,7 +211,7 @@ pub fn worker<'a>( setup_context:crate::setup::SetupContext<'a>, )->crate::compat_worker::QNWorker<'a,TimedInstruction<Instruction,SessionTimeInner>>{ // WindowContextSetup::new - let user_settings=crate::settings::read_user_settings(); + let user_settings=settings::read_user_settings(); let mut graphics=strafesnet_graphics::graphics::GraphicsState::new(&setup_context.device,&setup_context.queue,&setup_context.config); graphics.load_user_settings(&user_settings);