]> git.lizzy.rs Git - minetest.git/blobdiff - src/mapgen/dungeongen.h
Optimize random turns in dungeongen (#8129)
[minetest.git] / src / mapgen / dungeongen.h
index e72516de118dcaf1ecfa484f2958f0752fe5b7de..7d04a6254b94c6fc9d79e400c57158ccb58f8b1c 100644 (file)
@@ -30,19 +30,17 @@ with this program; if not, write to the Free Software Foundation, Inc.,
                VMANIP_FLAG_DUNGEON_INSIDE|VMANIP_FLAG_DUNGEON_PRESERVE)
 
 class MMVManip;
-class INodeDefManager;
+class NodeDefManager;
 
 v3s16 rand_ortho_dir(PseudoRandom &random, bool diagonal_dirs);
 v3s16 turn_xz(v3s16 olddir, int t);
-v3s16 random_turn(PseudoRandom &random, v3s16 olddir);
+void random_turn(PseudoRandom &random, v3s16 &dir);
 int dir_to_facedir(v3s16 d);
 
 
 struct DungeonParams {
        s32 seed;
 
-       content_t c_water;
-       content_t c_river_water;
        content_t c_wall;
        content_t c_alt_wall;
        content_t c_stair;
@@ -58,8 +56,6 @@ struct DungeonParams {
        v3s16 room_size_large_max;
        u16 rooms_min;
        u16 rooms_max;
-       s16 y_min;
-       s16 y_max;
        GenNotifyType notifytype;
 
        NoiseParams np_density;
@@ -68,8 +64,8 @@ struct DungeonParams {
 
 class DungeonGen {
 public:
-       MMVManip *vm;
-       INodeDefManager *ndef;
+       MMVManip *vm = nullptr;
+       const NodeDefManager *ndef;
        GenerateNotifier *gennotify;
 
        u32 blockseed;
@@ -83,7 +79,7 @@ class DungeonGen {
        v3s16 m_pos;
        v3s16 m_dir;
 
-       DungeonGen(INodeDefManager *ndef,
+       DungeonGen(const NodeDefManager *ndef,
                GenerateNotifier *gennotify, DungeonParams *dparams);
 
        void generate(MMVManip *vm, u32 bseed,