More style checking.

Spaces around some operators are checked.
This commit is contained in:
Mattes D
2015-05-09 12:58:54 +02:00
parent 61300ab9ef
commit c13b1931ff
78 changed files with 207 additions and 186 deletions
+2 -2
View File
@@ -237,7 +237,7 @@ bool cCaveTunnel::RefineDefPoints(const cCaveDefPoints & a_Src, cCaveDefPoints &
return true;
}
// Smoothing: for each line segment, add points on its 1/4 lengths
// Smoothing: for each line segment, add points on its 1 / 4 lengths
bool res = false;
size_t Num = a_Src.size() - 2; // this many intermediary points
a_Dst.clear();
@@ -488,7 +488,7 @@ void cCaveTunnel::ProcessChunk(
continue;
}
// Carve out a sphere around the xyz point, m_Radius in diameter; skip 3/7 off the top and bottom:
// Carve out a sphere around the xyz point, m_Radius in diameter; skip 3 / 7 off the top and bottom:
int DifX = itr->m_BlockX - BlockStartX; // substitution for faster calc
int DifY = itr->m_BlockY;
int DifZ = itr->m_BlockZ - BlockStartZ; // substitution for faster calc
+2 -2
View File
@@ -209,7 +209,7 @@ void cChunkGenerator::Execute(void)
{
if ((NumChunksGenerated > 16) && (clock() - LastReportTick > CLOCKS_PER_SEC))
{
LOG("Chunk generator performance: %.2f ch/s (%d ch total)",
LOG("Chunk generator performance: %.2f ch / sec (%d ch total)",
(double)NumChunksGenerated * CLOCKS_PER_SEC/ (clock() - GenerationStart),
NumChunksGenerated
);
@@ -241,7 +241,7 @@ void cChunkGenerator::Execute(void)
// Display perf info once in a while:
if ((NumChunksGenerated > 16) && (clock() - LastReportTick > 2 * CLOCKS_PER_SEC))
{
LOG("Chunk generator performance: %.2f ch/s (%d ch total)",
LOG("Chunk generator performance: %.2f ch / sec (%d ch total)",
(double)NumChunksGenerated * CLOCKS_PER_SEC / (clock() - GenerationStart),
NumChunksGenerated
);
+1 -1
View File
@@ -195,7 +195,7 @@ void cFinishGenGlowStone::GenFinish(cChunkDesc & a_ChunkDesc)
// The maximum size for a string of glowstone can get 3 - 5 blocks long
int Size = 3 + m_Noise.IntNoise3DInt(ChunkX, i, ChunkZ) % 3;
// Generate X/Z coordinates.
// Generate X / Z coordinates.
int X = Size + (m_Noise.IntNoise2DInt(i, Size) % (cChunkDef::Width - Size * 2));
int Z = Size + (m_Noise.IntNoise2DInt(X, i) % (cChunkDef::Width - Size * 2));
+1 -1
View File
@@ -667,7 +667,7 @@ public:
virtual void GenHeightMap(int a_ChunkX, int a_ChunkZ, cChunkDef::HeightMap & a_HeightMap)
{
// Generate the biomes for the 3*3 neighbors:
// Generate the biomes for the 3 * 3 neighbors:
cChunkDef::BiomeMap neighborBiomes[3][3];
for (int z = 0; z < 3; z++) for (int x = 0; x < 3; x++)
{
+2 -2
View File
@@ -5,7 +5,7 @@
/*
The integers generated may be interpreted in several ways:
- land/see designators
- land / sea designators
- 0 = ocean
- >0 = land
- biome group
@@ -310,7 +310,7 @@ public:
}
}
// Copy from Cache into a_Values; take into account the even/odd offsets in a_Min:
// Copy from Cache into a_Values; take into account the even / odd offsets in a_Min:
for (int z = 0; z < SizeZ; ++z)
{
memcpy(a_Values + z * SizeX, cache + (z + (a_MinZ & 1)) * lowStepX + (a_MinX & 1), SizeX * sizeof(int));
+1 -1
View File
@@ -680,7 +680,7 @@ void cBiomalNoise3DComposable::GenerateNoiseArrayIfNeeded(int a_ChunkX, int a_Ch
void cBiomalNoise3DComposable::CalcBiomeParamArrays(int a_ChunkX, int a_ChunkZ, ChunkParam & a_HeightAmp, ChunkParam & a_MidPoint)
{
// Generate the 3*3 chunks of biomes around this chunk:
// Generate the 3 * 3 chunks of biomes around this chunk:
cChunkDef::BiomeMap neighborBiomes[3 * 3];
for (int z = 0; z < 3; z++)
{
+1 -1
View File
@@ -229,7 +229,7 @@ public:
}
}
// Copy from Cache into a_Values; take into account the even/odd offsets in a_Min:
// Copy from Cache into a_Values; take into account the even / odd offsets in a_Min:
for (int z = 0; z < a_SizeZ; ++z)
{
memcpy(a_Values + z * a_SizeX, cache + (z + (a_MinZ & 1)) * lowStepX + (a_MinX & 1), a_SizeX * sizeof(int));
+1 -1
View File
@@ -61,7 +61,7 @@ protected:
/** The noise used as a pseudo-random generator */
cNoise m_Noise;
/** Maximum size, in X/Z blocks, of the village (radius from the origin) */
/** Maximum size, in X / Z blocks, of the village (radius from the origin) */
int m_MaxSize;
/** Borders of the vilalge - no item may reach out of this cuboid. */
+1 -1
View File
@@ -34,7 +34,7 @@ protected:
/** Maximum depth of the generator tree*/
int m_MaxDepth;
/** Maximum size, in X/Z blocks, of the base (radius from the origin) */
/** Maximum size, in X / Z blocks, of the structure (radius from the origin) */
int m_MaxSize;
+2 -2
View File
@@ -124,7 +124,7 @@ cStructGenRavines::cRavine::cRavine(int a_GridX, int a_GridZ, int a_OriginX, int
void cStructGenRavines::cRavine::GenerateBaseDefPoints(int a_BlockX, int a_BlockZ, int a_Size, cNoise & a_Noise)
{
// Modify the size slightly to have different-sized ravines (1/2 to 1/1 of a_Size):
// Modify the size slightly to have different-sized ravines (1 / 2 to 1 / 1 of a_Size):
a_Size = (512 + ((a_Noise.IntNoise3DInt(19 * a_BlockX, 11 * a_BlockZ, a_BlockX + a_BlockZ) / 17) % 512)) * a_Size / 1024;
// The complete offset of the ravine from its cellpoint, up to 2 * a_Size in each direction
@@ -177,7 +177,7 @@ void cStructGenRavines::cRavine::RefineDefPoints(const cRavDefPoints & a_Src, cR
return;
}
// Smoothing: for each line segment, add points on its 1/4 lengths
// Smoothing: for each line segment, add points on its 1 / 4 lengths
size_t Num = a_Src.size() - 2; // this many intermediary points
a_Dst.clear();
a_Dst.reserve(Num * 2 + 2);
+1 -1
View File
@@ -311,7 +311,7 @@ void cStructGenOreNests::GenerateOre(int a_ChunkX, int a_ChunkZ, BLOCKTYPE a_Ore
rnd /= cChunkDef::Width;
int BaseY = rnd % a_MaxHeight;
rnd /= a_MaxHeight;
int NestSize = a_NestSize + (rnd % (a_NestSize / 4)); // The actual nest size may be up to 1/4 larger
int NestSize = a_NestSize + (rnd % (a_NestSize / 4)); // The actual nest size may be up to 1 / 4 larger
int Num = 0;
while (Num < NestSize)
{
+1 -1
View File
@@ -61,7 +61,7 @@ protected:
/** The noise used as a pseudo-random generator */
cNoise m_Noise;
/** Maximum size, in X/Z blocks, of the structure (radius from the origin) */
/** Maximum size, in X / Z blocks, of the structure (radius from the origin) */
int m_MaxSize;
/** Borders of the structure - no item may reach out of this cuboid. */
+2 -2
View File
@@ -31,10 +31,10 @@ protected:
/** The noise used for generating random numbers */
cNoise m_Noise;
/** Maximum depth of the generator tree*/
/** Maximum depth of the generator tree */
int m_MaxDepth;
/** Maximum size, in X/Z blocks, of the base (radius from the origin) */
/** Maximum size, in X / Z blocks, of the structure (radius from the origin) */
int m_MaxSize;
+2 -2
View File
@@ -499,7 +499,7 @@ void GetBirchTreeImage(int a_BlockX, int a_BlockY, int a_BlockZ, cNoise & a_Nois
PushCornerBlocks(a_BlockX, h, a_BlockZ, a_Seq, a_Noise, 0x5fffffff, a_OtherBlocks, 1, E_BLOCK_LEAVES, E_META_LEAVES_BIRCH);
h--;
// Third and fourth layers - BigO2 and maybe 2*Corners:
// Third and fourth layers - BigO2 and maybe 2 * Corners:
for (int Row = 0; Row < 2; Row++)
{
PushCoordBlocks (a_BlockX, h, a_BlockZ, a_OtherBlocks, BigO2, ARRAYCOUNT(BigO2), E_BLOCK_LEAVES, E_META_LEAVES_BIRCH);
@@ -673,7 +673,7 @@ void GetTallBirchTreeImage(int a_BlockX, int a_BlockY, int a_BlockZ, cNoise & a_
PushCornerBlocks(a_BlockX, h, a_BlockZ, a_Seq, a_Noise, 0x5fffffff, a_OtherBlocks, 1, E_BLOCK_LEAVES, E_META_LEAVES_BIRCH);
h--;
// Third and fourth layers - BigO2 and maybe 2*Corners:
// Third and fourth layers - BigO2 and maybe 2 * Corners:
for (int Row = 0; Row < 2; Row++)
{
PushCoordBlocks (a_BlockX, h, a_BlockZ, a_OtherBlocks, BigO2, ARRAYCOUNT(BigO2), E_BLOCK_LEAVES, E_META_LEAVES_BIRCH);
+1 -1
View File
@@ -61,7 +61,7 @@ protected:
/** The noise used as a pseudo-random generator */
cNoise m_Noise;
/** Maximum size, in X/Z blocks, of the village (radius from the origin) */
/** Maximum size, in X / Z blocks, of the base (radius from the origin) */
int m_MaxSize;
/** Borders of the vilalge - no item may reach out of this cuboid. */
+1 -1
View File
@@ -34,7 +34,7 @@ protected:
/** Maximum depth of the generator tree*/
int m_MaxDepth;
/** Maximum size, in X/Z blocks, of the base (radius from the origin) */
/** Maximum size, in X / Z blocks, of the structure (radius from the origin) */
int m_MaxSize;
/** The underlying biome generator that defines whether the base is created or not */
+1 -1
View File
@@ -162,7 +162,7 @@ protected:
/** The noise used as a pseudo-random generator */
cNoise m_Noise;
/** Maximum size, in X/Z blocks, of the village (radius from the origin) */
/** Maximum size, in X / Z blocks, of the village (radius from the origin) */
int m_MaxSize;
/** The density for this village. Used to refrain from populating all house connectors. Range [0, 100] */
+1 -1
View File
@@ -32,7 +32,7 @@ protected:
/** Maximum depth of the generator tree*/
int m_MaxDepth;
/** Maximum size, in X/Z blocks, of the village (radius from the origin) */
/** Maximum size, in X / Z blocks, of the village (radius from the origin) */
int m_MaxSize;
/** Minimum density - percentage of allowed house connections. Range [0, 100] */