From 6ae058d83490b8b1356f9c9bcd06d55994fadacd Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 18 Jan 2024 13:05:54 -0800 Subject: [PATCH] make room for missing texture print --- src/graphics.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/graphics.rs b/src/graphics.rs index 848b18f..72ff552 100644 --- a/src/graphics.rs +++ b/src/graphics.rs @@ -152,11 +152,14 @@ impl GraphicsState{ let mut texture_loading_threads=Vec::new(); let num_textures=indexed_models.textures.len(); for (i,texture_id) in indexed_models.textures.into_iter().enumerate(){ - if let Ok(mut file) = std::fs::File::open(std::path::Path::new(&format!("textures/{}.dds",texture_id))){ + let path=std::path::PathBuf::from(format!("textures/{}.dds",texture_id)); + if let Ok(mut file) = std::fs::File::open(path.clone()){ double_map.insert(i as u32, texture_loading_threads.len() as u32); texture_loading_threads.push((texture_id,std::thread::spawn(move ||{ ddsfile::Dds::read(&mut file).unwrap() }))); + }else{ + //println!("missing texture path={:?}",path); } }