This commit is contained in:
Quaternions 2024-07-30 18:24:19 -07:00
parent 9cd72d5809
commit 9646804dcd

View File

@ -29,8 +29,12 @@ impl WindowContext<'_>{
winit::event::WindowEvent::DroppedFile(path)=>{ winit::event::WindowEvent::DroppedFile(path)=>{
match crate::file::load(path.as_path()){ match crate::file::load(path.as_path()){
Ok(map)=>{ Ok(map)=>{
self.physics_thread.send(TimedInstruction{time,instruction:crate::physics_worker::Instruction::ClearModels}).unwrap(); self.physics_thread.send(TimedInstruction{time,instruction:crate::physics_worker::Instruction::Passthrough(
self.physics_thread.send(TimedInstruction{time,instruction:crate::physics_worker::Instruction::GenerateModels(map)}).unwrap(); crate::physics_worker::PassthroughInstruction::ClearModels
)}).unwrap();
self.physics_thread.send(TimedInstruction{time,instruction:crate::physics_worker::Instruction::Passthrough(
crate::physics_worker::PassthroughInstruction::GenerateModels(map)
)}).unwrap();
}, },
Err(e)=>println!("Failed to load map: {e}"), Err(e)=>println!("Failed to load map: {e}"),
} }