X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgenerator.hpp;h=dedfb72b7c94fc5461bf795accf09d33f9b86542;hb=e53a0e2e711a7d8bd9b0ddacd1360aa14370643f;hp=9dc39cb54a30bbdd19d59ab79506898472c6c523;hpb=2d5671c2ef977defae9ce0ce7248582ab3e8f011;p=blank.git diff --git a/src/generator.hpp b/src/generator.hpp index 9dc39cb..dedfb72 100644 --- a/src/generator.hpp +++ b/src/generator.hpp @@ -13,21 +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 Space(Block::Type t) { space = t; } + 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; };