From 0c7b8c8a5976c727e845331f78c4456bb71c3f80 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 5 Feb 2024 20:27:06 -0800 Subject: [PATCH] graphics map function thing and don't consume map --- src/graphics.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/graphics.rs b/src/graphics.rs index 579fe95..be5d629 100644 --- a/src/graphics.rs +++ b/src/graphics.rs @@ -147,7 +147,7 @@ impl GraphicsState{ pub fn load_user_settings(&mut self,user_settings:&crate::settings::UserSettings){ self.camera.fov=user_settings.calculate_fov(1.0,&self.camera.screen_size).as_vec2(); } - pub fn generate_models(&mut self,device:&wgpu::Device,queue:&wgpu::Queue,map:map::Map){ + pub fn generate_models(&mut self,device:&wgpu::Device,queue:&wgpu::Queue,map:&map::Map){ //generate texture view per texture //idk how to do this gooder lol @@ -396,9 +396,9 @@ impl GraphicsState{ vertex_id }) as u32) }).collect(); - for group in &model.groups{ - for poly in &group.polys{ - polys.push(model::PolygonGroup::PolygonList(poly.vertices.iter().map(|&vertex_id|map_vertex_id[vertex_id.get() as usize]).collect())); + for group in model.groups{ + for poly in group.polys{ + polys.push(poly.map_vertex_id(|vertex_id|map_vertex_id[vertex_id.get() as usize])); } } }