From 90f6437817cf8c2f6ed79cc0027ccb325f130f7f Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 14 Jan 2025 01:36:50 -0800 Subject: [PATCH] wrong instruction --- strafe-client/src/window.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/strafe-client/src/window.rs b/strafe-client/src/window.rs index 0473daf..05ad99f 100644 --- a/strafe-client/src/window.rs +++ b/strafe-client/src/window.rs @@ -1,7 +1,7 @@ use strafesnet_common::instruction::TimedInstruction; use strafesnet_common::session::{Time as SessionTime,TimeInner as SessionTimeInner}; use strafesnet_common::physics::{OtherInstruction,UnbufferedInstruction}; -use crate::session::ExternalInstruction as SessionExternalInstruction; +use crate::physics_worker::Instruction as PhysicsWorkerInstruction; pub enum Instruction{ Resize(winit::dpi::PhysicalSize), @@ -17,7 +17,7 @@ struct WindowContext<'a>{ mouse:strafesnet_common::mouse::MouseState,//std::sync::Arc> screen_size:glam::UVec2, window:&'a winit::window::Window, - physics_thread:crate::compat_worker::QNWorker<'a,TimedInstruction>, + physics_thread:crate::compat_worker::QNWorker<'a,TimedInstruction>, } impl WindowContext<'_>{ @@ -28,7 +28,7 @@ impl WindowContext<'_>{ match event{ winit::event::WindowEvent::DroppedFile(path)=>{ match crate::file::load(path.as_path()){ - Ok(map)=>self.physics_thread.send(TimedInstruction{time,instruction:SessionExternalInstruction::ChangeMap(map)}).unwrap(), + Ok(map)=>self.physics_thread.send(TimedInstruction{time,instruction:PhysicsWorkerInstruction::ChangeMap(map)}).unwrap(), Err(e)=>println!("Failed to load map: {e}"), } }, @@ -36,7 +36,7 @@ impl WindowContext<'_>{ //pause unpause self.physics_thread.send(TimedInstruction{ time, - instruction:SessionExternalInstruction::SetPaused(!state), + instruction:PhysicsWorkerInstruction::SetPaused(!state), }).unwrap(); //recalculate pressed keys on focus }, @@ -113,7 +113,7 @@ impl WindowContext<'_>{ }{ self.physics_thread.send(TimedInstruction{ time, - instruction:SessionExternalInstruction::Input(UnbufferedInstruction::Other(input_instruction)), + instruction:PhysicsWorkerInstruction::Input(UnbufferedInstruction::Other(input_instruction)), }).unwrap(); } }, @@ -141,7 +141,7 @@ impl WindowContext<'_>{ self.mouse.pos+=delta; self.physics_thread.send(TimedInstruction{ time, - instruction:SessionExternalInstruction::Input(UnbufferedInstruction::MoveMouse(self.mouse.pos)), + instruction:PhysicsWorkerInstruction::Input(UnbufferedInstruction::MoveMouse(self.mouse.pos)), }).unwrap(); }, winit::event::DeviceEvent::MouseWheel { @@ -151,7 +151,7 @@ impl WindowContext<'_>{ if false{//self.physics.style.use_scroll{ self.physics_thread.send(TimedInstruction{ time, - instruction:SessionExternalInstruction::Input(UnbufferedInstruction::Other(OtherInstruction::SetJump(true))),//activates the immediate jump path, but the style modifier prevents controls&CONTROL_JUMP bit from being set to auto jump + instruction:PhysicsWorkerInstruction::Input(UnbufferedInstruction::Other(OtherInstruction::SetJump(true))),//activates the immediate jump path, but the style modifier prevents controls&CONTROL_JUMP bit from being set to auto jump }).unwrap(); } }, @@ -200,7 +200,7 @@ pub fn worker<'a>( window_context.physics_thread.send( TimedInstruction{ time:ins.time, - instruction:SessionExternalInstruction::Resize(size) + instruction:PhysicsWorkerInstruction::Resize(size) } ).unwrap(); } @@ -208,7 +208,7 @@ pub fn worker<'a>( window_context.physics_thread.send( TimedInstruction{ time:ins.time, - instruction:SessionExternalInstruction::Render + instruction:PhysicsWorkerInstruction::Render } ).unwrap(); }