From 2423fbf2efa39e28cc348acc11b9269e573dcdef Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 17 Jul 2014 22:15:34 +0200 Subject: Normalized comments. This was mostly done automatically and then visually inspected for obvious errors. All //-style comments should have a 2-space separation from the code, and 1 space after the comment sign. --- src/Generating/StructGen.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Generating/StructGen.cpp') diff --git a/src/Generating/StructGen.cpp b/src/Generating/StructGen.cpp index 636364e17..2e41243d6 100644 --- a/src/Generating/StructGen.cpp +++ b/src/Generating/StructGen.cpp @@ -12,7 +12,7 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// // cStructGenOreNests configuration: const int MAX_HEIGHT_COAL = 127; @@ -51,7 +51,7 @@ const int NEST_SIZE_GRAVEL = 32; -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// // cStructGenTrees: void cStructGenTrees::GenFinish(cChunkDesc & a_ChunkDesc) @@ -303,7 +303,7 @@ int cStructGenTrees::GetNumTrees( -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// // cStructGenOreNests: void cStructGenOreNests::GenFinish(cChunkDesc & a_ChunkDesc) @@ -410,7 +410,7 @@ void cStructGenOreNests::GenerateOre(int a_ChunkX, int a_ChunkZ, BLOCKTYPE a_Ore -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// // cStructGenLakes: void cStructGenLakes::GenFinish(cChunkDesc & a_ChunkDesc) @@ -532,7 +532,7 @@ void cStructGenLakes::CreateLakeImage(int a_ChunkX, int a_ChunkZ, cBlockArea & a -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// // cStructGenDirectOverhangs: cStructGenDirectOverhangs::cStructGenDirectOverhangs(int a_Seed) : @@ -648,7 +648,7 @@ bool cStructGenDirectOverhangs::HasWantedBiome(cChunkDesc & a_ChunkDesc) const -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// // cStructGenDistortedMembraneOverhangs: cStructGenDistortedMembraneOverhangs::cStructGenDistortedMembraneOverhangs(int a_Seed) : -- cgit v1.2.3 From 5e198c673009cf8ca9d92cf59848999bc96bbc37 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 17 Jul 2014 22:50:58 +0200 Subject: Basic style fixes. --- src/Generating/StructGen.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/Generating/StructGen.cpp') diff --git a/src/Generating/StructGen.cpp b/src/Generating/StructGen.cpp index 2e41243d6..5deded17d 100644 --- a/src/Generating/StructGen.cpp +++ b/src/Generating/StructGen.cpp @@ -151,7 +151,7 @@ void cStructGenTrees::GenerateSingleTree( sSetBlockVector TreeLogs, TreeOther; GetTreeImageByBiome( a_ChunkX * cChunkDef::Width + x, Height + 1, a_ChunkZ * cChunkDef::Width + z, - m_Noise, a_Seq, + m_Noise, a_Seq, a_ChunkDesc.GetBiome(x, z), TreeLogs, TreeOther ); @@ -181,7 +181,7 @@ void cStructGenTrees::GenerateSingleTree( } ApplyTreeImage(a_ChunkX, a_ChunkZ, a_ChunkDesc, TreeOther, a_OutsideOther); - ApplyTreeImage(a_ChunkX, a_ChunkZ, a_ChunkDesc, TreeLogs, a_OutsideLogs); + ApplyTreeImage(a_ChunkX, a_ChunkZ, a_ChunkDesc, TreeLogs, a_OutsideLogs); } @@ -500,7 +500,7 @@ void cStructGenLakes::CreateLakeImage(int a_ChunkX, int a_ChunkZ, cBlockArea & a continue; } int IdxYZ = BubbleX + IdxY + (BubbleZ + z) * 16; - for (int x = -BubbleR; x <= BubbleR; x++) + for (int x = -BubbleR; x <= BubbleR; x++) { if (x * x + DistYZ < RSquared) { @@ -511,10 +511,10 @@ void cStructGenLakes::CreateLakeImage(int a_ChunkX, int a_ChunkZ, cBlockArea & a } // for y } // for i - bubbles - // Turn air in the bottom half into liquid: + // Turn air in the bottom half into liquid: for (int y = 0; y < 4; y++) { - for (int z = 0; z < 16; z++) for (int x = 0; x < 16; x++) + for (int z = 0; z < 16; z++) for (int x = 0; x < 16; x++) { if (BlockTypes[x + z * 16 + y * 16 * 16] == E_BLOCK_AIR) { @@ -573,8 +573,8 @@ void cStructGenDirectOverhangs::GenFinish(cChunkDesc & a_ChunkDesc) // Interpolate the lowest floor: for (int z = 0; z <= 16 / INTERPOL_Z; z++) for (int x = 0; x <= 16 / INTERPOL_X; x++) { - FloorLo[INTERPOL_X * x + 17 * INTERPOL_Z * z] = - m_Noise1.IntNoise3DInt(BaseX + INTERPOL_X * x, BaseY, BaseZ + INTERPOL_Z * z) * + FloorLo[INTERPOL_X * x + 17 * INTERPOL_Z * z] = + m_Noise1.IntNoise3DInt(BaseX + INTERPOL_X * x, BaseY, BaseZ + INTERPOL_Z * z) * m_Noise2.IntNoise3DInt(BaseX + INTERPOL_X * x, BaseY, BaseZ + INTERPOL_Z * z) / 256; } // for x, z - FloorLo[] -- cgit v1.2.3 From 32b25ec7f799ca15fdcdc3e9e9535c798d0cc523 Mon Sep 17 00:00:00 2001 From: archshift Date: Thu, 17 Jul 2014 18:34:47 -0700 Subject: Generator: removed rnd definitions that are never read --- src/Generating/StructGen.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/Generating/StructGen.cpp') diff --git a/src/Generating/StructGen.cpp b/src/Generating/StructGen.cpp index 5deded17d..054eec345 100644 --- a/src/Generating/StructGen.cpp +++ b/src/Generating/StructGen.cpp @@ -484,7 +484,6 @@ void cStructGenLakes::CreateLakeImage(int a_ChunkX, int a_ChunkZ, cBlockArea & a const int BubbleY = 4 + (Rnd & 0x01); // 4 .. 5 Rnd >>= 1; const int BubbleZ = BubbleR + (Rnd % Range); - Rnd >>= 4; const int HalfR = BubbleR / 2; // 1 .. 2 const int RSquared = BubbleR * BubbleR; for (int y = -HalfR; y <= HalfR; y++) -- cgit v1.2.3