Remove use of empty.vox

This commit is contained in:
Imbris 2019-08-31 10:37:09 -04:00
parent 074eee06e6
commit cc331c10b6
4 changed files with 4 additions and 42 deletions

BIN
assets/voxygen/voxel/figure/body/empty.vox (Stored with Git LFS)

Binary file not shown.

BIN
assets/voxygen/voxel/figure/empty.vox (Stored with Git LFS)

Binary file not shown.

View File

@ -65,38 +65,6 @@ impl Segment {
pub fn map_rgb(self, transform: impl Fn(Rgb<u8>) -> Rgb<u8>) -> Self { pub fn map_rgb(self, transform: impl Fn(Rgb<u8>) -> Rgb<u8>) -> Self {
self.map(|cell| cell.get_color().map(|rgb| Cell::new(transform(rgb)))) 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<u8>) -> 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<u8>) -> 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<u8>) -> 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 // TODO: move

View File

@ -338,18 +338,18 @@ pub fn mesh_main(item: Option<&Item>) -> Mesh<FigurePipeline> {
Tool::Staff => ("weapon.axe.rusty_2h", Vec3::new(-2.5, -6.5, -2.0)), 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)), Item::Debug(_) => ("weapon.debug_wand", Vec3::new(-1.5, -9.5, -4.0)),
_ => ("figure.empty", Vec3::default()), _ => return Mesh::new(),
}; };
load_mesh(name, offset) load_mesh(name, offset)
} else { } else {
load_mesh("figure.empty", Vec3::default()) Mesh::new()
} }
} }
pub fn mesh_left_shoulder(shoulder: Shoulder) -> Mesh<FigurePipeline> { pub fn mesh_left_shoulder(shoulder: Shoulder) -> Mesh<FigurePipeline> {
load_mesh( load_mesh(
match shoulder { match shoulder {
Shoulder::None => "figure.empty", Shoulder::None => return Mesh::new(),
Shoulder::Brown1 => "armor.shoulder.shoulder_l_brown", Shoulder::Brown1 => "armor.shoulder.shoulder_l_brown",
}, },
Vec3::new(-2.5, -3.5, -1.5), Vec3::new(-2.5, -3.5, -1.5),
@ -359,7 +359,7 @@ pub fn mesh_left_shoulder(shoulder: Shoulder) -> Mesh<FigurePipeline> {
pub fn mesh_right_shoulder(shoulder: Shoulder) -> Mesh<FigurePipeline> { pub fn mesh_right_shoulder(shoulder: Shoulder) -> Mesh<FigurePipeline> {
load_mesh( load_mesh(
match shoulder { match shoulder {
Shoulder::None => "figure.empty", Shoulder::None => return Mesh::new(),
Shoulder::Brown1 => "armor.shoulder.shoulder_r_brown", Shoulder::Brown1 => "armor.shoulder.shoulder_r_brown",
}, },
Vec3::new(-2.5, -3.5, -1.5), Vec3::new(-2.5, -3.5, -1.5),