mirror of
https://codeberg.org/icewind/vbspview.git
synced 2026-06-03 18:24:09 +02:00
clippy fixes
This commit is contained in:
parent
3be69d45f7
commit
4a3579401a
2 changed files with 5 additions and 5 deletions
|
|
@ -122,8 +122,8 @@ fn load_texture(name: &str, loader: &Loader) -> Result<DynamicImage, Error> {
|
||||||
"materials/{}.vtf",
|
"materials/{}.vtf",
|
||||||
name.trim_end_matches(".vtf").trim_start_matches('/')
|
name.trim_end_matches(".vtf").trim_start_matches('/')
|
||||||
);
|
);
|
||||||
let mut raw = loader.load(&path)?.ok_or(Error::ResourceNotFound(path))?;
|
let raw = loader.load(&path)?.ok_or(Error::ResourceNotFound(path))?;
|
||||||
let vtf = VTF::read(&mut raw)?;
|
let vtf = VTF::read(&raw)?;
|
||||||
let image = vtf.highres_image.decode(0)?;
|
let image = vtf.highres_image.decode(0)?;
|
||||||
Ok(image)
|
Ok(image)
|
||||||
}
|
}
|
||||||
|
|
@ -201,7 +201,7 @@ impl<'s> MaterialSet<'s> {
|
||||||
} else {
|
} else {
|
||||||
self.loader
|
self.loader
|
||||||
.find_in_paths(&material, &search_path)
|
.find_in_paths(&material, &search_path)
|
||||||
.unwrap_or(material.into())
|
.unwrap_or(material)
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut materials = self.materials.borrow_mut();
|
let mut materials = self.materials.borrow_mut();
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ fn prop_to_meshes<'a>(
|
||||||
let positions: Vec<Vec3> = mesh
|
let positions: Vec<Vec3> = mesh
|
||||||
.vertices()
|
.vertices()
|
||||||
.map(|vertex| model.apply_root_transform(vertex.position))
|
.map(|vertex| model.apply_root_transform(vertex.position))
|
||||||
.map(|vertex| map_coords(vertex))
|
.map(map_coords)
|
||||||
.collect();
|
.collect();
|
||||||
let normals: Vec<Vec3> = mesh
|
let normals: Vec<Vec3> = mesh
|
||||||
.vertices()
|
.vertices()
|
||||||
|
|
@ -141,5 +141,5 @@ fn prop_to_meshes<'a>(
|
||||||
}
|
}
|
||||||
|
|
||||||
fn prop_texture_to_material(texture: &str, loader: &Loader) -> CpuMaterial {
|
fn prop_texture_to_material(texture: &str, loader: &Loader) -> CpuMaterial {
|
||||||
convert_material(load_material_fallback(&texture, loader))
|
convert_material(load_material_fallback(texture, loader))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue