2024-10-28 15:57:39 +01:00
|
|
|
// Luanti
|
|
|
|
// SPDX-License-Identifier: LGPL-2.1-or-later
|
|
|
|
// Copyright (C) 2014-2018 paramat
|
|
|
|
// Copyright (C) 2014-2018 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
|
2014-10-16 12:45:55 +01:00
|
|
|
|
2017-08-17 22:19:39 +02:00
|
|
|
#pragma once
|
2014-10-16 12:45:55 +01:00
|
|
|
|
|
|
|
#include "mapgen.h"
|
|
|
|
|
2017-03-12 13:26:09 +00:00
|
|
|
///////// Mapgen V5 flags
|
|
|
|
#define MGV5_CAVERNS 0x01
|
|
|
|
|
2015-01-21 13:24:11 +00:00
|
|
|
class BiomeManager;
|
2014-10-16 12:45:55 +01:00
|
|
|
|
|
|
|
extern FlagDesc flagdesc_mapgen_v5[];
|
|
|
|
|
2017-04-23 09:52:40 +02:00
|
|
|
struct MapgenV5Params : public MapgenParams
|
|
|
|
{
|
2018-08-16 19:10:56 +01:00
|
|
|
float cave_width = 0.09f;
|
2017-06-20 04:55:32 +01:00
|
|
|
s16 large_cave_depth = -256;
|
2019-11-08 03:09:43 +00:00
|
|
|
u16 small_cave_num_min = 0;
|
|
|
|
u16 small_cave_num_max = 0;
|
|
|
|
u16 large_cave_num_min = 0;
|
|
|
|
u16 large_cave_num_max = 2;
|
|
|
|
float large_cave_flooded = 0.5f;
|
2017-06-17 19:11:28 +02:00
|
|
|
s16 cavern_limit = -256;
|
|
|
|
s16 cavern_taper = 256;
|
|
|
|
float cavern_threshold = 0.7f;
|
2018-02-17 17:43:13 +00:00
|
|
|
s16 dungeon_ymin = -31000;
|
|
|
|
s16 dungeon_ymax = 31000;
|
2017-03-12 13:26:09 +00:00
|
|
|
|
2014-10-16 12:45:55 +01:00
|
|
|
NoiseParams np_filler_depth;
|
|
|
|
NoiseParams np_factor;
|
|
|
|
NoiseParams np_height;
|
2017-03-12 13:26:09 +00:00
|
|
|
NoiseParams np_ground;
|
2014-10-16 12:45:55 +01:00
|
|
|
NoiseParams np_cave1;
|
|
|
|
NoiseParams np_cave2;
|
2017-03-12 13:26:09 +00:00
|
|
|
NoiseParams np_cavern;
|
2019-06-01 20:50:43 +01:00
|
|
|
NoiseParams np_dungeons;
|
2014-10-16 12:45:55 +01:00
|
|
|
|
|
|
|
MapgenV5Params();
|
2017-08-19 09:12:54 +02:00
|
|
|
~MapgenV5Params() = default;
|
2014-12-06 04:18:04 -05:00
|
|
|
|
2015-01-26 12:44:49 +01:00
|
|
|
void readParams(const Settings *settings);
|
|
|
|
void writeParams(Settings *settings) const;
|
2020-01-25 16:56:54 +01:00
|
|
|
void setDefaultSettings(Settings *settings);
|
2014-10-16 12:45:55 +01:00
|
|
|
};
|
|
|
|
|
2017-04-23 09:52:40 +02:00
|
|
|
class MapgenV5 : public MapgenBasic
|
|
|
|
{
|
2014-10-16 12:45:55 +01:00
|
|
|
public:
|
2020-04-10 02:05:20 +02:00
|
|
|
MapgenV5(MapgenV5Params *params, EmergeParams *emerge);
|
2016-05-22 02:17:19 -04:00
|
|
|
~MapgenV5();
|
|
|
|
|
2016-06-14 00:10:55 -04:00
|
|
|
virtual MapgenType getType() const { return MAPGEN_V5; }
|
|
|
|
|
2016-05-22 02:17:19 -04:00
|
|
|
virtual void makeChunk(BlockMakeData *data);
|
|
|
|
int getSpawnLevelAtPoint(v2s16 p);
|
|
|
|
int generateBaseTerrain();
|
|
|
|
|
|
|
|
private:
|
2014-10-16 12:45:55 +01:00
|
|
|
Noise *noise_factor;
|
|
|
|
Noise *noise_height;
|
|
|
|
Noise *noise_ground;
|
|
|
|
};
|