diff --git a/assets/voxygen/voxel/figure/body/empty.vox b/assets/voxygen/voxel/figure/body/empty.vox deleted file mode 100644 index f7a98b8e9f..0000000000 --- a/assets/voxygen/voxel/figure/body/empty.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c520c6867ddad09d2839a9b74ecff16e5cdc1bd636c1766eaf1551de66a9b447 -size 44204 diff --git a/assets/voxygen/voxel/figure/empty.vox b/assets/voxygen/voxel/figure/empty.vox deleted file mode 100644 index f7a98b8e9f..0000000000 --- a/assets/voxygen/voxel/figure/empty.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c520c6867ddad09d2839a9b74ecff16e5cdc1bd636c1766eaf1551de66a9b447 -size 44204 diff --git a/common/src/figure/mod.rs b/common/src/figure/mod.rs index eb1d2cb887..c1f8103ccb 100644 --- a/common/src/figure/mod.rs +++ b/common/src/figure/mod.rs @@ -65,38 +65,6 @@ impl Segment { pub fn map_rgb(self, transform: impl Fn(Rgb) -> Rgb) -> Self { self.map(|cell| cell.get_color().map(|rgb| Cell::new(transform(rgb)))) } - /// Replaces one cell with another - // TODO unused -> remove? - pub fn replace(self, old: Cell, new: Cell) -> Self { - self.map(|cell| if cell == old { Some(new) } else { None }) - } - // Preserve the luminance of all the colors but set the chomaticity to match the provided color - /*pub fn chromify(self, chroma: Rgb) -> Self { - let chroma = chroma.map(|e| e as f32 / 255.0); - self.map_rgb(|rgb| { - chromify_srgb(rgb.map(|e| e as f32 / 255.0), chroma).map(|e| (e * 255.0) as u8) - }) - }*/ - // Sets the chromaticity based on the provided color - // Multiplies luma with luma of the provided color (might not be what we want) - /*pub fn colorify(mut self, color: Rgb) -> Self { - self.map_rgb(|rgb| { - let l = rgb_to_xyy(srgb_to_linear(rgb.map(|e| e as f32 / 255.0))).z; - let mut xyy = rgb_to_xyy(srgb_to_linear(color.map(|e| e as f32 / 255.0))); - xyy.z = l; - - linear_to_srgb(xyy_to_rgb(xyy).map(|e| e.min(1.0).max(0.0))).map(|e| (e * 255.0) as u8) - }) - } - // Multiplies the supplied color with all the current colors in linear space - pub fn tint(mut self, color: Rgb) -> Self { - self.map_rgb(|rgb| { - let c1 = srgb_to_linear(rgb.map(|e| e as f32 / 255.0)); - let c2 = srgb_to_linear(color.map(|e| e as f32 / 255.0)); - - linear_to_srgb(c1*c2).map(|e| (e.min(1.0).max(0.0) * 255.0) as u8) - }) - }*/ } // TODO: move diff --git a/voxygen/src/scene/figure/load.rs b/voxygen/src/scene/figure/load.rs index 97fb441cdf..1e0a2d509a 100644 --- a/voxygen/src/scene/figure/load.rs +++ b/voxygen/src/scene/figure/load.rs @@ -338,18 +338,18 @@ pub fn mesh_main(item: Option<&Item>) -> Mesh { Tool::Staff => ("weapon.axe.rusty_2h", Vec3::new(-2.5, -6.5, -2.0)), }, Item::Debug(_) => ("weapon.debug_wand", Vec3::new(-1.5, -9.5, -4.0)), - _ => ("figure.empty", Vec3::default()), + _ => return Mesh::new(), }; load_mesh(name, offset) } else { - load_mesh("figure.empty", Vec3::default()) + Mesh::new() } } pub fn mesh_left_shoulder(shoulder: Shoulder) -> Mesh { load_mesh( match shoulder { - Shoulder::None => "figure.empty", + Shoulder::None => return Mesh::new(), Shoulder::Brown1 => "armor.shoulder.shoulder_l_brown", }, Vec3::new(-2.5, -3.5, -1.5), @@ -359,7 +359,7 @@ pub fn mesh_left_shoulder(shoulder: Shoulder) -> Mesh { pub fn mesh_right_shoulder(shoulder: Shoulder) -> Mesh { load_mesh( match shoulder { - Shoulder::None => "figure.empty", + Shoulder::None => return Mesh::new(), Shoulder::Brown1 => "armor.shoulder.shoulder_r_brown", }, Vec3::new(-2.5, -3.5, -1.5),