X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fmapgen_v6.h;h=a55fc6d534083dd458a6f38f26f1b05692c65397;hb=759fbabaea6fbd21497a1dc62a395af6e385518e;hp=64aa2d87a58463151c483379a147c35b606af7ed;hpb=f12118c38b7fb209d2eaeb0bca406e06be2c9650;p=minetest.git diff --git a/src/mapgen_v6.h b/src/mapgen_v6.h index 64aa2d87a..a55fc6d53 100644 --- a/src/mapgen_v6.h +++ b/src/mapgen_v6.h @@ -1,6 +1,6 @@ /* Minetest -Copyright (C) 2010-2013 celeron55, Perttu Ahola +Copyright (C) 2010-2015 celeron55, Perttu Ahola 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 @@ -23,12 +23,21 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "mapgen.h" #include "noise.h" -#define AVERAGE_MUD_AMOUNT 4 +#define MGV6_AVERAGE_MUD_AMOUNT 4 +#define MGV6_DESERT_STONE_BASE -32 +#define MGV6_ICE_BASE 0 +#define MGV6_FREQ_HOT 0.4 +#define MGV6_FREQ_SNOW -0.4 +#define MGV6_FREQ_TAIGA 0.5 +#define MGV6_FREQ_JUNGLE 0.5 -/////////////////// Mapgen V6 flags +//////////// Mapgen V6 flags #define MGV6_JUNGLES 0x01 #define MGV6_BIOMEBLEND 0x02 #define MGV6_MUDFLOW 0x04 +#define MGV6_SNOWBIOMES 0x08 +#define MGV6_FLAT 0x10 +#define MGV6_TREES 0x20 extern FlagDesc flagdesc_mapgen_v6[]; @@ -37,9 +46,13 @@ extern FlagDesc flagdesc_mapgen_v6[]; enum BiomeV6Type { BT_NORMAL, - BT_DESERT + BT_DESERT, + BT_JUNGLE, + BT_TUNDRA, + BT_TAIGA, }; + struct MapgenV6Params : public MapgenSpecificParams { u32 spflags; float freq_desert; @@ -59,10 +72,11 @@ struct MapgenV6Params : public MapgenSpecificParams { MapgenV6Params(); ~MapgenV6Params() {} - void readParams(Settings *settings); - void writeParams(Settings *settings); + void readParams(const Settings *settings); + void writeParams(Settings *settings) const; }; + class MapgenV6 : public Mapgen { public: EmergeManager *m_emerge; @@ -84,6 +98,7 @@ class MapgenV6 : public Mapgen { Noise *noise_mud; Noise *noise_beach; Noise *noise_biome; + Noise *noise_humidity; NoiseParams *np_cave; NoiseParams *np_humidity; NoiseParams *np_trees; @@ -98,20 +113,23 @@ class MapgenV6 : public Mapgen { content_t c_water_source; content_t c_lava_source; content_t c_gravel; - content_t c_cobble; - content_t c_desert_sand; content_t c_desert_stone; + content_t c_desert_sand; + content_t c_dirt_with_snow; + content_t c_snow; + content_t c_snowblock; + content_t c_ice; + content_t c_cobble; content_t c_mossycobble; - content_t c_sandbrick; content_t c_stair_cobble; - content_t c_stair_sandstone; MapgenV6(int mapgenid, MapgenParams *params, EmergeManager *emerge); ~MapgenV6(); void makeChunk(BlockMakeData *data); int getGroundLevelAtPoint(v2s16 p); + int getSpawnLevelAtPoint(v2s16 p); float baseTerrainLevel(float terrain_base, float terrain_higher, float steepness, float height_select); @@ -139,13 +157,12 @@ class MapgenV6 : public Mapgen { int generateGround(); void addMud(); void flowMud(s16 &mudflow_minpos, s16 &mudflow_maxpos); - void addDirtGravelBlobs(); void growGrass(); void placeTreesAndJungleGrass(); virtual void generateCaves(int max_stone_y); - virtual void generateExperimental() {} }; + struct MapgenFactoryV6 : public MapgenFactory { Mapgen *createMapgen(int mgid, MapgenParams *params, EmergeManager *emerge) { @@ -158,4 +175,5 @@ struct MapgenFactoryV6 : public MapgenFactory { }; }; + #endif