X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgenerator.cpp;h=15a15e02fc6f381596bb1dbeb822204012406b1f;hb=2d5671c2ef977defae9ce0ce7248582ab3e8f011;hp=60708e021a01c93751b1aa767963cc3add0c4d57;hpb=374843f5b3ae60c0d02704a8da5100ac8abe7f1a;p=blank.git diff --git a/src/generator.cpp b/src/generator.cpp index 60708e0..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,6 +29,8 @@ 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); } } }