separate map from graphics

This commit is contained in:
2026-02-18 10:20:43 -08:00
parent 2646e96c33
commit d0e71b8431
7 changed files with 100 additions and 74 deletions

View File

@@ -46,10 +46,10 @@ impl<'a> PlayerWorker<'a>{
Instruction::Render=>{
self.playback_head.advance_time(&self.bot,ins.time);
let (pos,angles)=self.playback_head.get_position_angles(&self.bot,ins.time);
self.graphics_thread.send(&self.surface,strafesnet_roblox_bot_player::graphics::Instruction::Render{pos,angles});
self.graphics_thread.render(&self.surface,pos,angles);
},
Instruction::Resize(physical_size)=>{
self.graphics_thread.send(&self.surface,strafesnet_roblox_bot_player::graphics::Instruction::Resize(glam::uvec2(physical_size.width,physical_size.height)));
self.graphics_thread.resize(&self.surface,glam::uvec2(physical_size.width,physical_size.height));
},
}
}

View File

@@ -201,8 +201,10 @@ impl WindowContext<'_>{
let screen_size=glam::uvec2(config.width,config.height);
let bot=include_bytes!("../../web-demo/bhop_marble_7cf33a64-7120-4514-b9fa-4fe29d9523d.qbot");
let map=include_bytes!("../../web-demo/bhop_marble_5692093612.snfm");
let graphics=strafesnet_roblox_bot_player::graphics::Graphics::new(map,device,queue,config).unwrap();
let bot=strafesnet_roblox_bot_player::bot::Bot::new(bot).unwrap();
let map=strafesnet_roblox_bot_player::map::CompleteMap::new(map).unwrap();
let mut graphics=strafesnet_roblox_bot_player::graphics::Graphics::new(device,queue,config);
graphics.change_map(&map);
WindowContext{
manual_mouse_lock:false,
mouse_pos:glam::DVec2::ZERO,