From f2689c4887e6bd66af34de81cd793322f1dd57c4 Mon Sep 17 00:00:00 2001 From: tycho Date: Tue, 19 May 2015 11:50:59 +0100 Subject: Fixed a lot of warnings --- src/Generating/FinishGen.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/Generating/FinishGen.cpp') diff --git a/src/Generating/FinishGen.cpp b/src/Generating/FinishGen.cpp index 00b34bddd..af4056e8c 100644 --- a/src/Generating/FinishGen.cpp +++ b/src/Generating/FinishGen.cpp @@ -260,13 +260,13 @@ void cFinishGenGlowStone::TryPlaceGlowstone(cChunkDesc & a_ChunkDesc, int a_RelX for (int j = 0; j < a_Size; j++) { - Vector3i Direction = AvailableDirections[m_Noise.IntNoise3DInt(CurrentPos.x, CurrentPos.y * i, CurrentPos.z) % ARRAYCOUNT(AvailableDirections)]; + Vector3i Direction = AvailableDirections[static_cast(m_Noise.IntNoise3DInt(CurrentPos.x, CurrentPos.y * i, CurrentPos.z)) % ARRAYCOUNT(AvailableDirections)]; int Attempts = 2; // multiply by 1 would make no difference, so multiply by 2 instead while (Direction.Equals(PreviousDirection)) { // To make the glowstone branches look better we want to make the direction change every time. - Direction = AvailableDirections[m_Noise.IntNoise3DInt(CurrentPos.x, CurrentPos.y * i * Attempts, CurrentPos.z) % ARRAYCOUNT(AvailableDirections)]; + Direction = AvailableDirections[static_cast(m_Noise.IntNoise3DInt(CurrentPos.x, CurrentPos.y * i * Attempts, CurrentPos.z)) % ARRAYCOUNT(AvailableDirections)]; Attempts++; } @@ -438,7 +438,7 @@ void cFinishGenVines::GenFinish(cChunkDesc & a_ChunkDesc) continue; } - NIBBLETYPE Meta = Places[m_Noise.IntNoise3DInt(xx, y, zz) % Places.size()]; + NIBBLETYPE Meta = Places[static_cast(m_Noise.IntNoise3DInt(xx, y, zz)) % Places.size()]; a_ChunkDesc.SetBlockTypeMeta(x, y, z, E_BLOCK_VINES, Meta); } } @@ -515,7 +515,7 @@ void cFinishGenSprinkleFoliage::GenFinish(cChunkDesc & a_ChunkDesc) { continue; } - int Top = a_ChunkDesc.GetHeight(x, z); + HEIGHTTYPE Top = a_ChunkDesc.GetHeight(x, z); if (Top > 250) { // Nothing grows above Y=250 @@ -676,7 +676,7 @@ void cFinishGenSnow::GenFinish(cChunkDesc & a_ChunkDesc) { for (int x = 0; x < cChunkDef::Width; x++) { - int Height = a_ChunkDesc.GetHeight(x, z); + HEIGHTTYPE Height = a_ChunkDesc.GetHeight(x, z); if (GetSnowStartHeight(a_ChunkDesc.GetBiome(x, z)) > Height) { // Height isn't high enough for snow to start forming. @@ -775,7 +775,7 @@ void cFinishGenSingleTopBlock::GenFinish(cChunkDesc & a_ChunkDesc) continue; } - int Height = a_ChunkDesc.GetHeight(x, z); + HEIGHTTYPE Height = a_ChunkDesc.GetHeight(x, z); if (Height >= cChunkDef::Height - 1) { // Too high up @@ -918,7 +918,7 @@ void cFinishGenPreSimulator::CollapseSandGravel( } } // switch (GetBlock) } // for y - cChunkDef::SetHeight(a_HeightMap, x, z, HeightY); + cChunkDef::SetHeight(a_HeightMap, x, z, static_cast(HeightY)); } // for x } // for z } @@ -1374,7 +1374,7 @@ eMonsterType cFinishGenPassiveMobs::GetRandomMob(cChunkDesc & a_ChunkDesc) return mtInvalidType; } - int RandMob = (m_Noise.IntNoise2DInt(chunkX - chunkZ + 2, chunkX + 5) / 7) % ListOfSpawnables.size(); + size_t RandMob = static_cast((m_Noise.IntNoise2DInt(chunkX - chunkZ + 2, chunkX + 5) / 7)) % ListOfSpawnables.size(); auto MobIter = ListOfSpawnables.begin(); std::advance(MobIter, RandMob); -- cgit v1.2.3 From dae9e5792a4f030ae9e748548a16a89790fbd311 Mon Sep 17 00:00:00 2001 From: tycho Date: Sun, 24 May 2015 12:56:56 +0100 Subject: Made -Weverything an error. --- src/Generating/FinishGen.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/Generating/FinishGen.cpp') diff --git a/src/Generating/FinishGen.cpp b/src/Generating/FinishGen.cpp index e0349f012..1c48fdee4 100644 --- a/src/Generating/FinishGen.cpp +++ b/src/Generating/FinishGen.cpp @@ -69,7 +69,7 @@ void cFinishGenNetherClumpFoliage::GenFinish(cChunkDesc & a_ChunkDesc) } // Choose what block to use. - NOISE_DATATYPE BlockType = m_Noise.IntNoise3D((int) ChunkX, y, (int) ChunkZ); + NOISE_DATATYPE BlockType = m_Noise.IntNoise3D(static_cast(ChunkX), y, static_cast(ChunkZ)); if (BlockType < -0.7) { TryPlaceClump(a_ChunkDesc, PosX, y, PosZ, E_BLOCK_BROWN_MUSHROOM); @@ -507,7 +507,7 @@ void cFinishGenSprinkleFoliage::GenFinish(cChunkDesc & a_ChunkDesc) for (int z = 0; z < cChunkDef::Width; z++) { int BlockZ = a_ChunkDesc.GetChunkZ() * cChunkDef::Width + z; - const float zz = (float)BlockZ; + const float zz = static_cast(BlockZ); for (int x = 0; x < cChunkDef::Width; x++) { int BlockX = a_ChunkDesc.GetChunkX() * cChunkDef::Width + x; @@ -528,7 +528,7 @@ void cFinishGenSprinkleFoliage::GenFinish(cChunkDesc & a_ChunkDesc) continue; } - const float xx = (float)BlockX; + const float xx = static_cast(BlockX); float val1 = m_Noise.CubicNoise2D(xx * 0.1f, zz * 0.1f); float val2 = m_Noise.CubicNoise2D(xx * 0.01f, zz * 0.01f); switch (a_ChunkDesc.GetBlockType(x, Top, z)) @@ -563,7 +563,7 @@ void cFinishGenSprinkleFoliage::GenFinish(cChunkDesc & a_ChunkDesc) } else if ((val1 > 0.5) && (val2 < -0.5)) { - a_ChunkDesc.SetBlockTypeMeta(x, ++Top, z, E_BLOCK_PUMPKIN, (int)(val3 * 8) % 4); + a_ChunkDesc.SetBlockTypeMeta(x, ++Top, z, E_BLOCK_PUMPKIN, static_cast(val3 * 8) % 4); } break; } // case E_BLOCK_GRASS @@ -650,9 +650,9 @@ void cFinishGenSoulsandRims::GenFinish(cChunkDesc & a_ChunkDesc) continue; } - NOISE_DATATYPE NoiseX = ((NOISE_DATATYPE)(xx)) / 32; - NOISE_DATATYPE NoiseY = ((NOISE_DATATYPE)(zz)) / 32; - NOISE_DATATYPE CompBlock = m_Noise.CubicNoise3D(NoiseX, (float) (y) / 4, NoiseY); + NOISE_DATATYPE NoiseX = (static_cast(xx)) / 32; + NOISE_DATATYPE NoiseY = (static_cast(zz)) / 32; + NOISE_DATATYPE CompBlock = m_Noise.CubicNoise3D(NoiseX, static_cast(y) / 4, NoiseY); if (CompBlock < 0) { a_ChunkDesc.SetBlockType(x, y, z, E_BLOCK_SOULSAND); -- cgit v1.2.3