forked from StrafesNET/strafe-client
leave tabs alone to make diffs legible
This commit is contained in:
parent
78cf5e155e
commit
a3ac815e45
@ -167,53 +167,53 @@ impl WindowContext<'_>{
|
|||||||
}
|
}
|
||||||
pub fn worker<'a>(window:&'a winit::window::Window,setup_context:crate::setup::SetupContext<'a>,scope:&'a std::thread::Scope<'a,'_>)->crate::compat_worker::QNWorker<'a,TimedInstruction<WindowInstruction>>{
|
pub fn worker<'a>(window:&'a winit::window::Window,setup_context:crate::setup::SetupContext<'a>,scope:&'a std::thread::Scope<'a,'_>)->crate::compat_worker::QNWorker<'a,TimedInstruction<WindowInstruction>>{
|
||||||
// WindowContextSetup::new
|
// WindowContextSetup::new
|
||||||
let user_settings=crate::settings::read_user_settings();
|
let user_settings=crate::settings::read_user_settings();
|
||||||
|
|
||||||
let mut graphics=crate::graphics::GraphicsState::new(&setup_context.device,&setup_context.queue,&setup_context.config);
|
let mut graphics=crate::graphics::GraphicsState::new(&setup_context.device,&setup_context.queue,&setup_context.config);
|
||||||
graphics.load_user_settings(&user_settings);
|
graphics.load_user_settings(&user_settings);
|
||||||
|
|
||||||
//WindowContextSetup::into_context
|
//WindowContextSetup::into_context
|
||||||
let screen_size=glam::uvec2(setup_context.config.width,setup_context.config.height);
|
let screen_size=glam::uvec2(setup_context.config.width,setup_context.config.height);
|
||||||
let graphics_thread=crate::graphics_worker::new(graphics,setup_context.config,setup_context.surface,setup_context.device,setup_context.queue);
|
let graphics_thread=crate::graphics_worker::new(graphics,setup_context.config,setup_context.surface,setup_context.device,setup_context.queue);
|
||||||
//this obviously doesn't belong here, do something about it pls
|
//this obviously doesn't belong here, do something about it pls
|
||||||
let bot_thread=crate::bot_worker::new(scope);
|
let bot_thread=crate::bot_worker::new(scope);
|
||||||
let mut window_context=WindowContext{
|
let mut window_context=WindowContext{
|
||||||
manual_mouse_lock:false,
|
manual_mouse_lock:false,
|
||||||
mouse:strafesnet_common::mouse::MouseState::default(),
|
mouse:strafesnet_common::mouse::MouseState::default(),
|
||||||
//make sure to update this!!!!!
|
//make sure to update this!!!!!
|
||||||
screen_size,
|
screen_size,
|
||||||
window,
|
window,
|
||||||
physics_thread:crate::physics_worker::new(graphics_thread,bot_thread,user_settings),
|
physics_thread:crate::physics_worker::new(graphics_thread,bot_thread,user_settings),
|
||||||
};
|
};
|
||||||
|
|
||||||
//WindowContextSetup::into_worker
|
//WindowContextSetup::into_worker
|
||||||
crate::compat_worker::QNWorker::new(move |ins:TimedInstruction<WindowInstruction>|{
|
crate::compat_worker::QNWorker::new(move |ins:TimedInstruction<WindowInstruction>|{
|
||||||
match ins.instruction{
|
match ins.instruction{
|
||||||
WindowInstruction::RequestRedraw=>{
|
WindowInstruction::RequestRedraw=>{
|
||||||
window_context.window.request_redraw();
|
window_context.window.request_redraw();
|
||||||
|
}
|
||||||
|
WindowInstruction::WindowEvent(window_event)=>{
|
||||||
|
window_context.window_event(ins.time,window_event);
|
||||||
|
},
|
||||||
|
WindowInstruction::DeviceEvent(device_event)=>{
|
||||||
|
window_context.device_event(ins.time,device_event);
|
||||||
|
},
|
||||||
|
WindowInstruction::Resize(size)=>{
|
||||||
|
window_context.physics_thread.send(
|
||||||
|
TimedInstruction{
|
||||||
|
time:ins.time,
|
||||||
|
instruction:crate::physics_worker::Instruction::Resize(size)
|
||||||
|
}
|
||||||
|
).unwrap();
|
||||||
|
}
|
||||||
|
WindowInstruction::Render=>{
|
||||||
|
window_context.physics_thread.send(
|
||||||
|
TimedInstruction{
|
||||||
|
time:ins.time,
|
||||||
|
instruction:crate::physics_worker::Instruction::Render
|
||||||
|
}
|
||||||
|
).unwrap();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
WindowInstruction::WindowEvent(window_event)=>{
|
})
|
||||||
window_context.window_event(ins.time,window_event);
|
|
||||||
},
|
|
||||||
WindowInstruction::DeviceEvent(device_event)=>{
|
|
||||||
window_context.device_event(ins.time,device_event);
|
|
||||||
},
|
|
||||||
WindowInstruction::Resize(size)=>{
|
|
||||||
window_context.physics_thread.send(
|
|
||||||
TimedInstruction{
|
|
||||||
time:ins.time,
|
|
||||||
instruction:crate::physics_worker::Instruction::Resize(size)
|
|
||||||
}
|
|
||||||
).unwrap();
|
|
||||||
}
|
|
||||||
WindowInstruction::Render=>{
|
|
||||||
window_context.physics_thread.send(
|
|
||||||
TimedInstruction{
|
|
||||||
time:ins.time,
|
|
||||||
instruction:crate::physics_worker::Instruction::Render
|
|
||||||
}
|
|
||||||
).unwrap();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user