diff --git a/src/graphics_worker.rs b/src/graphics_worker.rs index ca284a7..fdb1d74 100644 --- a/src/graphics_worker.rs +++ b/src/graphics_worker.rs @@ -28,7 +28,7 @@ pub fn new<'a>( crate::compat_worker::INWorker::new(move |ins:Instruction|{ match ins{ Instruction::GenerateModels(indexed_model_instances)=>{ - graphics.generate_models(&device,&queue,indexed_model_instances); + graphics.generate_models(&device,&queue,&indexed_model_instances); }, Instruction::ClearModels=>{ graphics.clear(); diff --git a/src/physics.rs b/src/physics.rs index cedd694..c876ef4 100644 --- a/src/physics.rs +++ b/src/physics.rs @@ -943,11 +943,11 @@ impl PhysicsContext{ }); } - pub fn generate_models(&mut self,map:map::Map){ + pub fn generate_models(&mut self,map:&map::Map){ let mut starts=Vec::new(); let mut spawns=Vec::new(); let mut attr_hash=HashMap::new(); - for (model_id,model) in map.models{ + for (&model_id,model) in &map.models{ let mesh_id=self.data.models.meshes.len(); let mut make_mesh=false; for model_instance in &model.instances{