summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Generating/BioGen.cpp4
-rw-r--r--src/LinearUpscale.h6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/Generating/BioGen.cpp b/src/Generating/BioGen.cpp
index 6c929f4cb..f0d2af4f3 100644
--- a/src/Generating/BioGen.cpp
+++ b/src/Generating/BioGen.cpp
@@ -554,7 +554,7 @@ void cBioGenMultiStepMap::AddRivers(int a_ChunkX, int a_ChunkZ, cChunkDef::Biome
{
for (int z = 0; z < cChunkDef::Width; z++)
{
- float NoiseCoordZ = static_cast<float>(a_ChunkZ * cChunkDef::Width + z / m_RiverCellSize);
+ float NoiseCoordZ = static_cast<float>(a_ChunkZ * cChunkDef::Width + z) / m_RiverCellSize;
for (int x = 0; x < cChunkDef::Width; x++)
{
if (cChunkDef::GetBiome(a_BiomeMap, x, z) != biInvalidBiome)
@@ -563,7 +563,7 @@ void cBioGenMultiStepMap::AddRivers(int a_ChunkX, int a_ChunkZ, cChunkDef::Biome
continue;
}
- float NoiseCoordX = static_cast<float>(a_ChunkX * cChunkDef::Width + x / m_RiverCellSize);
+ float NoiseCoordX = static_cast<float>(a_ChunkX * cChunkDef::Width + x) / m_RiverCellSize;
double Noise = m_Noise1.CubicNoise2D( NoiseCoordX, NoiseCoordZ);
Noise += 0.5 * m_Noise3.CubicNoise2D(2 * NoiseCoordX, 2 * NoiseCoordZ);
diff --git a/src/LinearUpscale.h b/src/LinearUpscale.h
index d4e9da82a..adc873912 100644
--- a/src/LinearUpscale.h
+++ b/src/LinearUpscale.h
@@ -184,15 +184,15 @@ template <typename TYPE> void LinearUpscale3DArray(
TYPE RatioZ[MAX_UPSCALE_Z];
for (int x = 0; x <= a_UpscaleX; x++)
{
- RatioX[x] = static_cast<TYPE>(x / a_UpscaleX);
+ RatioX[x] = static_cast<TYPE>(x) / a_UpscaleX;
}
for (int y = 0; y <= a_UpscaleY; y++)
{
- RatioY[y] = static_cast<TYPE>(y / a_UpscaleY);
+ RatioY[y] = static_cast<TYPE>(y) / a_UpscaleY;
}
for (int z = 0; z <= a_UpscaleZ; z++)
{
- RatioZ[z] = static_cast<TYPE>(z / a_UpscaleZ);
+ RatioZ[z] = static_cast<TYPE>(z) / a_UpscaleZ;
}
// Interpolate each XYZ cell: