LuaVoxelManip: Add option to allocate blank data
[oweals/minetest.git] / src / mapgen.h
index 9cdb157e11184ec6682cfb24cc277af454fda20c..07202f9a227cca2f7d2dd42d66e484383fe6656c 100644 (file)
@@ -20,6 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #ifndef MAPGEN_HEADER
 #define MAPGEN_HEADER
 
+#include "noise.h"
 #include "nodedef.h"
 #include "mapnode.h"
 #include "util/string.h"
@@ -107,6 +108,9 @@ struct MapgenParams {
        s16 water_level;
        u32 flags;
 
+       NoiseParams np_biome_heat;
+       NoiseParams np_biome_humidity;
+
        MapgenSpecificParams *sparams;
 
        MapgenParams()
@@ -117,6 +121,8 @@ struct MapgenParams {
                chunksize   = 5;
                flags       = MG_TREES | MG_CAVES | MG_LIGHT;
                sparams     = NULL;
+               np_biome_heat     = NoiseParams(50, 50, v3f(500.0, 500.0, 500.0), 5349, 3, 0.5, 2.0);
+               np_biome_humidity = NoiseParams(50, 50, v3f(500.0, 500.0, 500.0), 842, 3, 0.5, 2.0);
        }
 };
 
@@ -172,7 +178,7 @@ public:
        static const char *ELEMENT_TITLE;
        static const size_t ELEMENT_LIMIT = -1;
 
-       GenElementManager() {}
+       GenElementManager(IGameDef *gamedef);
        virtual ~GenElementManager();
 
        virtual GenElement *create(int type) = 0;
@@ -181,11 +187,12 @@ public:
        virtual GenElement *get(u32 id);
        virtual GenElement *update(u32 id, GenElement *elem);
        virtual GenElement *remove(u32 id);
+       virtual void clear();
 
-       virtual GenElement *getByName(const char *name);
-       virtual GenElement *getByName(std::string &name);
+       virtual GenElement *getByName(const std::string &name);
 
 protected:
+       INodeDefManager *m_ndef;
        std::vector<GenElement *> m_elements;
 };