X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;ds=sidebyside;f=src%2Fdungeongen.h;h=4bd208330714387e755328936aafeabc80ab7b5a;hb=57e5aa662851485902575c3c747437e365bf72c8;hp=4a0bfcefd85c2eb2552f9c2d6918cbba50ffffa9;hpb=c3708b456e90bccf19e7c82c54a93c8cb7c8896c;p=minetest.git diff --git a/src/dungeongen.h b/src/dungeongen.h index 4a0bfcefd..4bd208330 100644 --- a/src/dungeongen.h +++ b/src/dungeongen.h @@ -22,15 +22,15 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "voxel.h" #include "noise.h" +#include "mapgen.h" #define VMANIP_FLAG_DUNGEON_INSIDE VOXELFLAG_CHECKED1 #define VMANIP_FLAG_DUNGEON_PRESERVE VOXELFLAG_CHECKED2 #define VMANIP_FLAG_DUNGEON_UNTOUCHABLE (\ VMANIP_FLAG_DUNGEON_INSIDE|VMANIP_FLAG_DUNGEON_PRESERVE) -class ManualMapVoxelManipulator; +class MMVManip; class INodeDefManager; -class Mapgen; v3s16 rand_ortho_dir(PseudoRandom &random, bool diagonal_dirs); v3s16 turn_xz(v3s16 olddir, int t); @@ -39,44 +39,60 @@ 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; - int 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; 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); @@ -84,15 +100,14 @@ class DungeonGen { bool findPlaceForDoor(v3s16 &result_place, v3s16 &result_dir); 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; +extern NoiseParams nparams_dungeon_alt_wall; #endif