Add oak planks and oak logs
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
8ecb9ea813
commit
5252da6ccb
3 changed files with 20 additions and 13 deletions
|
@ -25,8 +25,8 @@ impl HotbarHud {
|
||||||
None,
|
None,
|
||||||
Some(BlockType::Grass),
|
Some(BlockType::Grass),
|
||||||
Some(BlockType::Cobblestone),
|
Some(BlockType::Cobblestone),
|
||||||
None,
|
Some(BlockType::OakPlanks),
|
||||||
None,
|
Some(BlockType::OakLog),
|
||||||
None,
|
None,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -114,7 +114,7 @@ impl Texture {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const TEXTURE_COUNT: usize = 40;
|
pub const TEXTURE_COUNT: usize = 43;
|
||||||
|
|
||||||
pub struct TextureManager {
|
pub struct TextureManager {
|
||||||
pub bind_group_layout: wgpu::BindGroupLayout,
|
pub bind_group_layout: wgpu::BindGroupLayout,
|
||||||
|
@ -186,6 +186,9 @@ impl TextureManager {
|
||||||
let path = format!("assets/water_still_plains/frame-{}.png", i);
|
let path = format!("assets/water_still_plains/frame-{}.png", i);
|
||||||
self.load(render_context, &path)?; // 8 - 39
|
self.load(render_context, &path)?; // 8 - 39
|
||||||
}
|
}
|
||||||
|
self.load(render_context, "assets/block/oak_log.png")?; // 40
|
||||||
|
self.load(render_context, "assets/block/oak_log_top.png")?; // 41
|
||||||
|
self.load(render_context, "assets/block/oak_planks.png")?; // 42
|
||||||
assert_eq!(TEXTURE_COUNT, self.textures.len());
|
assert_eq!(TEXTURE_COUNT, self.textures.len());
|
||||||
|
|
||||||
let texture_array = render_context
|
let texture_array = render_context
|
||||||
|
|
|
@ -5,14 +5,16 @@ use serde_repr::{Deserialize_repr, Serialize_repr};
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize_repr, Deserialize_repr)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize_repr, Deserialize_repr)]
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
pub enum BlockType {
|
pub enum BlockType {
|
||||||
Cobblestone = 1,
|
Cobblestone,
|
||||||
Dirt = 2,
|
Dirt,
|
||||||
Stone = 3,
|
Stone,
|
||||||
Grass = 4,
|
Grass,
|
||||||
Bedrock = 5,
|
Bedrock,
|
||||||
Sand = 6,
|
Sand,
|
||||||
Gravel = 7,
|
Gravel,
|
||||||
Water = 8,
|
Water,
|
||||||
|
OakLog,
|
||||||
|
OakPlanks,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl BlockType {
|
impl BlockType {
|
||||||
|
@ -22,11 +24,13 @@ impl BlockType {
|
||||||
BlockType::Cobblestone => ( 0, 0, 0, 0, 0, 0),
|
BlockType::Cobblestone => ( 0, 0, 0, 0, 0, 0),
|
||||||
BlockType::Dirt => ( 1, 1, 1, 1, 1, 1),
|
BlockType::Dirt => ( 1, 1, 1, 1, 1, 1),
|
||||||
BlockType::Stone => ( 2, 2, 2, 2, 2, 2),
|
BlockType::Stone => ( 2, 2, 2, 2, 2, 2),
|
||||||
BlockType::Grass => ( 4, 4, 4, 4, 2, 3),
|
BlockType::Grass => ( 4, 4, 4, 4, 1, 3),
|
||||||
BlockType::Bedrock => ( 5, 5, 5, 5, 5, 5),
|
BlockType::Bedrock => ( 5, 5, 5, 5, 5, 5),
|
||||||
BlockType::Sand => ( 6, 6, 6, 6, 6, 6),
|
BlockType::Sand => ( 6, 6, 6, 6, 6, 6),
|
||||||
BlockType::Gravel => ( 7, 7, 7, 7, 7, 7),
|
BlockType::Gravel => ( 7, 7, 7, 7, 7, 7),
|
||||||
BlockType::Water => ( 8, 8, 8, 8, 8, 8), // up to 71
|
BlockType::Water => ( 8, 8, 8, 8, 8, 8), // up to 39
|
||||||
|
BlockType::OakLog => (40, 40, 40, 40, 41, 41),
|
||||||
|
BlockType::OakPlanks => (42, 42, 42, 42, 42, 42),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue