]> git.localhorst.tv Git - blank.git/blobdiff - src/world/Generator.hpp
block type prototypability and new types
[blank.git] / src / world / Generator.hpp
index 5251ac69aed002c3a97e5b488e1ff863ddeba07c..cf94356a482ccfd2a5e028a83975d027f63c11c9 100644 (file)
@@ -2,15 +2,16 @@
 #define BLANK_WORLD_GENERATOR_HPP_
 
 #include "../rand/SimplexNoise.hpp"
-#include "../rand/WorleyNoise.hpp"
 
 #include <cstdint>
+#include <vector>
 #include <glm/glm.hpp>
 
 
 namespace blank {
 
 class Block;
+class BlockType;
 class BlockTypeRegistry;
 class Chunk;
 
@@ -28,16 +29,15 @@ public:
                        float growth;
                };
                NoiseParam solidity = { 0xA85033F6BCBDD110, 3, 0.5f, 1.0f/64.0f, 2.0f, 2.0f };
-               NoiseParam humidity = { 0x3A463FB24B04A901, 3, 0.5f, 1.0f/256.0f, 2.0f, 2.0f };
-               NoiseParam temperature = { 0x2530BA6C6134A9FB, 3, 0.5f, 1.0f/512.0f, 2.0f, 2.0f };
+               NoiseParam humidity = { 0x3A463FB24B04A901, 2, 0.5f, 1.0f/512.0f, 2.0f, 2.0f };
+               NoiseParam temperature = { 0x2530BA6C6134A9FB, 2, 0.5f, 1.0f/1024.0f, 2.0f, 2.0f };
                NoiseParam richness = { 0x95A179F180103446, 3, 0.5f, 1.0f/128.0f, 2.0f, 2.0f };
                NoiseParam randomness = { 0x074453EEE1496390, 3, 0.5f, 1.0f/16.0f, 2.0f, 2.0f };
        };
 
-       explicit Generator(const Config &, const BlockTypeRegistry &) noexcept;
+       explicit Generator(const Config &) noexcept;
 
-       // scan types for generation
-       void Scan();
+       void LoadTypes(const BlockTypeRegistry &);
 
        void operator ()(Chunk &) const noexcept;
 
@@ -50,7 +50,9 @@ private:
 
 private:
        const Config &config;
-       const BlockTypeRegistry &types;
+       std::vector<const BlockType *> types;
+       float min_solidity;
+
        SimplexNoise solidity_noise;
        SimplexNoise humidity_noise;
        SimplexNoise temperature_noise;