summaryrefslogtreecommitdiffstats
path: root/src/Generating
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-12-20 16:01:34 +0100
committermadmaxoft <github@xoft.cz>2013-12-20 16:01:34 +0100
commit8610d45ef18f075e7fa207732233ddbd69bb604b (patch)
tree3f7401c1dfb8926d1917f0c92762c3507ca4a51b /src/Generating
parentFixed melon and pumpkin growing. (diff)
downloadcuberite-8610d45ef18f075e7fa207732233ddbd69bb604b.tar
cuberite-8610d45ef18f075e7fa207732233ddbd69bb604b.tar.gz
cuberite-8610d45ef18f075e7fa207732233ddbd69bb604b.tar.bz2
cuberite-8610d45ef18f075e7fa207732233ddbd69bb604b.tar.lz
cuberite-8610d45ef18f075e7fa207732233ddbd69bb604b.tar.xz
cuberite-8610d45ef18f075e7fa207732233ddbd69bb604b.tar.zst
cuberite-8610d45ef18f075e7fa207732233ddbd69bb604b.zip
Diffstat (limited to 'src/Generating')
-rw-r--r--src/Generating/BioGen.cpp6
-rw-r--r--src/Generating/ChunkDesc.cpp4
-rw-r--r--src/Generating/DistortedHeightmap.cpp2
-rw-r--r--src/Generating/EndGen.cpp2
-rw-r--r--src/Generating/FinishGen.cpp6
-rw-r--r--src/Generating/HeiGen.cpp4
-rw-r--r--src/Generating/MineShafts.cpp2
-rw-r--r--src/Generating/Noise3DGenerator.cpp8
-rw-r--r--src/Generating/StructGen.cpp8
9 files changed, 23 insertions, 19 deletions
diff --git a/src/Generating/BioGen.cpp b/src/Generating/BioGen.cpp
index 98999dee9..f89b1800d 100644
--- a/src/Generating/BioGen.cpp
+++ b/src/Generating/BioGen.cpp
@@ -83,7 +83,7 @@ cBiomeGen * cBiomeGen::CreateBiomeGen(cIniFile & a_IniFile, int a_Seed, bool & a
void cBioGenConstant::GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a_BiomeMap)
{
- for (int i = 0; i < ARRAYCOUNT(a_BiomeMap); i++)
+ for (size_t i = 0; i < ARRAYCOUNT(a_BiomeMap); i++)
{
a_BiomeMap[i] = m_Biome;
}
@@ -277,7 +277,7 @@ void cBiomeGenList::InitializeBiomes(const AString & a_Biomes)
biJungleHills,
} ;
m_Biomes.reserve(ARRAYCOUNT(Biomes));
- for (int i = 0; i < ARRAYCOUNT(Biomes); i++)
+ for (size_t i = 0; i < ARRAYCOUNT(Biomes); i++)
{
m_Biomes.push_back(Biomes[i]);
}
@@ -655,7 +655,7 @@ void cBioGenMultiStepMap::BuildTemperatureHumidityMaps(int a_ChunkX, int a_Chunk
LinearUpscale2DArrayInPlace(HumidityMap, 17, 17, 8, 8);
// Re-map into integral values in [0 .. 255] range:
- for (int idx = 0; idx < ARRAYCOUNT(a_TemperatureMap); idx++)
+ for (size_t idx = 0; idx < ARRAYCOUNT(a_TemperatureMap); idx++)
{
a_TemperatureMap[idx] = std::max(0, std::min(255, (int)(128 + TemperatureMap[idx] * 128)));
a_HumidityMap[idx] = std::max(0, std::min(255, (int)(128 + HumidityMap[idx] * 128)));
diff --git a/src/Generating/ChunkDesc.cpp b/src/Generating/ChunkDesc.cpp
index 6050430fd..af1a8a6c7 100644
--- a/src/Generating/ChunkDesc.cpp
+++ b/src/Generating/ChunkDesc.cpp
@@ -371,7 +371,7 @@ void cChunkDesc::ReadBlockArea(cBlockArea & a_Dest, int a_MinRelX, int a_MaxRelX
HEIGHTTYPE cChunkDesc::GetMaxHeight(void) const
{
HEIGHTTYPE MaxHeight = m_HeightMap[0];
- for (unsigned int i = 1; i < ARRAYCOUNT(m_HeightMap); i++)
+ for (size_t i = 1; i < ARRAYCOUNT(m_HeightMap); i++)
{
if (m_HeightMap[i] > MaxHeight)
{
@@ -565,7 +565,7 @@ cBlockEntity * cChunkDesc::GetBlockEntity(int a_RelX, int a_RelY, int a_RelZ)
void cChunkDesc::CompressBlockMetas(cChunkDef::BlockNibbles & a_DestMetas)
{
const NIBBLETYPE * AreaMetas = m_BlockArea.GetBlockMetas();
- for (unsigned int i = 0; i < ARRAYCOUNT(a_DestMetas); i++)
+ for (size_t i = 0; i < ARRAYCOUNT(a_DestMetas); i++)
{
a_DestMetas[i] = AreaMetas[2 * i] | (AreaMetas[2 * i + 1] << 4);
}
diff --git a/src/Generating/DistortedHeightmap.cpp b/src/Generating/DistortedHeightmap.cpp
index c32a3bf43..342a4483f 100644
--- a/src/Generating/DistortedHeightmap.cpp
+++ b/src/Generating/DistortedHeightmap.cpp
@@ -612,7 +612,7 @@ void cDistortedHeightmap::GetDistortAmpsAt(BiomeNeighbors & a_Neighbors, int a_R
// For each biome type that has a nonzero count, calc its amps and add it:
NOISE_DATATYPE AmpX = 0;
NOISE_DATATYPE AmpZ = 0;
- for (unsigned int i = 0; i < ARRAYCOUNT(BiomeCounts); i++)
+ for (size_t i = 0; i < ARRAYCOUNT(BiomeCounts); i++)
{
if (BiomeCounts[i] <= 0)
{
diff --git a/src/Generating/EndGen.cpp b/src/Generating/EndGen.cpp
index 1fa0fa121..f466039b9 100644
--- a/src/Generating/EndGen.cpp
+++ b/src/Generating/EndGen.cpp
@@ -151,7 +151,7 @@ void cEndGen::GenHeightMap(int a_ChunkX, int a_ChunkZ, cChunkDef::HeightMap & a_
{
if (IsChunkOutsideRange(a_ChunkX, a_ChunkZ))
{
- for (unsigned int i = 0; i < ARRAYCOUNT(a_HeightMap); i++)
+ for (size_t i = 0; i < ARRAYCOUNT(a_HeightMap); i++)
{
a_HeightMap[i] = 0;
}
diff --git a/src/Generating/FinishGen.cpp b/src/Generating/FinishGen.cpp
index 8899e4bd0..866551e8a 100644
--- a/src/Generating/FinishGen.cpp
+++ b/src/Generating/FinishGen.cpp
@@ -271,7 +271,7 @@ void cFinishGenIce::GenFinish(cChunkDesc & a_ChunkDesc)
int cFinishGenSingleBiomeSingleTopBlock::GetNumToGen(const cChunkDef::BiomeMap & a_BiomeMap)
{
int res = 0;
- for (int i = 0; i < ARRAYCOUNT(a_BiomeMap); i++)
+ for (size_t i = 0; i < ARRAYCOUNT(a_BiomeMap); i++)
{
if (a_BiomeMap[i] == m_Biome)
{
@@ -469,7 +469,7 @@ void cFinishGenPreSimulator::StationarizeFluid(
{0, -1, 0}
} ;
BLOCKTYPE BlockToSet = a_StationaryFluid; // By default, don't simulate this block
- for (int i = 0; i < ARRAYCOUNT(Coords); i++)
+ for (size_t i = 0; i < ARRAYCOUNT(Coords); i++)
{
if ((y == 0) && (Coords[i].y < 0))
{
@@ -635,7 +635,7 @@ bool cFinishGenFluidSprings::TryPlaceSpring(cChunkDesc & a_ChunkDesc, int x, int
{ 0, 0, 1},
} ;
int NumAirNeighbors = 0;
- for (int i = 0; i < ARRAYCOUNT(Coords); i++)
+ for (size_t i = 0; i < ARRAYCOUNT(Coords); i++)
{
switch (a_ChunkDesc.GetBlockType(x + Coords[i].x, y + Coords[i].y, z + Coords[i].z))
{
diff --git a/src/Generating/HeiGen.cpp b/src/Generating/HeiGen.cpp
index ea6051371..2bf641089 100644
--- a/src/Generating/HeiGen.cpp
+++ b/src/Generating/HeiGen.cpp
@@ -18,7 +18,7 @@
void cHeiGenFlat::GenHeightMap(int a_ChunkX, int a_ChunkZ, cChunkDef::HeightMap & a_HeightMap)
{
- for (int i = 0; i < ARRAYCOUNT(a_HeightMap); i++)
+ for (size_t i = 0; i < ARRAYCOUNT(a_HeightMap); i++)
{
a_HeightMap[i] = m_Height;
}
@@ -421,7 +421,7 @@ NOISE_DATATYPE cHeiGenBiomal::GetHeightAt(int a_RelX, int a_RelZ, int a_ChunkX,
NOISE_DATATYPE Height = 0;
int BlockX = a_ChunkX * cChunkDef::Width + a_RelX;
int BlockZ = a_ChunkZ * cChunkDef::Width + a_RelZ;
- for (int i = 0; i < ARRAYCOUNT(BiomeCounts); i++)
+ for (size_t i = 0; i < ARRAYCOUNT(BiomeCounts); i++)
{
if (BiomeCounts[i] == 0)
{
diff --git a/src/Generating/MineShafts.cpp b/src/Generating/MineShafts.cpp
index f42240e55..cc39cef7b 100644
--- a/src/Generating/MineShafts.cpp
+++ b/src/Generating/MineShafts.cpp
@@ -1035,7 +1035,7 @@ void cMineShaftCrossing::AppendBranches(int a_RecursionLevel, cNoise & a_Noise)
{ 5, 5, 2, dirXP},
{ 2, 5, 5, dirZP},
} ;
- for (unsigned int i = 0; i < ARRAYCOUNT(Exits); i++)
+ for (size_t i = 0; i < ARRAYCOUNT(Exits); i++)
{
if (m_BoundingBox.p1.y + Exits[i].y >= m_BoundingBox.p2.y)
{
diff --git a/src/Generating/Noise3DGenerator.cpp b/src/Generating/Noise3DGenerator.cpp
index 0c68957c0..2511bb656 100644
--- a/src/Generating/Noise3DGenerator.cpp
+++ b/src/Generating/Noise3DGenerator.cpp
@@ -30,7 +30,7 @@ public:
void DoTest1(void)
{
float In[3 * 3 * 3];
- for (int i = 0; i < ARRAYCOUNT(In); i++)
+ for (size_t i = 0; i < ARRAYCOUNT(In); i++)
{
In[i] = (float)(i % 5);
}
@@ -44,7 +44,7 @@ public:
void DoTest2(void)
{
float In[3 * 3];
- for (int i = 0; i < ARRAYCOUNT(In); i++)
+ for (size_t i = 0; i < ARRAYCOUNT(In); i++)
{
In[i] = (float)(i % 5);
}
@@ -170,7 +170,7 @@ void cNoise3DGenerator::Initialize(cWorld * a_World, cIniFile & a_IniFile)
void cNoise3DGenerator::GenerateBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a_BiomeMap)
{
- for (unsigned int i = 0; i < ARRAYCOUNT(a_BiomeMap); i++)
+ for (size_t i = 0; i < ARRAYCOUNT(a_BiomeMap); i++)
{
a_BiomeMap[i] = biExtremeHills;
}
@@ -236,7 +236,7 @@ void cNoise3DGenerator::GenerateNoiseArray(int a_ChunkX, int a_ChunkZ, NOISE_DAT
// Precalculate a "height" array:
NOISE_DATATYPE Height[DIM_X * DIM_Z]; // Output for the cubic noise heightmap ("source")
m_Cubic.Generate2D(Height, DIM_X, DIM_Z, StartX / 25, EndX / 25, StartZ / 25, EndZ / 25);
- for (unsigned int i = 0; i < ARRAYCOUNT(Height); i++)
+ for (size_t i = 0; i < ARRAYCOUNT(Height); i++)
{
Height[i] = abs(Height[i]) * m_HeightAmplification + 1;
}
diff --git a/src/Generating/StructGen.cpp b/src/Generating/StructGen.cpp
index 504c26238..da6227801 100644
--- a/src/Generating/StructGen.cpp
+++ b/src/Generating/StructGen.cpp
@@ -467,7 +467,7 @@ void cStructGenLakes::CreateLakeImage(int a_ChunkX, int a_ChunkZ, cBlockArea & a
cChunkDef::HeightMap HeightMap;
m_HeiGen.GenHeightMap(a_ChunkX, a_ChunkZ, HeightMap);
HEIGHTTYPE MinHeight = HeightMap[0];
- for (int i = 1; i < ARRAYCOUNT(HeightMap); i++)
+ for (size_t i = 1; i < ARRAYCOUNT(HeightMap); i++)
{
if (HeightMap[i] < MinHeight)
{
@@ -646,7 +646,7 @@ void cStructGenDirectOverhangs::GenStructures(cChunkDesc & a_ChunkDesc)
bool cStructGenDirectOverhangs::HasWantedBiome(cChunkDesc & a_ChunkDesc) const
{
cChunkDef::BiomeMap & Biomes = a_ChunkDesc.GetBiomeMap();
- for (int i = 0; i < ARRAYCOUNT(Biomes); i++)
+ for (size_t i = 0; i < ARRAYCOUNT(Biomes); i++)
{
switch (Biomes[i])
{
@@ -655,6 +655,10 @@ bool cStructGenDirectOverhangs::HasWantedBiome(cChunkDesc & a_ChunkDesc) const
{
return true;
}
+ default:
+ {
+ break;
+ }
}
} // for i
return false;