aboutsummaryrefslogtreecommitdiff
path: root/src/mapgen/mapgen_carpathian.h
diff options
context:
space:
mode:
authorParamat <paramat@users.noreply.github.com>2019-06-19 01:06:08 +0100
committerGitHub <noreply@github.com>2019-06-19 01:06:08 +0100
commit5d4850a7ce1f707af1d85f8553a5adc251a8e916 (patch)
tree93c7caa9df37c84e1cf5e2bd0f1d76401992e7ef /src/mapgen/mapgen_carpathian.h
parent95a37efc31586babadc2f42e310e13e8319158a3 (diff)
downloadminetest-5d4850a7ce1f707af1d85f8553a5adc251a8e916.tar.gz
minetest-5d4850a7ce1f707af1d85f8553a5adc251a8e916.tar.bz2
minetest-5d4850a7ce1f707af1d85f8553a5adc251a8e916.zip
Mapgen Carpathian: Add optional rivers (#7977)
Rivers are disabled by default and will not be added to existing worlds. Rewrite getSpawnLevelAtPoint() to be simpler and more consistent with generateTerrain().
Diffstat (limited to 'src/mapgen/mapgen_carpathian.h')
-rw-r--r--src/mapgen/mapgen_carpathian.h24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/mapgen/mapgen_carpathian.h b/src/mapgen/mapgen_carpathian.h
index 89dfaa7de..1fbac4bfd 100644
--- a/src/mapgen/mapgen_carpathian.h
+++ b/src/mapgen/mapgen_carpathian.h
@@ -1,8 +1,7 @@
/*
Minetest
-Copyright (C) 2017-2018 vlapsley, Vaughan Lapsley <vlapsley@gmail.com>
-Copyright (C) 2010-2018 paramat
-Copyright (C) 2010-2018 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
+Copyright (C) 2017-2019 vlapsley, Vaughan Lapsley <vlapsley@gmail.com>
+Copyright (C) 2017-2019 paramat
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@@ -23,8 +22,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "mapgen.h"
-///////// Mapgen Carpathian flags
#define MGCARPATHIAN_CAVERNS 0x01
+#define MGCARPATHIAN_RIVERS 0x02
class BiomeManager;
@@ -34,6 +33,9 @@ extern FlagDesc flagdesc_mapgen_carpathian[];
struct MapgenCarpathianParams : public MapgenParams
{
float base_level = 12.0f;
+ float river_width = 0.05f;
+ float river_depth = 24.0f;
+ float valley_width = 0.25f;
u32 spflags = MGCARPATHIAN_CAVERNS;
float cave_width = 0.09f;
@@ -56,6 +58,7 @@ struct MapgenCarpathianParams : public MapgenParams
NoiseParams np_hills;
NoiseParams np_ridge_mnt;
NoiseParams np_step_mnt;
+ NoiseParams np_rivers;
NoiseParams np_mnt_var;
NoiseParams np_cave1;
NoiseParams np_cave2;
@@ -77,15 +80,14 @@ public:
virtual MapgenType getType() const { return MAPGEN_CARPATHIAN; }
- float getSteps(float noise);
- inline float getLerp(float noise1, float noise2, float mod);
-
virtual void makeChunk(BlockMakeData *data);
int getSpawnLevelAtPoint(v2s16 p);
private:
float base_level;
- s32 grad_wl;
+ float river_width;
+ float river_depth;
+ float valley_width;
s16 large_cave_depth;
s16 dungeon_ymin;
@@ -101,8 +103,12 @@ private:
Noise *noise_hills;
Noise *noise_ridge_mnt;
Noise *noise_step_mnt;
+ Noise *noise_rivers = nullptr;
Noise *noise_mnt_var;
- float terrainLevelAtPoint(s16 x, s16 z);
+ s32 grad_wl;
+
+ float getSteps(float noise);
+ inline float getLerp(float noise1, float noise2, float mod);
int generateTerrain();
};