summaryrefslogtreecommitdiffstats
path: root/src/Generating/BioGen.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-10-30 16:24:35 +0100
committerMattes D <github@xoft.cz>2014-10-30 16:24:35 +0100
commit8c04abf9aa749af3b15bc92f517b636c9593109e (patch)
treebb9af9b2d0d0c9760c937dd98b25c1738b075a13 /src/Generating/BioGen.cpp
parentMerge remote-tracking branch 'origin/master' into GrownBiomes (diff)
downloadcuberite-8c04abf9aa749af3b15bc92f517b636c9593109e.tar
cuberite-8c04abf9aa749af3b15bc92f517b636c9593109e.tar.gz
cuberite-8c04abf9aa749af3b15bc92f517b636c9593109e.tar.bz2
cuberite-8c04abf9aa749af3b15bc92f517b636c9593109e.tar.lz
cuberite-8c04abf9aa749af3b15bc92f517b636c9593109e.tar.xz
cuberite-8c04abf9aa749af3b15bc92f517b636c9593109e.tar.zst
cuberite-8c04abf9aa749af3b15bc92f517b636c9593109e.zip
Diffstat (limited to '')
-rw-r--r--src/Generating/BioGen.cpp124
1 files changed, 111 insertions, 13 deletions
diff --git a/src/Generating/BioGen.cpp b/src/Generating/BioGen.cpp
index 6fab1b9d9..f9a0a571b 100644
--- a/src/Generating/BioGen.cpp
+++ b/src/Generating/BioGen.cpp
@@ -6,6 +6,7 @@
#include "Globals.h"
#include "BioGen.h"
#include "IntGen.h"
+#include "ProtIntGen.h"
#include "../IniFile.h"
#include "../LinearUpscale.h"
@@ -927,9 +928,9 @@ public:
cBioGenGrown(int a_Seed)
{
auto FinalRivers =
- std::make_shared<cIntGenSmooth<8>> (a_Seed + 1,
- std::make_shared<cIntGenRiver <10>> (a_Seed + 2,
- std::make_shared<cIntGenZoom <12>> (a_Seed + 3,
+ std::make_shared<cIntGenSmooth<6>> (a_Seed + 1,
+ std::make_shared<cIntGenZoom <8>> (a_Seed + 3,
+ std::make_shared<cIntGenRiver <6>> (a_Seed + 2,
std::make_shared<cIntGenSmooth<8>> (a_Seed + 4,
std::make_shared<cIntGenZoom <10>> (a_Seed + 5,
std::make_shared<cIntGenZoom <7>> (a_Seed + 6,
@@ -942,10 +943,10 @@ public:
))))))))))));
auto FinalBiomes =
- std::make_shared<cIntGenSmooth <8>> (a_Seed + 1008,
- std::make_shared<cIntGenZoom <10>>(a_Seed + 15,
- std::make_shared<cIntGenSmooth <7>> (a_Seed + 1000,
- std::make_shared<cIntGenZoom <9>> (a_Seed + 16,
+ std::make_shared<cIntGenSmooth <6>> (a_Seed + 1008,
+ std::make_shared<cIntGenZoom <8>>(a_Seed + 15,
+ std::make_shared<cIntGenSmooth <6>> (a_Seed + 1000,
+ std::make_shared<cIntGenZoom <8>> (a_Seed + 16,
std::make_shared<cIntGenBeaches <6>> (
std::make_shared<cIntGenSmooth <8>> (a_Seed + 1002,
std::make_shared<cIntGenZoom <10>>(a_Seed + 1,
@@ -953,7 +954,8 @@ public:
std::make_shared<cIntGenZoom <9>> (a_Seed + 2,
std::make_shared<cIntGenAddIslands <6>> (a_Seed + 2004, 10,
std::make_shared<cIntGenZoom <6>> (a_Seed + 4,
- std::make_shared<cIntGenAddToOcean <5>> (a_Seed + 9, 50, biMushroomIsland,
+ std::make_shared<cIntGenAddToOcean <5>> (a_Seed + 9, 10, biMushroomIsland,
+ std::make_shared<cIntGenReplaceRandomly<7>> (biIcePlains, biIcePlainsSpikes, 5, a_Seed + 99,
std::make_shared<cIntGenZoom <7>> (a_Seed + 8,
std::make_shared<cIntGenAddToOcean <5>> (a_Seed + 10, 500, biDeepOcean,
std::make_shared<cIntGenBiomes <7>> (a_Seed + 3000,
@@ -961,22 +963,26 @@ public:
std::make_shared<cIntGenBiomeGroupEdges<5>> (
std::make_shared<cIntGenSmooth <7>> (a_Seed + 1003,
std::make_shared<cIntGenZoom <9>> (a_Seed + 7,
+ std::make_shared<cIntGenSetRandomly <6>> (a_Seed + 8, 50, bgOcean,
std::make_shared<cIntGenReplaceRandomly<6>> (bgJungle, bgTemperate, 50, a_Seed + 100,
std::make_shared<cIntGenReplaceRandomly<6>> (bgIce, bgTemperate, 50, a_Seed + 101,
+ std::make_shared<cIntGenReplaceRandomly<6>> (bgDesert, bgMesa, 30, a_Seed + 102,
std::make_shared<cIntGenAddIslands <6>> (a_Seed + 2000, 70,
+ std::make_shared<cIntGenSetRandomly <6>> (a_Seed + 9, 50, bgOcean,
std::make_shared<cIntGenSmooth <6>> (a_Seed + 1004,
std::make_shared<cIntGenZoom <8>> (a_Seed + 10,
std::make_shared<cIntGenLandOcean <6>> (a_Seed + 100, 65
- )))))))))))))))))))))))));
+ )))))))))))))))))))))))))))));
m_Gen =
std::make_shared<cIntGenSmooth <16>>(a_Seed,
std::make_shared<cIntGenZoom <18>>(a_Seed,
- std::make_shared<cIntGenSmooth <11>>(a_Seed,
- std::make_shared<cIntGenZoom <13>>(a_Seed,
- std::make_shared<cIntGenMixRivers<8>> (
+ std::make_shared<cIntGenZoom <11>>(a_Seed,
+ std::make_shared<cIntGenSmooth <7>>(a_Seed,
+ std::make_shared<cIntGenZoom <9>>(a_Seed,
+ std::make_shared<cIntGenMixRivers<6>> (
FinalBiomes, FinalRivers
- )))));
+ ))))));
}
virtual void GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a_Biomes) override
@@ -1001,6 +1007,94 @@ protected:
////////////////////////////////////////////////////////////////////////////////
+// cBioGenGrown:
+
+class cBioGenProtGrown:
+ public cBiomeGen
+{
+public:
+ cBioGenProtGrown(int a_Seed)
+ {
+ auto FinalRivers =
+ std::make_shared<cProtIntGenSmooth>(a_Seed + 1,
+ std::make_shared<cProtIntGenZoom >(a_Seed + 3,
+ std::make_shared<cProtIntGenRiver >(a_Seed + 2,
+ std::make_shared<cProtIntGenSmooth>(a_Seed + 4,
+ std::make_shared<cProtIntGenZoom >(a_Seed + 5,
+ std::make_shared<cProtIntGenZoom >(a_Seed + 6,
+ std::make_shared<cProtIntGenZoom >(a_Seed + 7,
+ std::make_shared<cProtIntGenZoom >(a_Seed + 8,
+ std::make_shared<cProtIntGenZoom >(a_Seed + 9,
+ std::make_shared<cProtIntGenZoom >(a_Seed + 10,
+ std::make_shared<cProtIntGenZoom >(a_Seed + 11,
+ std::make_shared<cProtIntGenChoice>(a_Seed + 12, 2
+ ))))))))))));
+
+ auto FinalBiomes =
+ std::make_shared<cProtIntGenSmooth >(a_Seed + 1008,
+ std::make_shared<cProtIntGenZoom >(a_Seed + 15,
+ std::make_shared<cProtIntGenSmooth >(a_Seed + 1000,
+ std::make_shared<cProtIntGenZoom >(a_Seed + 16,
+ std::make_shared<cProtIntGenBeaches >(
+ std::make_shared<cProtIntGenSmooth >(a_Seed + 1002,
+ std::make_shared<cProtIntGenZoom >(a_Seed + 1,
+ std::make_shared<cProtIntGenSmooth >(a_Seed + 1002,
+ std::make_shared<cProtIntGenZoom >(a_Seed + 2,
+ std::make_shared<cProtIntGenAddIslands >(a_Seed + 2004, 10,
+ std::make_shared<cProtIntGenZoom >(a_Seed + 4,
+ std::make_shared<cProtIntGenAddToOcean >(a_Seed + 9, 10, biMushroomIsland,
+ std::make_shared<cProtIntGenReplaceRandomly>(biIcePlains, biIcePlainsSpikes, 5, a_Seed + 99,
+ std::make_shared<cProtIntGenZoom >(a_Seed + 8,
+ std::make_shared<cProtIntGenAddToOcean >(a_Seed + 10, 500, biDeepOcean,
+ std::make_shared<cProtIntGenBiomes >(a_Seed + 3000,
+ std::make_shared<cProtIntGenZoom >(a_Seed + 5,
+ std::make_shared<cProtIntGenBiomeGroupEdges>(
+ std::make_shared<cProtIntGenSmooth >(a_Seed + 1003,
+ std::make_shared<cProtIntGenZoom >(a_Seed + 7,
+ std::make_shared<cProtIntGenSetRandomly >(a_Seed + 8, 50, bgOcean,
+ std::make_shared<cProtIntGenReplaceRandomly>(bgJungle, bgTemperate, 50, a_Seed + 100,
+ std::make_shared<cProtIntGenReplaceRandomly>(bgIce, bgTemperate, 50, a_Seed + 101,
+ std::make_shared<cProtIntGenReplaceRandomly>(bgDesert, bgMesa, 30, a_Seed + 102,
+ std::make_shared<cProtIntGenAddIslands >(a_Seed + 2000, 70,
+ std::make_shared<cProtIntGenSetRandomly >(a_Seed + 9, 50, bgOcean,
+ std::make_shared<cProtIntGenSmooth >(a_Seed + 1004,
+ std::make_shared<cProtIntGenZoom >(a_Seed + 10,
+ std::make_shared<cProtIntGenLandOcean >(a_Seed + 100, 65
+ )))))))))))))))))))))))))))));
+
+ m_Gen =
+ std::make_shared<cProtIntGenSmooth >(a_Seed,
+ std::make_shared<cProtIntGenZoom >(a_Seed,
+ std::make_shared<cProtIntGenZoom >(a_Seed,
+ std::make_shared<cProtIntGenSmooth >(a_Seed,
+ std::make_shared<cProtIntGenZoom >(a_Seed,
+ std::make_shared<cProtIntGenMixRivers>(
+ FinalBiomes, FinalRivers
+ ))))));
+ }
+
+ virtual void GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a_Biomes) override
+ {
+ int vals[16 * 16];
+ m_Gen->GetInts(a_ChunkX * cChunkDef::Width, a_ChunkZ * cChunkDef::Width, 16, 16, vals);
+ for (int z = 0; z < cChunkDef::Width; z++)
+ {
+ for (int x = 0; x < cChunkDef::Width; x++)
+ {
+ cChunkDef::SetBiome(a_Biomes, x, z, (EMCSBiome)vals[x + cChunkDef::Width * z]);
+ }
+ }
+ }
+
+protected:
+ std::shared_ptr<cProtIntGen> m_Gen;
+};
+
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
// cBiomeGen:
cBiomeGenPtr cBiomeGen::CreateBiomeGen(cIniFile & a_IniFile, int a_Seed, bool & a_CacheOffByDefault)
@@ -1040,6 +1134,10 @@ cBiomeGenPtr cBiomeGen::CreateBiomeGen(cIniFile & a_IniFile, int a_Seed, bool &
{
res = new cBioGenGrown(a_Seed);
}
+ else if (NoCaseCompare(BiomeGenName, "grownprot") == 0)
+ {
+ res = new cBioGenProtGrown(a_Seed);
+ }
else
{
if (NoCaseCompare(BiomeGenName, "multistepmap") != 0)