3 Copyright (C) 2010-2016 paramat, Matt Gregory
4 Copyright (C) 2010-2016 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
5 Copyright (C) 2017 vlapsley, Vaughan Lapsley <vlapsley@gmail.com>
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License as published by
9 the Free Software Foundation; either version 2.1 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU Lesser General Public License for more details.
17 You should have received a copy of the GNU Lesser General Public License along
18 with this program; if not, write to the Free Software Foundation, Inc.,
19 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #ifndef MAPGEN_CARPATHIAN_HEADER
23 #define MAPGEN_CARPATHIAN_HEADER
27 ///////// Mapgen Carpathian flags
28 #define MGCARPATHIAN_CAVERNS 0x01
32 extern FlagDesc flagdesc_mapgen_carpathian[];
35 struct MapgenCarpathianParams : public MapgenParams
37 u32 spflags = MGCARPATHIAN_CAVERNS;
38 float cave_width = 0.09f;
39 s16 large_cave_depth = -33;
40 s16 lava_depth = -256;
41 s16 cavern_limit = -256;
42 s16 cavern_taper = 256;
43 float cavern_threshold = 0.7f;
46 NoiseParams np_filler_depth;
47 NoiseParams np_height1;
48 NoiseParams np_height2;
49 NoiseParams np_height3;
50 NoiseParams np_height4;
51 NoiseParams np_hills_terrain;
52 NoiseParams np_ridge_terrain;
53 NoiseParams np_step_terrain;
55 NoiseParams np_ridge_mnt;
56 NoiseParams np_step_mnt;
57 NoiseParams np_mnt_var;
60 NoiseParams np_cavern;
62 MapgenCarpathianParams();
63 ~MapgenCarpathianParams() {}
65 void readParams(const Settings *settings);
66 void writeParams(Settings *settings) const;
69 class MapgenCarpathian : public MapgenBasic
72 MapgenCarpathian(int mapgenid, MapgenCarpathianParams *params,
73 EmergeManager *emerge);
76 virtual MapgenType getType() const { return MAPGEN_CARPATHIAN; }
78 float getSteps(float noise1, float noise2);
79 inline float getLerp(float noise1, float noise2, float mod);
81 virtual void makeChunk(BlockMakeData *data);
82 int getSpawnLevelAtPoint(v2s16 p);
93 Noise *noise_hills_terrain;
94 Noise *noise_ridge_terrain;
95 Noise *noise_step_terrain;
97 Noise *noise_ridge_mnt;
98 Noise *noise_step_mnt;
101 float terrainLevelAtPoint(s16 x, s16 z);
102 int generateTerrain();