]> git.localhorst.tv Git - blank.git/blobdiff - src/world.cpp
add null shape for void blocks
[blank.git] / src / world.cpp
index 6ce0700d2b99e694066ba3ab61e2ef08c5e745d6..aea6ec2ec8724b0de2dd5b56d8f58453c7769709 100644 (file)
@@ -7,7 +7,7 @@
 namespace blank {
 
 const BlockType BlockType::DEFAULT;
-const CuboidShape BlockType::DEFAULT_SHAPE({{ 0, 0, 0 }, { 1, 1, 1 }});
+const NullShape BlockType::DEFAULT_SHAPE;
 
 void BlockType::FillVBO(
        const glm::vec3 &pos,
@@ -138,7 +138,6 @@ void Chunk::Position(const glm::vec3 &pos) {
 
 
 int Chunk::VertexCount() const {
-       // TODO: query blocks as soon as type shapes are implemented
        int count = 0;
        for (const auto &block : blocks) {
                count += block.type->shape->VertexCount();
@@ -151,9 +150,7 @@ void Chunk::Update() {
        model.Reserve(VertexCount());
 
        for (size_t i = 0; i < Size(); ++i) {
-               if (blocks[i].type->visible) {
-                       blocks[i].type->FillModel(ToCoords(i), model);
-               }
+               blocks[i].type->FillModel(ToCoords(i), model);
        }
 
        model.Invalidate();