forked from StrafesNET/strafe-client
lol idk #1
@ -151,7 +151,13 @@ impl GraphicsState{
|
|||||||
//generate texture view per texture
|
//generate texture view per texture
|
||||||
let texture_views:HashMap<strafesnet_common::model::TextureId,wgpu::TextureView>=map.textures.iter().enumerate().filter_map(|(texture_id,texture_data)|{
|
let texture_views:HashMap<strafesnet_common::model::TextureId,wgpu::TextureView>=map.textures.iter().enumerate().filter_map(|(texture_id,texture_data)|{
|
||||||
let texture_id=model::TextureId::new(texture_id as u32);
|
let texture_id=model::TextureId::new(texture_id as u32);
|
||||||
let image=ddsfile::Dds::read(std::io::Cursor::new(texture_data)).ok()?;
|
let image=match ddsfile::Dds::read(std::io::Cursor::new(texture_data)){
|
||||||
|
Ok(image)=>image,
|
||||||
|
Err(e)=>{
|
||||||
|
println!("Error loading texture: {e}");
|
||||||
|
return None;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
let (mut width,mut height)=(image.get_width(),image.get_height());
|
let (mut width,mut height)=(image.get_width(),image.get_height());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user