diff --git a/src/window.rs b/src/window.rs index b124701..8be5a57 100644 --- a/src/window.rs +++ b/src/window.rs @@ -29,8 +29,12 @@ impl WindowContext<'_>{ winit::event::WindowEvent::DroppedFile(path)=>{ match crate::file::load(path.as_path()){ 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::GenerateModels(map)}).unwrap(); + self.physics_thread.send(TimedInstruction{time,instruction:crate::physics_worker::Instruction::Passthrough( + 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}"), }