Minetest 5.9.0-dev
 
Loading...
Searching...
No Matches
mapgen_carpathian.h
Go to the documentation of this file.
1/*
2Minetest
3Copyright (C) 2017-2019 vlapsley, Vaughan Lapsley <vlapsley@gmail.com>
4Copyright (C) 2017-2019 paramat
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
25#define MGCARPATHIAN_CAVERNS 0x01
26#define MGCARPATHIAN_RIVERS 0x02
27
28class BiomeManager;
29
31
32
34{
35 float base_level = 12.0f;
36 float river_width = 0.05f;
37 float river_depth = 24.0f;
38 float valley_width = 0.25f;
39
40 float cave_width = 0.09f;
46 float large_cave_flooded = 0.5f;
47 s16 cavern_limit = -256;
48 s16 cavern_taper = 256;
49 float cavern_threshold = 0.7f;
50 s16 dungeon_ymin = -31000;
51 s16 dungeon_ymax = 31000;
52
70
73
74 void readParams(const Settings *settings);
75 void writeParams(Settings *settings) const;
76 void setDefaultSettings(Settings *settings);
77};
78
80{
81public:
84
85 virtual MapgenType getType() const { return MAPGEN_CARPATHIAN; }
86
87 virtual void makeChunk(BlockMakeData *data);
89
90private:
95
106 Noise *noise_rivers = nullptr;
108
110
111 float getSteps(float noise);
112 inline float getLerp(float noise1, float noise2, float mod);
113 int generateTerrain();
114};
Definition: mg_biome.h:211
Definition: emerge.h:98
Definition: mapgen.h:294
Definition: mapgen_carpathian.h:80
Noise * noise_step_mnt
Definition: mapgen_carpathian.h:105
Noise * noise_mnt_var
Definition: mapgen_carpathian.h:107
int getSpawnLevelAtPoint(v2s16 p)
Definition: mapgen_carpathian.cpp:343
float river_depth
Definition: mapgen_carpathian.h:93
Noise * noise_ridge_mnt
Definition: mapgen_carpathian.h:104
Noise * noise_rivers
Definition: mapgen_carpathian.h:106
float getSteps(float noise)
Definition: mapgen_carpathian.cpp:245
float base_level
Definition: mapgen_carpathian.h:91
Noise * noise_height3
Definition: mapgen_carpathian.h:98
Noise * noise_step_terrain
Definition: mapgen_carpathian.h:102
virtual MapgenType getType() const
Definition: mapgen_carpathian.h:85
virtual void makeChunk(BlockMakeData *data)
Definition: mapgen_carpathian.cpp:258
Noise * noise_ridge_terrain
Definition: mapgen_carpathian.h:101
float river_width
Definition: mapgen_carpathian.h:92
float getLerp(float noise1, float noise2, float mod)
Definition: mapgen_carpathian.cpp:239
Noise * noise_hills_terrain
Definition: mapgen_carpathian.h:100
Noise * noise_height1
Definition: mapgen_carpathian.h:96
Noise * noise_height2
Definition: mapgen_carpathian.h:97
~MapgenCarpathian()
Definition: mapgen_carpathian.cpp:103
float valley_width
Definition: mapgen_carpathian.h:94
int generateTerrain()
Definition: mapgen_carpathian.cpp:440
Noise * noise_height4
Definition: mapgen_carpathian.h:99
Noise * noise_hills
Definition: mapgen_carpathian.h:103
s32 grad_wl
Definition: mapgen_carpathian.h:109
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_CARPATHIAN
Definition: mapgen.h:120
FlagDesc flagdesc_mapgen_carpathian[]
Definition: mapgen_carpathian.cpp:42
Definition: emerge.h:51
Definition: string.h:80
Definition: mapgen_carpathian.h:34
s16 cavern_limit
Definition: mapgen_carpathian.h:47
NoiseParams np_cave1
Definition: mapgen_carpathian.h:66
NoiseParams np_mnt_var
Definition: mapgen_carpathian.h:65
NoiseParams np_ridge_mnt
Definition: mapgen_carpathian.h:62
s16 large_cave_depth
Definition: mapgen_carpathian.h:41
NoiseParams np_height1
Definition: mapgen_carpathian.h:54
void writeParams(Settings *settings) const
Definition: mapgen_carpathian.cpp:187
float river_width
Definition: mapgen_carpathian.h:36
NoiseParams np_step_terrain
Definition: mapgen_carpathian.h:60
u16 small_cave_num_min
Definition: mapgen_carpathian.h:42
NoiseParams np_cave2
Definition: mapgen_carpathian.h:67
void setDefaultSettings(Settings *settings)
Definition: mapgen_carpathian.cpp:229
NoiseParams np_height4
Definition: mapgen_carpathian.h:57
NoiseParams np_hills
Definition: mapgen_carpathian.h:61
NoiseParams np_dungeons
Definition: mapgen_carpathian.h:69
s16 dungeon_ymin
Definition: mapgen_carpathian.h:50
NoiseParams np_rivers
Definition: mapgen_carpathian.h:64
float river_depth
Definition: mapgen_carpathian.h:37
s16 dungeon_ymax
Definition: mapgen_carpathian.h:51
u16 large_cave_num_max
Definition: mapgen_carpathian.h:45
NoiseParams np_height2
Definition: mapgen_carpathian.h:55
u16 small_cave_num_max
Definition: mapgen_carpathian.h:43
NoiseParams np_ridge_terrain
Definition: mapgen_carpathian.h:59
MapgenCarpathianParams()
Definition: mapgen_carpathian.cpp:123
float cave_width
Definition: mapgen_carpathian.h:40
NoiseParams np_hills_terrain
Definition: mapgen_carpathian.h:58
~MapgenCarpathianParams()=default
NoiseParams np_height3
Definition: mapgen_carpathian.h:56
NoiseParams np_step_mnt
Definition: mapgen_carpathian.h:63
void readParams(const Settings *settings)
Definition: mapgen_carpathian.cpp:145
u16 large_cave_num_min
Definition: mapgen_carpathian.h:44
float large_cave_flooded
Definition: mapgen_carpathian.h:46
float cavern_threshold
Definition: mapgen_carpathian.h:49
float base_level
Definition: mapgen_carpathian.h:35
float valley_width
Definition: mapgen_carpathian.h:38
s16 cavern_taper
Definition: mapgen_carpathian.h:48
NoiseParams np_cavern
Definition: mapgen_carpathian.h:68
NoiseParams np_filler_depth
Definition: mapgen_carpathian.h:53
Definition: mapgen.h:129
Definition: noise.h:119
static std::string p(std::string path)
Definition: test_filesys.cpp:64