Minetest 5.9.0-dev
 
Loading...
Searching...
No Matches
mapgen_flat.h
Go to the documentation of this file.
1/*
2Minetest
3Copyright (C) 2015-2020 paramat
4Copyright (C) 2015-2016 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
5
6This program is free software; you can redistribute it and/or modify
7it under the terms of the GNU Lesser General Public License as published by
8the Free Software Foundation; either version 2.1 of the License, or
9(at your option) any later version.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU Lesser General Public License for more details.
15
16You should have received a copy of the GNU Lesser General Public License along
17with this program; if not, write to the Free Software Foundation, Inc.,
1851 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20
21#pragma once
22
23#include "mapgen.h"
24
26#define MGFLAT_LAKES 0x01
27#define MGFLAT_HILLS 0x02
28#define MGFLAT_CAVERNS 0x04
29
30class BiomeManager;
31
33
35{
36 s16 ground_level = 8;
37 float lake_threshold = -0.45f;
38 float lake_steepness = 48.0f;
39 float hill_threshold = 0.45f;
40 float hill_steepness = 64.0f;
41
42 float cave_width = 0.09f;
48 float large_cave_flooded = 0.5f;
49 s16 cavern_limit = -256;
50 s16 cavern_taper = 256;
51 float cavern_threshold = 0.7f;
52 s16 dungeon_ymin = -31000;
53 s16 dungeon_ymax = 31000;
54
61
63 ~MapgenFlatParams() = default;
64
65 void readParams(const Settings *settings);
66 void writeParams(Settings *settings) const;
67 void setDefaultSettings(Settings *settings);
68};
69
70class MapgenFlat : public MapgenBasic
71{
72public:
75
76 virtual MapgenType getType() const { return MAPGEN_FLAT; }
77
78 virtual void makeChunk(BlockMakeData *data);
80 s16 generateTerrain();
81
82private:
88
90};
Definition: mg_biome.h:211
Definition: emerge.h:98
Definition: mapgen.h:294
Definition: mapgen_flat.h:71
virtual void makeChunk(BlockMakeData *data)
Definition: mapgen_flat.cpp:207
float lake_steepness
Definition: mapgen_flat.h:85
s16 generateTerrain()
Definition: mapgen_flat.cpp:290
Noise * noise_terrain
Definition: mapgen_flat.h:89
float lake_threshold
Definition: mapgen_flat.h:84
float hill_steepness
Definition: mapgen_flat.h:87
int getSpawnLevelAtPoint(v2s16 p)
Definition: mapgen_flat.cpp:177
s16 ground_level
Definition: mapgen_flat.h:83
float hill_threshold
Definition: mapgen_flat.h:86
~MapgenFlat()
Definition: mapgen_flat.cpp:88
virtual MapgenType getType() const
Definition: mapgen_flat.h:76
Definition: noise.h:146
Definition: settings.h:124
core::vector2d< s16 > v2s16
Definition: irr_v2d.h:27
static LightingParams params
Definition: light.cpp:40
MapgenType
Definition: mapgen.h:117
@ MAPGEN_FLAT
Definition: mapgen.h:122
FlagDesc flagdesc_mapgen_flat[]
Definition: mapgen_flat.cpp:41
Definition: emerge.h:51
Definition: string.h:80
Definition: mapgen_flat.h:35
NoiseParams np_terrain
Definition: mapgen_flat.h:55
float lake_steepness
Definition: mapgen_flat.h:38
NoiseParams np_cave1
Definition: mapgen_flat.h:58
s16 cavern_limit
Definition: mapgen_flat.h:49
~MapgenFlatParams()=default
s16 large_cave_depth
Definition: mapgen_flat.h:47
void readParams(const Settings *settings)
Definition: mapgen_flat.cpp:108
u16 small_cave_num_max
Definition: mapgen_flat.h:44
void writeParams(Settings *settings) const
Definition: mapgen_flat.cpp:138
u16 large_cave_num_min
Definition: mapgen_flat.h:45
float large_cave_flooded
Definition: mapgen_flat.h:48
NoiseParams np_filler_depth
Definition: mapgen_flat.h:56
float cavern_threshold
Definition: mapgen_flat.h:51
s16 ground_level
Definition: mapgen_flat.h:36
float lake_threshold
Definition: mapgen_flat.h:37
void setDefaultSettings(Settings *settings)
Definition: mapgen_flat.cpp:168
float hill_steepness
Definition: mapgen_flat.h:40
NoiseParams np_dungeons
Definition: mapgen_flat.h:60
NoiseParams np_cavern
Definition: mapgen_flat.h:57
NoiseParams np_cave2
Definition: mapgen_flat.h:59
s16 dungeon_ymax
Definition: mapgen_flat.h:53
s16 dungeon_ymin
Definition: mapgen_flat.h:52
u16 small_cave_num_min
Definition: mapgen_flat.h:43
u16 large_cave_num_max
Definition: mapgen_flat.h:46
float hill_threshold
Definition: mapgen_flat.h:39
MapgenFlatParams()
Definition: mapgen_flat.cpp:97
float cave_width
Definition: mapgen_flat.h:42
s16 cavern_taper
Definition: mapgen_flat.h:50
Definition: mapgen.h:129
Definition: noise.h:119
static std::string p(std::string path)
Definition: test_filesys.cpp:64