X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgenerator.cpp;h=15a15e02fc6f381596bb1dbeb822204012406b1f;hb=46509f82dcea114b004c53a7f3a9608f2518077f;hp=60708e021a01c93751b1aa767963cc3add0c4d57;hpb=28fda9f7f55a9e806ade3f49f4e94f0242ec2c3c;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); } } }