aboutsummaryrefslogtreecommitdiff
path: root/src/render/models.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2022-10-17 15:27:33 +0200
committermetamuffin <metamuffin@disroot.org>2022-10-17 15:27:33 +0200
commit740959405b1e9a1312798b482053c01b1fab4dbb (patch)
tree2946dc403b3f4357e80b1b3b889672bd9a68f4f0 /src/render/models.rs
downloadtrash-map-740959405b1e9a1312798b482053c01b1fab4dbb.tar
trash-map-740959405b1e9a1312798b482053c01b1fab4dbb.tar.bz2
trash-map-740959405b1e9a1312798b482053c01b1fab4dbb.tar.zst
a
Diffstat (limited to 'src/render/models.rs')
-rw-r--r--src/render/models.rs36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/render/models.rs b/src/render/models.rs
new file mode 100644
index 0000000..66b8714
--- /dev/null
+++ b/src/render/models.rs
@@ -0,0 +1,36 @@
+use super::processing::*;
+use image::{ImageBuffer, Rgba};
+
+pub fn processed_block_texture(name: &str) -> ImageBuffer<Rgba<u8>, Vec<u8>> {
+ let auto_block_texture = || block_texture(name);
+ match name {
+ "grass_block" => full_isometric_sides(
+ &biome_tint(&block_texture("grass_block_top")),
+ &block_texture("grass_block_side"),
+ ),
+ "oak_leaves" | "birch_leaves" | "acacia_leaves" | "jungle_leaves" | "dark_oak_leaves"
+ | "spruce_leaves" => full_isometric(&biome_tint(&auto_block_texture())),
+ "grass" => crossed_planes(&biome_tint(&auto_block_texture())),
+ "dandelion" | "orange_tulip" | "azure_bluet" | "allium" | "poppy" | "cornflower" => {
+ crossed_planes(&auto_block_texture())
+ }
+ "lilac" | "peony" | "rose_bush" | "tall_grass" => crossed_planes(&auto_block_texture()),
+ "water" => full_isometric_sides(
+ &crop16(&tint(&block_texture("water_still"), (0, 0, 255))),
+ &crop16(&tint(&block_texture("water_flow"), (0, 0, 255))),
+ ),
+ "lava" => full_isometric_sides(
+ &crop16(&block_texture("lava_still")),
+ &crop16(&block_texture("lava_flow")),
+ ),
+ "vine" => full_isometric(&biome_tint(&auto_block_texture())),
+ "lily_pad" => crossed_planes(&biome_tint(&auto_block_texture())),
+ "sugar_cane" => crossed_planes(&auto_block_texture()),
+
+ "removed" => full_isometric(&transparent()),
+ _ => {
+ // println!("{}", name);
+ full_isometric(&auto_block_texture())
+ }
+ }
+}