summaryrefslogtreecommitdiffstats
path: root/src/Generating/StructGen.cpp
diff options
context:
space:
mode:
authorMatti Hänninen <matti@mjhanninen.com>2015-08-05 00:24:59 +0200
committerMatti Hänninen <matti@mjhanninen.com>2015-08-12 15:51:38 +0200
commitb20294604c5a64a39b3c5f4491b653e4cf2a3c20 (patch)
treeab1b84a09987f8ebe9d1e8450f36375c0f9bc5db /src/Generating/StructGen.cpp
parentMerge pull request #2425 from cuberite/APIDumpNameChange (diff)
downloadcuberite-b20294604c5a64a39b3c5f4491b653e4cf2a3c20.tar
cuberite-b20294604c5a64a39b3c5f4491b653e4cf2a3c20.tar.gz
cuberite-b20294604c5a64a39b3c5f4491b653e4cf2a3c20.tar.bz2
cuberite-b20294604c5a64a39b3c5f4491b653e4cf2a3c20.tar.lz
cuberite-b20294604c5a64a39b3c5f4491b653e4cf2a3c20.tar.xz
cuberite-b20294604c5a64a39b3c5f4491b653e4cf2a3c20.tar.zst
cuberite-b20294604c5a64a39b3c5f4491b653e4cf2a3c20.zip
Diffstat (limited to 'src/Generating/StructGen.cpp')
-rw-r--r--src/Generating/StructGen.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Generating/StructGen.cpp b/src/Generating/StructGen.cpp
index fd911e7dc..3b04f66b7 100644
--- a/src/Generating/StructGen.cpp
+++ b/src/Generating/StructGen.cpp
@@ -624,23 +624,23 @@ cStructGenDistortedMembraneOverhangs::cStructGenDistortedMembraneOverhangs(int a
void cStructGenDistortedMembraneOverhangs::GenFinish(cChunkDesc & a_ChunkDesc)
{
- const NOISE_DATATYPE Frequency = (NOISE_DATATYPE)16;
- const NOISE_DATATYPE Amount = (NOISE_DATATYPE)1;
+ const NOISE_DATATYPE Frequency = static_cast<NOISE_DATATYPE>(16);
+ const NOISE_DATATYPE Amount = static_cast<NOISE_DATATYPE>(1);
for (int y = 50; y < 128; y++)
{
- NOISE_DATATYPE NoiseY = (NOISE_DATATYPE)y / 32;
+ NOISE_DATATYPE NoiseY = static_cast<NOISE_DATATYPE>(y) / 32;
// TODO: proper water level - where to get?
BLOCKTYPE ReplacementBlock = (y > 62) ? E_BLOCK_AIR : E_BLOCK_STATIONARY_WATER;
for (int z = 0; z < cChunkDef::Width; z++)
{
- NOISE_DATATYPE NoiseZ = ((NOISE_DATATYPE)(a_ChunkDesc.GetChunkZ() * cChunkDef::Width + z)) / Frequency;
+ NOISE_DATATYPE NoiseZ = static_cast<NOISE_DATATYPE>(a_ChunkDesc.GetChunkZ() * cChunkDef::Width + z) / Frequency;
for (int x = 0; x < cChunkDef::Width; x++)
{
- NOISE_DATATYPE NoiseX = ((NOISE_DATATYPE)(a_ChunkDesc.GetChunkX() * cChunkDef::Width + x)) / Frequency;
+ NOISE_DATATYPE NoiseX = static_cast<NOISE_DATATYPE>(a_ChunkDesc.GetChunkX() * cChunkDef::Width + x) / Frequency;
NOISE_DATATYPE DistortX = m_NoiseX.CubicNoise3D(NoiseX, NoiseY, NoiseZ) * Amount;
NOISE_DATATYPE DistortY = m_NoiseY.CubicNoise3D(NoiseX, NoiseY, NoiseZ) * Amount;
NOISE_DATATYPE DistortZ = m_NoiseZ.CubicNoise3D(NoiseX, NoiseY, NoiseZ) * Amount;
- int MembraneHeight = 96 - (int)((DistortY + m_NoiseH.CubicNoise2D(NoiseX + DistortX, NoiseZ + DistortZ)) * 30);
+ int MembraneHeight = 96 - static_cast<int>((DistortY + m_NoiseH.CubicNoise2D(NoiseX + DistortX, NoiseZ + DistortZ)) * 30);
if (MembraneHeight < y)
{
a_ChunkDesc.SetBlockType(x, y, z, ReplacementBlock);