From 250b8eb652a57dcbdff4af7b6efb9c2554b45798 Mon Sep 17 00:00:00 2001 From: x12xx12x <44411062+12xx12@users.noreply.github.com> Date: Fri, 26 Nov 2021 00:51:47 +0100 Subject: Fixed Compiler Warnings --- src/Generating/PieceModifier.cpp | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'src/Generating/PieceModifier.cpp') diff --git a/src/Generating/PieceModifier.cpp b/src/Generating/PieceModifier.cpp index 54d6a2c21..922e68e40 100644 --- a/src/Generating/PieceModifier.cpp +++ b/src/Generating/PieceModifier.cpp @@ -16,21 +16,6 @@ static const int SEED_OFFSET = 135 * 13; - - -// Emit a warning if the first param is true -#define CONDWARNING(ShouldLog, Fmt, ...) \ - do { \ - if (ShouldLog) \ - { \ - LOGWARNING(Fmt, __VA_ARGS__); \ - } \ - } while (false) - - - - - //////////////////////////////////////////////////////////////////////////////// /** A modifier which is pseudo-randomly replacing blocks to other types and metas. */ class cPieceModifierRandomizeBlocks: @@ -252,7 +237,7 @@ public: { if (m_BlocksToReplace.count(BlockTypes[i])) { - float BlockRnd = PieceNoise.IntNoise2DInRange(a_PieceRot, static_cast(i), 0, m_AllWeights); + float BlockRnd = PieceNoise.IntNoise2DInRange(a_PieceRot, static_cast(i), 0.0F, static_cast(m_AllWeights)); int weightDelta = 0; for (auto & blockToRnd : m_BlocksToRandomize) @@ -265,7 +250,7 @@ public: // Per block meta params if (blockToRnd.m_MinMeta < blockToRnd.m_MaxMeta) { - int BlockMetaRnd = std::clamp(static_cast(PieceNoise.IntNoise2DInRange(a_PieceRot*2, static_cast(i), blockToRnd.m_MinNoiseMeta, blockToRnd.m_MaxNoiseMeta)), blockToRnd.m_MinMeta, blockToRnd.m_MaxMeta); + char BlockMetaRnd = static_cast(std::clamp(static_cast(PieceNoise.IntNoise2DInRange(a_PieceRot*2, static_cast(i), static_cast(blockToRnd.m_MinNoiseMeta), static_cast(blockToRnd.m_MaxNoiseMeta))), blockToRnd.m_MinMeta, blockToRnd.m_MaxMeta)); BlockMetas[i] = static_cast(BlockMetaRnd); } else if ((blockToRnd.m_MaxMeta > -1) && (blockToRnd.m_MaxMeta == blockToRnd.m_MinMeta)) @@ -280,7 +265,7 @@ public: // All blocks meta params if (m_MaxMeta > m_MinMeta) { - int BlockMetaRnd = std::clamp(static_cast(PieceNoise.IntNoise2DInRange(a_PieceRot*2, static_cast(i), m_MinNoiseMeta, m_MaxNoiseMeta)), m_MinMeta, m_MaxMeta); + char BlockMetaRnd = static_cast(std::clamp(static_cast(PieceNoise.IntNoise2DInRange(a_PieceRot * 2, static_cast(i), static_cast(m_MinNoiseMeta), static_cast(m_MaxNoiseMeta))), m_MinMeta, m_MaxMeta)); BlockMetas[i] = static_cast(BlockMetaRnd); } else if ((m_MaxMeta > -1) && (m_MaxMeta == m_MinMeta)) -- cgit v1.2.3