X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgenerator.hpp;h=dedfb72b7c94fc5461bf795accf09d33f9b86542;hb=76b3ec0f6aa0dacf6d4944a2787991f3585299e8;hp=a40184bf719794e2cde735da82c865e452d3aca8;hpb=8acc3f990f1a5ee00471f72c150b407164149f2d;p=blank.git diff --git a/src/generator.hpp b/src/generator.hpp index a40184b..dedfb72 100644 --- a/src/generator.hpp +++ b/src/generator.hpp @@ -13,19 +13,30 @@ namespace blank { class Generator { public: - explicit Generator(unsigned int seed); + struct Config { + unsigned int solid_seed = 0; + unsigned int type_seed = 0; + float stretch = 64.0f; + float solid_threshold = 0.5f; + }; - void operator ()(Chunk &) const; + explicit Generator(const Config &) noexcept; + void operator ()(Chunk &) const noexcept; + + void Space(Block::Type t) noexcept { space = t; } + void Light(Block::Type t) noexcept { light = t; } void Solids(const std::vector &s) { solids = s; } private: SimplexNoise solidNoise; - SimplexNoise typeNoise; + WorleyNoise typeNoise; float stretch; float solid_threshold; + Block::Type space; + Block::Type light; std::vector solids; };