diff options
author | Mattes D <github@xoft.cz> | 2014-10-26 22:56:02 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-10-26 22:56:02 +0100 |
commit | 74df4618de1c52c22f892e0bf82ec612521a10c0 (patch) | |
tree | 2244940ad0e93701d07f4371115fe91363e033df | |
parent | Fixed a copypasta error in cIntGenAddToOcean. (diff) | |
download | cuberite-74df4618de1c52c22f892e0bf82ec612521a10c0.tar cuberite-74df4618de1c52c22f892e0bf82ec612521a10c0.tar.gz cuberite-74df4618de1c52c22f892e0bf82ec612521a10c0.tar.bz2 cuberite-74df4618de1c52c22f892e0bf82ec612521a10c0.tar.lz cuberite-74df4618de1c52c22f892e0bf82ec612521a10c0.tar.xz cuberite-74df4618de1c52c22f892e0bf82ec612521a10c0.tar.zst cuberite-74df4618de1c52c22f892e0bf82ec612521a10c0.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Generating/BioGen.cpp | 6 | ||||
-rw-r--r-- | src/Generating/IntGen.h | 23 |
2 files changed, 13 insertions, 16 deletions
diff --git a/src/Generating/BioGen.cpp b/src/Generating/BioGen.cpp index c9405040f..fcb4d74ed 100644 --- a/src/Generating/BioGen.cpp +++ b/src/Generating/BioGen.cpp @@ -969,10 +969,8 @@ public: std::make_shared<cIntGenAddIslands <6>> (a_Seed + 2000, 70, std::make_shared<cIntGenSmooth <6>> (a_Seed + 1004, std::make_shared<cIntGenZoom <8>> (a_Seed + 10, - std::make_shared<cIntGenAddIslands <6>> (a_Seed + 2003, 50, - std::make_shared<cIntGenZoom <6>> (a_Seed + 11, - std::make_shared<cIntLandOcean <5>> (a_Seed + 100, 65 - )))))))))))))))))))))))))))))); + std::make_shared<cIntGenLandOcean <6>> (a_Seed + 100, 65 + )))))))))))))))))))))))))))); m_Gen = std::make_shared<cIntGenSmooth <16>>(a_Seed, diff --git a/src/Generating/IntGen.h b/src/Generating/IntGen.h index a0064715f..1eb20711d 100644 --- a/src/Generating/IntGen.h +++ b/src/Generating/IntGen.h @@ -124,7 +124,7 @@ public: } - virtual void GetInts(int a_MinX, int a_MinZ, typename Values & a_Values) override + virtual void GetInts(int a_MinX, int a_MinZ, typename super::Values & a_Values) override { for (int z = 0; z < SizeZ; z++) { @@ -146,13 +146,13 @@ public: Has a threshold (in percent) of how much land, the larger the threshold, the more land. Generates 0 for ocean, biome group ID for landmass. */ template <int SizeX, int SizeZ = SizeX> -class cIntLandOcean : +class cIntGenLandOcean : public cIntGenWithNoise<SizeX, SizeZ> { typedef cIntGenWithNoise<SizeX, SizeZ> super; public: - cIntLandOcean(int a_Seed, int a_Threshold) : + cIntGenLandOcean(int a_Seed, int a_Threshold) : super(a_Seed), m_Threshold(a_Threshold) { @@ -170,6 +170,12 @@ public: a_Values[x + SizeX * z] = ((rnd % 100) < m_Threshold) ? ((rnd / 128) % bgMax + 1) : 0; } } + + // If the centerpoint of the world is within the area, set it to bgTemperate, always: + if ((a_MinX <= 0) && (a_MinZ <= 0) && (a_MinX + SizeX > 0) && (a_MinZ + SizeZ > 0)) + { + a_Values[-a_MinX - a_MinZ * SizeX] = bgTemperate; + } } protected: @@ -451,12 +457,12 @@ public: { for (int x = 0; x < SizeX; x++) { - if (a_Values[x + z * SizeX] == 0) + if (a_Values[x + z * SizeX] == bgOcean) { int rnd = m_Noise.IntNoise2DInt(a_MinX + x, a_MinZ + z) / 7; if (rnd % 100 < m_Threshold) { - a_Values[x + z * SizeX] = (rnd / 100) % 4; + a_Values[x + z * SizeX] = (rnd / 100) % bgMax; } } } @@ -511,13 +517,6 @@ public: int Right = Cache[x + 2 + (z + 1) * m_UnderlyingSizeX]; switch (v) { - // Oceans don't need any edges: - case bgOcean: - { - v = bgOcean; - break; - } - // Desert should neighbor only oceans, desert and temperates; change to temperate when another: case bgDesert: { |