[Block] Draw type 'Glass' added.
This commit is contained in:
parent
70e80d1e31
commit
9afa1b6202
@ -89,7 +89,8 @@ std::array<std::size_t, ChunkBuilder::layers> ChunkBuilder::buildChunk(const Cli
|
||||
|
||||
if (block.drawType() == BlockDrawType::Solid
|
||||
|| block.drawType() == BlockDrawType::AllFaces
|
||||
|| block.drawType() == BlockDrawType::Liquid) {
|
||||
|| block.drawType() == BlockDrawType::Liquid
|
||||
|| block.drawType() == BlockDrawType::Glass) {
|
||||
for(u8 i = 0 ; i < 6 ; i++) {
|
||||
addFace(x, y, z, i, chunk, &block, surroundingBlocksPos[i]);
|
||||
}
|
||||
@ -125,7 +126,7 @@ inline void ChunkBuilder::addFace(u8 x, u8 y, u8 z, u8 i, const ClientChunk &chu
|
||||
// Skip hidden faces
|
||||
if (surroundingBlock && surroundingBlock->id()
|
||||
&& ((block->drawType() == BlockDrawType::Solid && surroundingBlock->drawType() == BlockDrawType::Solid && surroundingBlock->isOpaque())
|
||||
|| (block->id() == surroundingBlock->id() && block->drawType() == BlockDrawType::Liquid)))
|
||||
|| (block->id() == surroundingBlock->id() && (block->drawType() == BlockDrawType::Liquid || block->drawType() == BlockDrawType::Glass))))
|
||||
return;
|
||||
|
||||
static glm::vec3 a, b, c, v1, v2, normal;
|
||||
|
@ -35,6 +35,7 @@ enum class BlockDrawType {
|
||||
XShape = 1,
|
||||
AllFaces = 2,
|
||||
Liquid = 3,
|
||||
Glass = 4,
|
||||
};
|
||||
|
||||
class Block : public ISerializable {
|
||||
|
@ -65,7 +65,8 @@ mod:block {
|
||||
mod:block {
|
||||
id = "glass",
|
||||
name = "Glass",
|
||||
tiles = "glass.png"
|
||||
tiles = "glass.png",
|
||||
draw_type = 4 -- FIXME: Use string instead
|
||||
}
|
||||
|
||||
mod:block {
|
||||
|
Loading…
x
Reference in New Issue
Block a user