diff options
author | Julian Laubstein <julianlaubstein@yahoo.de> | 2015-07-29 18:45:36 +0200 |
---|---|---|
committer | Julian Laubstein <julianlaubstein@yahoo.de> | 2015-07-29 18:45:36 +0200 |
commit | 735d590abf7f804a4504b70c84a289ba86c5f8e3 (patch) | |
tree | 13b603c8bbf8177da92ce87f5413fb646d204f3f /src/Noise/InterpolNoise.h | |
parent | Merge pull request #2376 from mjhanninen/fix-freebsd-build (diff) | |
parent | Silenced and fixed many warning messages across multiple files. (diff) | |
download | cuberite-735d590abf7f804a4504b70c84a289ba86c5f8e3.tar cuberite-735d590abf7f804a4504b70c84a289ba86c5f8e3.tar.gz cuberite-735d590abf7f804a4504b70c84a289ba86c5f8e3.tar.bz2 cuberite-735d590abf7f804a4504b70c84a289ba86c5f8e3.tar.lz cuberite-735d590abf7f804a4504b70c84a289ba86c5f8e3.tar.xz cuberite-735d590abf7f804a4504b70c84a289ba86c5f8e3.tar.zst cuberite-735d590abf7f804a4504b70c84a289ba86c5f8e3.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Noise/InterpolNoise.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/Noise/InterpolNoise.h b/src/Noise/InterpolNoise.h index 683b54563..afc7cff49 100644 --- a/src/Noise/InterpolNoise.h +++ b/src/Noise/InterpolNoise.h @@ -11,7 +11,7 @@ #include "Noise.h" -#define FAST_FLOOR(x) (((x) < 0) ? (((int)x) - 1) : ((int)x)) +#define FAST_FLOOR(x) (((x) < 0) ? ((static_cast<int>(x)) - 1) : (static_cast<int>(x))) @@ -104,7 +104,7 @@ public: } else { - (*m_WorkRnds)[x][y] = (NOISE_DATATYPE)m_Noise.IntNoise2D(cx, cy); + (*m_WorkRnds)[x][y] = static_cast<NOISE_DATATYPE>(m_Noise.IntNoise2D(cx, cy)); } } } @@ -221,14 +221,14 @@ public: m_CurFloorX = a_FloorX; m_CurFloorY = a_FloorY; m_CurFloorZ = a_FloorZ; - (*m_WorkRnds)[0][0][0] = (NOISE_DATATYPE)m_Noise.IntNoise3D(m_CurFloorX, m_CurFloorY, m_CurFloorZ); - (*m_WorkRnds)[0][0][1] = (NOISE_DATATYPE)m_Noise.IntNoise3D(m_CurFloorX, m_CurFloorY, m_CurFloorZ + 1); - (*m_WorkRnds)[0][1][0] = (NOISE_DATATYPE)m_Noise.IntNoise3D(m_CurFloorX, m_CurFloorY + 1, m_CurFloorZ); - (*m_WorkRnds)[0][1][1] = (NOISE_DATATYPE)m_Noise.IntNoise3D(m_CurFloorX, m_CurFloorY + 1, m_CurFloorZ + 1); - (*m_WorkRnds)[1][0][0] = (NOISE_DATATYPE)m_Noise.IntNoise3D(m_CurFloorX + 1, m_CurFloorY, m_CurFloorZ); - (*m_WorkRnds)[1][0][1] = (NOISE_DATATYPE)m_Noise.IntNoise3D(m_CurFloorX + 1, m_CurFloorY, m_CurFloorZ + 1); - (*m_WorkRnds)[1][1][0] = (NOISE_DATATYPE)m_Noise.IntNoise3D(m_CurFloorX + 1, m_CurFloorY + 1, m_CurFloorZ); - (*m_WorkRnds)[1][1][1] = (NOISE_DATATYPE)m_Noise.IntNoise3D(m_CurFloorX + 1, m_CurFloorY + 1, m_CurFloorZ + 1); + (*m_WorkRnds)[0][0][0] = static_cast<NOISE_DATATYPE>(m_Noise.IntNoise3D(m_CurFloorX, m_CurFloorY, m_CurFloorZ)); + (*m_WorkRnds)[0][0][1] = static_cast<NOISE_DATATYPE>(m_Noise.IntNoise3D(m_CurFloorX, m_CurFloorY, m_CurFloorZ + 1)); + (*m_WorkRnds)[0][1][0] = static_cast<NOISE_DATATYPE>(m_Noise.IntNoise3D(m_CurFloorX, m_CurFloorY + 1, m_CurFloorZ)); + (*m_WorkRnds)[0][1][1] = static_cast<NOISE_DATATYPE>(m_Noise.IntNoise3D(m_CurFloorX, m_CurFloorY + 1, m_CurFloorZ + 1)); + (*m_WorkRnds)[1][0][0] = static_cast<NOISE_DATATYPE>(m_Noise.IntNoise3D(m_CurFloorX + 1, m_CurFloorY, m_CurFloorZ)); + (*m_WorkRnds)[1][0][1] = static_cast<NOISE_DATATYPE>(m_Noise.IntNoise3D(m_CurFloorX + 1, m_CurFloorY, m_CurFloorZ + 1)); + (*m_WorkRnds)[1][1][0] = static_cast<NOISE_DATATYPE>(m_Noise.IntNoise3D(m_CurFloorX + 1, m_CurFloorY + 1, m_CurFloorZ)); + (*m_WorkRnds)[1][1][1] = static_cast<NOISE_DATATYPE>(m_Noise.IntNoise3D(m_CurFloorX + 1, m_CurFloorY + 1, m_CurFloorZ + 1)); } @@ -265,7 +265,7 @@ public: } else { - (*m_WorkRnds)[x][y][z] = (NOISE_DATATYPE)m_Noise.IntNoise3D(cx, cy, cz); + (*m_WorkRnds)[x][y][z] = static_cast<NOISE_DATATYPE>(m_Noise.IntNoise3D(cx, cy, cz)); } } // for z } // for y |