]> git.lizzy.rs Git - minetest.git/blobdiff - src/dungeongen.h
Lua_api.txt: Add documentation for 'eye_height' player object property
[minetest.git] / src / dungeongen.h
index ff1d0bc33eb77a17f3b79c4c0c404e483e330283..6799db79ee9834ed536f26e04d826dff7d989598 100644 (file)
@@ -17,8 +17,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
 
-#ifndef DUNGEONGEN_HEADER
-#define DUNGEONGEN_HEADER
+#pragma once
 
 #include "voxel.h"
 #include "noise.h"
@@ -29,7 +28,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define VMANIP_FLAG_DUNGEON_UNTOUCHABLE (\
                VMANIP_FLAG_DUNGEON_INSIDE|VMANIP_FLAG_DUNGEON_PRESERVE)
 
-class ManualMapVoxelManipulator;
+class MMVManip;
 class INodeDefManager;
 
 v3s16 rand_ortho_dir(PseudoRandom &random, bool diagonal_dirs);
@@ -39,26 +38,39 @@ int dir_to_facedir(v3s16 d);
 
 
 struct DungeonParams {
+       s32 seed;
+
        content_t c_water;
-       content_t c_cobble;
-       content_t c_moss;
+       content_t c_river_water;
+       content_t c_wall;
+       content_t c_alt_wall;
        content_t c_stair;
 
-       GenNotifyType notifytype;
        bool diagonal_dirs;
-       float mossratio;
+       bool only_in_ground;
        v3s16 holesize;
-       v3s16 roomsize;
+       u16 corridor_len_min;
+       u16 corridor_len_max;
+       v3s16 room_size_min;
+       v3s16 room_size_max;
+       v3s16 room_size_large_min;
+       v3s16 room_size_large_max;
+       u16 rooms_min;
+       u16 rooms_max;
+       s16 y_min;
+       s16 y_max;
+       GenNotifyType notifytype;
 
-       NoiseParams np_rarity;
-       NoiseParams np_wetness;
        NoiseParams np_density;
+       NoiseParams np_alt_wall;
 };
 
 class DungeonGen {
 public:
-       ManualMapVoxelManipulator *vm;
-       Mapgen *mg;
+       MMVManip *vm;
+       INodeDefManager *ndef;
+       GenerateNotifier *gennotify;
+
        u32 blockseed;
        PseudoRandom random;
        v3s16 csize;
@@ -66,17 +78,20 @@ class DungeonGen {
        content_t c_torch;
        DungeonParams dp;
 
-       //RoomWalker
+       // RoomWalker
        v3s16 m_pos;
        v3s16 m_dir;
 
-       DungeonGen(Mapgen *mg, DungeonParams *dparams);
-       void generate(u32 bseed, v3s16 full_node_min, v3s16 full_node_max);
+       DungeonGen(INodeDefManager *ndef,
+               GenerateNotifier *gennotify, DungeonParams *dparams);
+
+       void generate(MMVManip *vm, u32 bseed,
+               v3s16 full_node_min, v3s16 full_node_max);
 
        void makeDungeon(v3s16 start_padding);
        void makeRoom(v3s16 roomsize, v3s16 roomplace);
        void makeCorridor(v3s16 doorplace, v3s16 doordir,
-                                         v3s16 &result_place, v3s16 &result_dir);
+               v3s16 &result_place, v3s16 &result_dir);
        void makeDoor(v3s16 doorplace, v3s16 doordir);
        void makeFill(v3s16 place, v3s16 size, u8 avoid_flags, MapNode n, u8 or_flags);
        void makeHole(v3s16 place);
@@ -85,14 +100,11 @@ class DungeonGen {
        bool findPlaceForRoomDoor(v3s16 roomsize, v3s16 &result_doorplace,
                        v3s16 &result_doordir, v3s16 &result_roomplace);
 
-       void randomizeDir()
+       inline void randomizeDir()
        {
                m_dir = rand_ortho_dir(random, dp.diagonal_dirs);
        }
 };
 
-extern NoiseParams nparams_dungeon_rarity;
-extern NoiseParams nparams_dungeon_wetness;
 extern NoiseParams nparams_dungeon_density;
-
-#endif
+extern NoiseParams nparams_dungeon_alt_wall;