summaryrefslogtreecommitdiffstats
path: root/src/Generating
diff options
context:
space:
mode:
authorKingCol13 <48412633+KingCol13@users.noreply.github.com>2021-07-09 19:45:53 +0200
committerGitHub <noreply@github.com>2021-07-09 19:45:53 +0200
commit68776c4d5919638b3cecccd083155cd58ccac573 (patch)
tree8b1d508953c3f3f260ad1b33c40e7ef9674ff0d0 /src/Generating
parentProtoProxy: encrypt in-place (diff)
downloadcuberite-68776c4d5919638b3cecccd083155cd58ccac573.tar
cuberite-68776c4d5919638b3cecccd083155cd58ccac573.tar.gz
cuberite-68776c4d5919638b3cecccd083155cd58ccac573.tar.bz2
cuberite-68776c4d5919638b3cecccd083155cd58ccac573.tar.lz
cuberite-68776c4d5919638b3cecccd083155cd58ccac573.tar.xz
cuberite-68776c4d5919638b3cecccd083155cd58ccac573.tar.zst
cuberite-68776c4d5919638b3cecccd083155cd58ccac573.zip
Diffstat (limited to 'src/Generating')
-rw-r--r--src/Generating/FinishGen.cpp2
-rw-r--r--src/Generating/IntGen.h3
-rw-r--r--src/Generating/ProtIntGen.h2
-rw-r--r--src/Generating/Trees.cpp6
4 files changed, 6 insertions, 7 deletions
diff --git a/src/Generating/FinishGen.cpp b/src/Generating/FinishGen.cpp
index a6da93976..984957e60 100644
--- a/src/Generating/FinishGen.cpp
+++ b/src/Generating/FinishGen.cpp
@@ -613,7 +613,7 @@ void cFinishGenTallGrass::GenFinish(cChunkDesc & a_ChunkDesc)
}
else
{
- NIBBLETYPE meta = (m_Noise.IntNoise2DInt(xx * 50, zz * 50) / 7 % 2) + 1;
+ NIBBLETYPE meta = static_cast<NIBBLETYPE>((m_Noise.IntNoise2DInt(xx * 50, zz * 50) / 7 % 2) + 1);
a_ChunkDesc.SetBlockTypeMeta(x, y, z, E_BLOCK_TALL_GRASS, meta);
a_ChunkDesc.SetHeight(x, z, static_cast<HEIGHTTYPE>(y));
}
diff --git a/src/Generating/IntGen.h b/src/Generating/IntGen.h
index 4ef8c3452..b56567f9f 100644
--- a/src/Generating/IntGen.h
+++ b/src/Generating/IntGen.h
@@ -1,4 +1,3 @@
-
// IntGen.h
// Declares the cIntGen class and descendants for generating and filtering various 2D arrays of ints
@@ -494,7 +493,7 @@ public:
if (IsBiomeOcean(above) || IsBiomeOcean(below) || IsBiomeOcean(left) || IsBiomeOcean(right))
{
// First convert the value to a regular biome (drop the M flag), then modulo by our biome count:
- val = ToBeach[(val % 128) % ARRAYCOUNT(ToBeach)];
+ val = ToBeach[static_cast<size_t>((val % 128)) % ARRAYCOUNT(ToBeach)];
}
}
a_Values[x + z * SizeX] = val;
diff --git a/src/Generating/ProtIntGen.h b/src/Generating/ProtIntGen.h
index 87e13c6cc..290998075 100644
--- a/src/Generating/ProtIntGen.h
+++ b/src/Generating/ProtIntGen.h
@@ -767,7 +767,7 @@ public:
if (IsBiomeOcean(above) || IsBiomeOcean(below) || IsBiomeOcean(left) || IsBiomeOcean(right))
{
// First convert the value to a regular biome (drop the M flag), then modulo by our biome count:
- val = ToBeach[(val % 128) % ARRAYCOUNT(ToBeach)];
+ val = ToBeach[static_cast<size_t>(val % 128) % ARRAYCOUNT(ToBeach)];
}
}
a_Values[x + z * a_SizeX] = val;
diff --git a/src/Generating/Trees.cpp b/src/Generating/Trees.cpp
index 28f0da6ce..53017ce06 100644
--- a/src/Generating/Trees.cpp
+++ b/src/Generating/Trees.cpp
@@ -672,7 +672,7 @@ NIBBLETYPE GetLogMetaFromDirection(NIBBLETYPE a_BlockMeta, Vector3d a_Direction)
void GetBirchTreeImage(Vector3i a_BlockPos, cNoise & a_Noise, int a_Seq, sSetBlockVector & a_LogBlocks, sSetBlockVector & a_OtherBlocks)
{
- HEIGHTTYPE Height = 5 + (a_Noise.IntNoise3DInt(a_BlockPos.addedX(64 * a_Seq)) % 3);
+ HEIGHTTYPE Height = 5 + static_cast<HEIGHTTYPE>(a_Noise.IntNoise3DInt(a_BlockPos.addedX(64 * a_Seq)) % 3);
// Prealloc, so that we don't realloc too often later:
a_LogBlocks.reserve(static_cast<size_t>(Height));
@@ -839,7 +839,7 @@ void GetDarkoakTreeImage(Vector3i a_BlockPos, cNoise & a_Noise, int a_Seq, sSetB
void GetTallBirchTreeImage(Vector3i a_BlockPos, cNoise & a_Noise, int a_Seq, sSetBlockVector & a_LogBlocks, sSetBlockVector & a_OtherBlocks)
{
- HEIGHTTYPE Height = 9 + (a_Noise.IntNoise3DInt(a_BlockPos.addedX(64 * a_Seq)) % 3);
+ HEIGHTTYPE Height = 9 + static_cast<HEIGHTTYPE>(a_Noise.IntNoise3DInt(a_BlockPos.addedX(64 * a_Seq)) % 3);
// Prealloc, so that we don't realloc too often later:
a_LogBlocks.reserve(static_cast<size_t>(Height));
@@ -1078,7 +1078,7 @@ void GetLargeSpruceTreeImage(Vector3i a_BlockPos, cNoise & a_Noise, int a_Seq, s
for (int i = 0; i < LeavesRingCount; i++)
{
- unsigned int Val = (a_Noise.IntNoise3DInt(a_BlockPos.addedXZ(32 * a_Seq, 32 * i)) / 23) % 8;
+ unsigned int Val = static_cast<unsigned int>(a_Noise.IntNoise3DInt(a_BlockPos.addedXZ(32 * a_Seq, 32 * i)) / 23) % 8;
if ((Val < 4) && RingRadius < 3)
{
RingRadius++;