summaryrefslogtreecommitdiffstats
path: root/src/Generating/IntGen.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-10-26 22:56:02 +0100
committerMattes D <github@xoft.cz>2014-10-26 22:56:02 +0100
commit74df4618de1c52c22f892e0bf82ec612521a10c0 (patch)
tree2244940ad0e93701d07f4371115fe91363e033df /src/Generating/IntGen.h
parentFixed a copypasta error in cIntGenAddToOcean. (diff)
downloadcuberite-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/IntGen.h23
1 files changed, 11 insertions, 12 deletions
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:
{