X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fmapgen_v5.h;h=44a06907da0ac25814a0d89f4bada63d90f3d68b;hb=65c09a96f41705bb8e75fc5ff4276342be91ed11;hp=84e63672b9be64ed717de602f2ecb2aca17d3f42;hpb=d39887daddf36c08ee1297ecf02a01d72a652026;p=minetest.git diff --git a/src/mapgen_v5.h b/src/mapgen_v5.h index 84e63672b..44a06907d 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) 2010-2015 kwolekr, Ryan Kwolek +Copyright (C) 2010-2015 paramat, Matt Gregory 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 @@ -22,8 +23,9 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "mapgen.h" -/////////////////// Mapgen V5 flags -#define MGV5_BLOBS 0x01 +#define MGV5_LARGE_CAVE_DEPTH -256 + +class BiomeManager; extern FlagDesc flagdesc_mapgen_v5[]; @@ -36,79 +38,75 @@ struct MapgenV5Params : public MapgenSpecificParams { NoiseParams np_cave1; NoiseParams np_cave2; NoiseParams np_ground; - NoiseParams np_crumble; - NoiseParams np_wetness; MapgenV5Params(); ~MapgenV5Params() {} - - void readParams(Settings *settings); - void writeParams(Settings *settings); + + void readParams(const Settings *settings); + void writeParams(Settings *settings) const; }; class MapgenV5 : public Mapgen { public: - EmergeManager *emerge; + EmergeManager *m_emerge; BiomeManager *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; + Noise *noise_heat_blend; + Noise *noise_humidity_blend; 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_desert_stone; content_t c_ice; - content_t c_gravel; + content_t c_sandstone; + 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; + content_t c_mossycobble; + content_t c_sandstonebrick; + content_t c_stair_sandstonebrick; - MapgenV5(int mapgenid, MapgenParams *params, EmergeManager *emerge_); + MapgenV5(int mapgenid, MapgenParams *params, EmergeManager *emerge); ~MapgenV5(); - + virtual void makeChunk(BlockMakeData *data); - int getGroundLevelAtPoint(v2s16 p); + int getSpawnLevelAtPoint(v2s16 p); void calculateNoise(); - void generateBaseTerrain(); - void generateBlobs(); - void generateBiomes(); + int generateBaseTerrain(); + MgStoneType generateBiomes(float *heat_map, float *humidity_map); + void generateCaves(int max_stone_y); void dustTopNodes(); }; struct MapgenFactoryV5 : public MapgenFactory { - Mapgen *createMapgen(int mgid, MapgenParams *params, EmergeManager *emerge) { + Mapgen *createMapgen(int mgid, MapgenParams *params, EmergeManager *emerge) + { return new MapgenV5(mgid, params, emerge); }; - - MapgenSpecificParams *createMapgenParams() { + + MapgenSpecificParams *createMapgenParams() + { return new MapgenV5Params(); }; };