1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Mgv6: Add optional snow biomes

This commit is contained in:
paramat 2015-04-03 00:56:29 +01:00
parent ce8a9ed94b
commit 75cbd80e5b
2 changed files with 188 additions and 105 deletions

View file

@ -25,11 +25,17 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#define AVERAGE_MUD_AMOUNT 4
#define DESERT_STONE_BASE -32
#define ICE_BASE 0
#define FREQ_HOT 0.4
#define FREQ_SNOW -0.4
#define FREQ_TAIGA 0.5
#define FREQ_JUNGLE 0.7
/////////////////// Mapgen V6 flags
//////////// Mapgen V6 flags
#define MGV6_JUNGLES 0x01
#define MGV6_BIOMEBLEND 0x02
#define MGV6_MUDFLOW 0x04
#define MGV6_SNOWBIOMES 0x08
extern FlagDesc flagdesc_mapgen_v6[];
@ -38,9 +44,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;
@ -64,6 +74,7 @@ struct MapgenV6Params : public MapgenSpecificParams {
void writeParams(Settings *settings) const;
};
class MapgenV6 : public Mapgen {
public:
EmergeManager *m_emerge;
@ -85,6 +96,7 @@ public:
Noise *noise_mud;
Noise *noise_beach;
Noise *noise_biome;
Noise *noise_humidity;
NoiseParams *np_cave;
NoiseParams *np_humidity;
NoiseParams *np_trees;
@ -102,6 +114,10 @@ public:
content_t c_cobble;
content_t c_desert_sand;
content_t c_desert_stone;
content_t c_dirt_with_snow;
content_t c_snow;
content_t c_snowblock;
content_t c_ice;
content_t c_mossycobble;
content_t c_sandbrick;
@ -145,6 +161,7 @@ public:
virtual void generateCaves(int max_stone_y);
};
struct MapgenFactoryV6 : public MapgenFactory {
Mapgen *createMapgen(int mgid, MapgenParams *params, EmergeManager *emerge)
{
@ -157,4 +174,5 @@ struct MapgenFactoryV6 : public MapgenFactory {
};
};
#endif