X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgenerator.cpp;h=15a15e02fc6f381596bb1dbeb822204012406b1f;hb=1b022dd17364c9e3344afd86572f2ead14973cde;hp=10cb668c9cfb491681987501fe8a0f68199f6683;hpb=8acc3f990f1a5ee00471f72c150b407164149f2d;p=blank.git diff --git a/src/generator.cpp b/src/generator.cpp index 10cb668..15a15e0 100644 --- a/src/generator.cpp +++ b/src/generator.cpp @@ -10,6 +10,7 @@ Generator::Generator(unsigned int seed) , typeNoise(seed + 1) , stretch(64.0f) , solid_threshold(0.8f) +, space(0) , solids() { } @@ -28,11 +29,14 @@ void Generator::operator ()(Chunk &chunk) const { if (val > solid_threshold) { int type_val = int((typeNoise(gen_pos) + 1.0f) * solids.size()) % solids.size(); chunk.BlockAt(block_pos) = Block(solids[type_val]); + } else { + chunk.BlockAt(block_pos) = Block(space); } } } } chunk.Invalidate(); + chunk.CheckUpdate(); } }