aboutsummaryrefslogtreecommitdiff
path: root/src/mapgen/mapgen_valleys.h
diff options
context:
space:
mode:
authorParamat <paramat@users.noreply.github.com>2019-03-14 00:27:16 +0000
committerGitHub <noreply@github.com>2019-03-14 00:27:16 +0000
commitaafbdd442f6bb6d6730fc7fdff76cbd0e3be301b (patch)
tree4bd4965a755fc984f968b777cf6fa13b6b7209a2 /src/mapgen/mapgen_valleys.h
parente22a69d61a04624fe1eca818740b90dbb958e658 (diff)
downloadminetest-aafbdd442f6bb6d6730fc7fdff76cbd0e3be301b.tar.gz
minetest-aafbdd442f6bb6d6730fc7fdff76cbd0e3be301b.tar.bz2
minetest-aafbdd442f6bb6d6730fc7fdff76cbd0e3be301b.zip
Valleys mapgen code rewrite (#8101)
Shorter, simpler, clearer and more consistent with other mapgens, while preserving functionality. Base terrain shape is unchanged. With the 'vary river depth' option disabled, river surface level is unchanged. Behaviour of the 4 heat/humidity/river depth options is very slightly changed due to bugfixes and code cleanup (the mapgen is 'unstable'). Apply heat and humidity gradients above water_level instead of above y = 0.
Diffstat (limited to 'src/mapgen/mapgen_valleys.h')
-rw-r--r--src/mapgen/mapgen_valleys.h27
1 files changed, 4 insertions, 23 deletions
diff --git a/src/mapgen/mapgen_valleys.h b/src/mapgen/mapgen_valleys.h
index 8bde7a622..06920a477 100644
--- a/src/mapgen/mapgen_valleys.h
+++ b/src/mapgen/mapgen_valleys.h
@@ -1,11 +1,11 @@
/*
Minetest
-Copyright (C) 2016-2018 Duane Robertson <duane@duanerobertson.com>
-Copyright (C) 2016-2018 paramat
+Copyright (C) 2016-2019 Duane Robertson <duane@duanerobertson.com>
+Copyright (C) 2016-2019 paramat
Based on Valleys Mapgen by Gael de Sailly
(https://forum.minetest.net/viewtopic.php?f=9&t=11430)
-and mapgen_v7 by kwolekr and paramat.
+and mapgen_v7, mapgen_flat by kwolekr and paramat.
Licensing changed by permission of Gael de Sailly.
@@ -24,20 +24,16 @@ with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+
#pragma once
#include "mapgen.h"
-/////////////////// Mapgen Valleys flags
#define MGVALLEYS_ALT_CHILL 0x01
#define MGVALLEYS_HUMID_RIVERS 0x02
#define MGVALLEYS_VARY_RIVER_DEPTH 0x04
#define MGVALLEYS_ALT_DRY 0x08
-// Feed only one variable into these
-#define MYSQUARE(x) (x) * (x)
-#define MYCUBE(x) (x) * (x) * (x)
-
class BiomeManager;
class BiomeGenOriginal;
@@ -79,16 +75,6 @@ struct MapgenValleysParams : public MapgenParams {
void writeParams(Settings *settings) const;
};
-struct TerrainNoise {
- s16 x;
- s16 z;
- float terrain_height;
- float *rivers;
- float *valley;
- float valley_profile;
- float *slope;
- float inter_valley_fill;
-};
class MapgenValleys : public MapgenBasic {
public:
@@ -106,7 +92,6 @@ private:
BiomeGenOriginal *m_bgen;
float altitude_chill;
- float humidity_adjust;
float river_depth_bed;
float river_size_factor;
@@ -121,9 +106,5 @@ private:
Noise *noise_valley_depth;
Noise *noise_valley_profile;
- float terrainLevelAtPoint(s16 x, s16 z);
- void calculateNoise();
virtual int generateTerrain();
- float terrainLevelFromNoise(TerrainNoise *tn);
- float adjustedTerrainLevelFromNoise(TerrainNoise *tn);
};