summaryrefslogtreecommitdiffstats
path: root/source/Generating/BioGen.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-01-24 13:15:36 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-01-24 13:15:36 +0100
commit467297a922f7ce2e5623f189e25a879338263006 (patch)
treec7c9ff353e5b04235a8fccdb9fe890d7833ec3e8 /source/Generating/BioGen.h
parentAdded new statistics module to AnvilStats - cHeightMap. (diff)
downloadcuberite-467297a922f7ce2e5623f189e25a879338263006.tar
cuberite-467297a922f7ce2e5623f189e25a879338263006.tar.gz
cuberite-467297a922f7ce2e5623f189e25a879338263006.tar.bz2
cuberite-467297a922f7ce2e5623f189e25a879338263006.tar.lz
cuberite-467297a922f7ce2e5623f189e25a879338263006.tar.xz
cuberite-467297a922f7ce2e5623f189e25a879338263006.tar.zst
cuberite-467297a922f7ce2e5623f189e25a879338263006.zip
Diffstat (limited to 'source/Generating/BioGen.h')
-rw-r--r--source/Generating/BioGen.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/source/Generating/BioGen.h b/source/Generating/BioGen.h
index 6faca09c1..307009a2b 100644
--- a/source/Generating/BioGen.h
+++ b/source/Generating/BioGen.h
@@ -170,3 +170,56 @@ protected:
+class cBioGenMultiStepMap :
+ public cBiomeGen
+{
+public:
+ cBioGenMultiStepMap(int a_Seed);
+
+ void Init(cIniFile & a_IniFile);
+
+protected:
+ cNoise m_Noise;
+ int m_Seed;
+ int m_OceanCellSize;
+ int m_MushroomIslandSize;
+ int m_RiverCellSize;
+ float m_RiverWidthThreshold;
+ float m_LandBiomesSize;
+
+ typedef int IntMap[256]; // x + 16 * z, expected trimmed into [0..255] range
+
+ // cBiomeGen override:
+ virtual void GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a_BiomeMap) override;
+
+ /** Step 1: Decides between ocean, land and mushroom, using a DistVoronoi with special conditions and post-processing for mushroom islands
+ Sets biomes to biOcean, -1 (i.e. land), biMushroomIsland or biMushroomShore
+ */
+ void DecideOceanLandMushroom(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a_BiomeMap);
+
+ /** Step 2: Add rivers to the land
+ Flips some "-1" biomes into biRiver
+ */
+ void AddRivers(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a_BiomeMap);
+
+ /** Step 3: Decide land biomes, using Distorted Voronoi and a temperature / humidity map and freezes ocean / river in low temperatures.
+ Flips all remaining "-1" biomes into land biomes. Also flips some biOcean and biRiver into biFrozenOcean, biFrozenRiver, based on temp map.
+ */
+ void ApplyTemperatureHumidity(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a_BiomeMap);
+
+ /// Distorts the coords using a Perlin-like noise, with a specified cell-size
+ void Distort(int a_BlockX, int a_BlockZ, int & a_DistortedX, int & a_DistortedZ, int a_CellSize);
+
+ /// Builds two Perlin-noise maps, one for temperature, the other for humidity. Trims both into [0..255] range
+ void BuildTemperatureHumidityMaps(int a_ChunkX, int a_ChunkZ, IntMap & a_TemperatureMap, IntMap & a_HumidityMap);
+
+ /// Flips all remaining "-1" biomes into land biomes using the two maps
+ void DecideLandBiomes(cChunkDef::BiomeMap & a_BiomeMap, const IntMap & a_TemperatureMap, const IntMap & a_HumidityMap);
+
+ /// Flips biOcean and biRiver into biFrozenOcean and biFrozenRiver if the temperature is too low
+ void FreezeWaterBiomes(cChunkDef::BiomeMap & a_BiomeMap, const IntMap & a_TemperatureMap);
+} ;
+
+
+
+