diff options
author | Julian Laubstein <julianlaubstein@yahoo.de> | 2015-08-12 17:40:51 +0200 |
---|---|---|
committer | Julian Laubstein <julianlaubstein@yahoo.de> | 2015-08-12 17:40:51 +0200 |
commit | cdcc5fe9a7894af6075865f698e3d014a6f92335 (patch) | |
tree | ab1b84a09987f8ebe9d1e8450f36375c0f9bc5db /src/Generating/StructGen.cpp | |
parent | Merge pull request #2425 from cuberite/APIDumpNameChange (diff) | |
parent | Fix old style casts and implicit conversions (diff) | |
download | cuberite-cdcc5fe9a7894af6075865f698e3d014a6f92335.tar cuberite-cdcc5fe9a7894af6075865f698e3d014a6f92335.tar.gz cuberite-cdcc5fe9a7894af6075865f698e3d014a6f92335.tar.bz2 cuberite-cdcc5fe9a7894af6075865f698e3d014a6f92335.tar.lz cuberite-cdcc5fe9a7894af6075865f698e3d014a6f92335.tar.xz cuberite-cdcc5fe9a7894af6075865f698e3d014a6f92335.tar.zst cuberite-cdcc5fe9a7894af6075865f698e3d014a6f92335.zip |
Diffstat (limited to 'src/Generating/StructGen.cpp')
-rw-r--r-- | src/Generating/StructGen.cpp | 12 |
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); |