make room for missing texture print

This commit is contained in:
Quaternions 2024-01-18 13:05:54 -08:00
parent 517c4914ac
commit 6ae058d834

View File

@ -152,11 +152,14 @@ impl GraphicsState{
let mut texture_loading_threads=Vec::new(); let mut texture_loading_threads=Vec::new();
let num_textures=indexed_models.textures.len(); let num_textures=indexed_models.textures.len();
for (i,texture_id) in indexed_models.textures.into_iter().enumerate(){ 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); double_map.insert(i as u32, texture_loading_threads.len() as u32);
texture_loading_threads.push((texture_id,std::thread::spawn(move ||{ texture_loading_threads.push((texture_id,std::thread::spawn(move ||{
ddsfile::Dds::read(&mut file).unwrap() ddsfile::Dds::read(&mut file).unwrap()
}))); })));
}else{
//println!("missing texture path={:?}",path);
} }
} }