X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fmapgen_v5.h;h=44b0a09e7b148836215c7d89559ac335b86bf6ae;hb=e6e5fa3bf8853f149fdef16b39af3981097176a4;hp=6f98ad2e4081de12973bb715dd84edb2e0e24f9d;hpb=a1e9732407494edb9cef3ada45cc2781a34ed60c;p=dragonfireclient.git diff --git a/src/mapgen_v5.h b/src/mapgen_v5.h index 6f98ad2e4..44b0a09e7 100644 --- a/src/mapgen_v5.h +++ b/src/mapgen_v5.h @@ -1,6 +1,7 @@ /* Minetest -Copyright (C) 2010-2013 kwolekr, Ryan Kwolek +Copyright (C) 2014-2017 paramat +Copyright (C) 2014-2016 kwolekr, Ryan Kwolek This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -17,99 +18,57 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef MAPGEN_V5_HEADER -#define MAPGEN_V5_HEADER +#pragma once #include "mapgen.h" -/////////////////// Mapgen V5 flags -#define MGV5_BLOBS 0x01 +///////// Mapgen V5 flags +#define MGV5_CAVERNS 0x01 + +class BiomeManager; extern FlagDesc flagdesc_mapgen_v5[]; +struct MapgenV5Params : public MapgenParams +{ + u32 spflags = MGV5_CAVERNS; + float cave_width = 0.125f; + s16 large_cave_depth = -256; + s16 lava_depth = -256; + s16 cavern_limit = -256; + s16 cavern_taper = 256; + float cavern_threshold = 0.7f; -struct MapgenV5Params : public MapgenSpecificParams { - u32 spflags; NoiseParams np_filler_depth; NoiseParams np_factor; NoiseParams np_height; + NoiseParams np_ground; NoiseParams np_cave1; NoiseParams np_cave2; - NoiseParams np_ground; - NoiseParams np_crumble; - NoiseParams np_wetness; + NoiseParams np_cavern; MapgenV5Params(); - ~MapgenV5Params() {} - - void readParams(Settings *settings); - void writeParams(Settings *settings); -}; + ~MapgenV5Params() = default; + void readParams(const Settings *settings); + void writeParams(Settings *settings) const; +}; -class MapgenV5 : public Mapgen { +class MapgenV5 : public MapgenBasic +{ public: - EmergeManager *emerge; - BiomeDefManager *bmgr; - - int ystride; - int zstride; - u32 flags; - u32 spflags; - - u32 blockseed; - v3s16 node_min; - v3s16 node_max; - v3s16 full_node_min; - v3s16 full_node_max; - - Noise *noise_filler_depth; - Noise *noise_factor; - Noise *noise_height; - Noise *noise_cave1; - Noise *noise_cave2; - Noise *noise_ground; - Noise *noise_crumble; - Noise *noise_wetness; - Noise *noise_heat; - Noise *noise_humidity; - - content_t c_stone; - content_t c_dirt; - content_t c_dirt_with_grass; - content_t c_sand; - content_t c_water_source; - content_t c_lava_source; - content_t c_ice; - content_t c_gravel; - content_t c_cobble; - content_t c_desert_sand; - content_t c_desert_stone; - content_t c_mossycobble; - content_t c_sandbrick; - content_t c_stair_cobble; - content_t c_stair_sandstone; - - MapgenV5(int mapgenid, MapgenParams *params, EmergeManager *emerge_); + MapgenV5(int mapgenid, MapgenV5Params *params, EmergeManager *emerge); ~MapgenV5(); - - virtual void makeChunk(BlockMakeData *data); - void calculateNoise(); - void generateBaseTerrain(); - void generateBlobs(); - void generateBiomes(); - void dustTopNodes(); -}; + virtual MapgenType getType() const { return MAPGEN_V5; } -struct MapgenFactoryV5 : public MapgenFactory { - Mapgen *createMapgen(int mgid, MapgenParams *params, EmergeManager *emerge) { - return new MapgenV5(mgid, params, emerge); - }; - - MapgenSpecificParams *createMapgenParams() { - return new MapgenV5Params(); - }; -}; + virtual void makeChunk(BlockMakeData *data); + int getSpawnLevelAtPoint(v2s16 p); + int generateBaseTerrain(); -#endif +private: + s16 large_cave_depth; + Noise *noise_factor; + Noise *noise_height; + Noise *noise_ground; +};