From 0544b96f8041e5dd31b4da84b52d23883d0853f0 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sat, 7 Jun 2014 13:59:10 +0200 Subject: docs/Generator: Added the easy Finishers. --- src/Generating/CompoGen.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/Generating/CompoGen.cpp') diff --git a/src/Generating/CompoGen.cpp b/src/Generating/CompoGen.cpp index 578bb2481..688d19c40 100644 --- a/src/Generating/CompoGen.cpp +++ b/src/Generating/CompoGen.cpp @@ -561,10 +561,16 @@ void cCompoGenNether::ComposeTerrain(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] = + //* + FloorLo[INTERPOL_X * x + 17 * INTERPOL_Z * z] = m_Noise1.IntNoise3DInt(BaseX + INTERPOL_X * x, 0, BaseZ + INTERPOL_Z * z) * m_Noise2.IntNoise3DInt(BaseX + INTERPOL_X * x, 0, BaseZ + INTERPOL_Z * z) / 256; + //*/ + /* + FloorLo[INTERPOL_X * x + 17 * INTERPOL_Z * z] = + m_Noise1.IntNoise3DInt(BaseX + INTERPOL_X * x, 0, BaseZ + INTERPOL_Z * z) / 256; + //*/ } // for x, z - FloorLo[] LinearUpscale2DArrayInPlace<17, 17, INTERPOL_X, INTERPOL_Z>(FloorLo); @@ -574,10 +580,16 @@ void cCompoGenNether::ComposeTerrain(cChunkDesc & a_ChunkDesc) // First update the high floor: for (int z = 0; z <= 16 / INTERPOL_Z; z++) for (int x = 0; x <= 16 / INTERPOL_X; x++) { + //* FloorHi[INTERPOL_X * x + 17 * INTERPOL_Z * z] = m_Noise1.IntNoise3DInt(BaseX + INTERPOL_X * x, Segment + SEGMENT_HEIGHT, BaseZ + INTERPOL_Z * z) * m_Noise2.IntNoise3DInt(BaseX + INTERPOL_Z * x, Segment + SEGMENT_HEIGHT, BaseZ + INTERPOL_Z * z) / 256; + //*/ + /* + FloorHi[INTERPOL_X * x + 17 * INTERPOL_Z * z] = + m_Noise1.IntNoise3DInt(BaseX + INTERPOL_X * x, Segment + SEGMENT_HEIGHT, BaseZ + INTERPOL_Z * z) / 256; + //*/ } // for x, z - FloorLo[] LinearUpscale2DArrayInPlace<17, 17, INTERPOL_X, INTERPOL_Z>(FloorHi); -- cgit v1.2.3 From e8143de01bff31f9e153949d7ab5b0df82629541 Mon Sep 17 00:00:00 2001 From: archshift Date: Thu, 19 Jun 2014 01:49:56 -0700 Subject: Nullify deleted pointers. --- src/Generating/CompoGen.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/Generating/CompoGen.cpp') diff --git a/src/Generating/CompoGen.cpp b/src/Generating/CompoGen.cpp index 688d19c40..2da285d72 100644 --- a/src/Generating/CompoGen.cpp +++ b/src/Generating/CompoGen.cpp @@ -672,7 +672,9 @@ cCompoGenCache::cCompoGenCache(cTerrainCompositionGen & a_Underlying, int a_Cach cCompoGenCache::~cCompoGenCache() { delete[] m_CacheData; + m_CacheData = NULL; delete[] m_CacheOrder; + m_CacheOrder = NULL; } -- cgit v1.2.3 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/CompoGen.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Generating/CompoGen.cpp') diff --git a/src/Generating/CompoGen.cpp b/src/Generating/CompoGen.cpp index 2da285d72..160d095ed 100644 --- a/src/Generating/CompoGen.cpp +++ b/src/Generating/CompoGen.cpp @@ -18,7 +18,7 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// // cCompoGenSameBlock: void cCompoGenSameBlock::ComposeTerrain(cChunkDesc & a_ChunkDesc) @@ -60,7 +60,7 @@ void cCompoGenSameBlock::InitializeCompoGen(cIniFile & a_IniFile) -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// // cCompoGenDebugBiomes: void cCompoGenDebugBiomes::ComposeTerrain(cChunkDesc & a_ChunkDesc) @@ -111,7 +111,7 @@ void cCompoGenDebugBiomes::ComposeTerrain(cChunkDesc & a_ChunkDesc) -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// // cCompoGenClassic: cCompoGenClassic::cCompoGenClassic(void) : @@ -209,7 +209,7 @@ void cCompoGenClassic::InitializeCompoGen(cIniFile & a_IniFile) -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// // cCompoGenBiomal: void cCompoGenBiomal::ComposeTerrain(cChunkDesc & a_ChunkDesc) @@ -526,7 +526,7 @@ void cCompoGenBiomal::FillColumnPattern(int a_RelX, int a_RelZ, int a_Height, cC -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// // cCompoGenNether: cCompoGenNether::cCompoGenNether(int a_Seed) : @@ -645,7 +645,7 @@ void cCompoGenNether::InitializeCompoGen(cIniFile & a_IniFile) -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// // cCompoGenCache: cCompoGenCache::cCompoGenCache(cTerrainCompositionGen & a_Underlying, int a_CacheSize) : -- 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/CompoGen.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Generating/CompoGen.cpp') diff --git a/src/Generating/CompoGen.cpp b/src/Generating/CompoGen.cpp index 160d095ed..faf2ac243 100644 --- a/src/Generating/CompoGen.cpp +++ b/src/Generating/CompoGen.cpp @@ -68,7 +68,7 @@ void cCompoGenDebugBiomes::ComposeTerrain(cChunkDesc & a_ChunkDesc) static BLOCKTYPE Blocks[] = { E_BLOCK_STONE, - E_BLOCK_COBBLESTONE, + E_BLOCK_COBBLESTONE, E_BLOCK_LOG, E_BLOCK_PLANKS, E_BLOCK_SANDSTONE, @@ -563,7 +563,7 @@ void cCompoGenNether::ComposeTerrain(cChunkDesc & a_ChunkDesc) { //* FloorLo[INTERPOL_X * x + 17 * INTERPOL_Z * z] = - m_Noise1.IntNoise3DInt(BaseX + INTERPOL_X * x, 0, BaseZ + INTERPOL_Z * z) * + m_Noise1.IntNoise3DInt(BaseX + INTERPOL_X * x, 0, BaseZ + INTERPOL_Z * z) * m_Noise2.IntNoise3DInt(BaseX + INTERPOL_X * x, 0, BaseZ + INTERPOL_Z * z) / 256; //*/ -- cgit v1.2.3 From fe7018bd005adb8dadf849bd988696d638919f23 Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Sun, 27 Jul 2014 13:12:45 +0200 Subject: Added a ceiling to disguise the bedrock above it. --- src/Generating/CompoGen.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/Generating/CompoGen.cpp') diff --git a/src/Generating/CompoGen.cpp b/src/Generating/CompoGen.cpp index faf2ac243..655d629b7 100644 --- a/src/Generating/CompoGen.cpp +++ b/src/Generating/CompoGen.cpp @@ -628,7 +628,15 @@ void cCompoGenNether::ComposeTerrain(cChunkDesc & a_ChunkDesc) for (int z = 0; z < 16; z++) for (int x = 0; x < 16; x++) { a_ChunkDesc.SetBlockType(x, 0, z, E_BLOCK_BEDROCK); - a_ChunkDesc.SetBlockType(x, a_ChunkDesc.GetHeight(x, z), z, E_BLOCK_BEDROCK); + + int Height = a_ChunkDesc.GetHeight(x, z); + a_ChunkDesc.SetBlockType(x, Height, z, E_BLOCK_BEDROCK); + int CeilingDisguiseHeight = Height - 2 - (m_Noise1.IntNoise2DInt(a_ChunkDesc.GetChunkX() * cChunkDef::Width + x, a_ChunkDesc.GetChunkZ() * cChunkDef::Width + z) % 3); + + for (int y = Height - 1; y > CeilingDisguiseHeight; y--) + { + a_ChunkDesc.SetBlockType(x, y, z, E_BLOCK_NETHERRACK); + } } } -- cgit v1.2.3 From bfad1be567ac4fd2393398f52c615496422a67f8 Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Sun, 27 Jul 2014 14:03:23 +0200 Subject: Made nether ceiling smooth. --- src/Generating/CompoGen.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/Generating/CompoGen.cpp') diff --git a/src/Generating/CompoGen.cpp b/src/Generating/CompoGen.cpp index 655d629b7..87557afa0 100644 --- a/src/Generating/CompoGen.cpp +++ b/src/Generating/CompoGen.cpp @@ -631,7 +631,14 @@ void cCompoGenNether::ComposeTerrain(cChunkDesc & a_ChunkDesc) int Height = a_ChunkDesc.GetHeight(x, z); a_ChunkDesc.SetBlockType(x, Height, z, E_BLOCK_BEDROCK); - int CeilingDisguiseHeight = Height - 2 - (m_Noise1.IntNoise2DInt(a_ChunkDesc.GetChunkX() * cChunkDef::Width + x, a_ChunkDesc.GetChunkZ() * cChunkDef::Width + z) % 3); + // int CeilingDisguiseHeight = Height - 2 - (m_Noise1.IntNoise2DInt(a_ChunkDesc.GetChunkX() * cChunkDef::Width + x, a_ChunkDesc.GetChunkZ() * cChunkDef::Width + z) % 3); + NOISE_DATATYPE CeilingDisguise = (m_Noise1.CubicNoise2D((float)(a_ChunkDesc.GetChunkX() * cChunkDef::Width + x) / 10, (float)(a_ChunkDesc.GetChunkZ() * cChunkDef::Width + z) / 10)); + if (CeilingDisguise < 0) + { + CeilingDisguise = -CeilingDisguise; + } + + int CeilingDisguiseHeight = Height - 2 - CeilingDisguise * 3; for (int y = Height - 1; y > CeilingDisguiseHeight; y--) { -- cgit v1.2.3 From 3addd4890c8e09a561b93e84b542a2ab08ee0496 Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Sun, 27 Jul 2014 14:04:34 +0200 Subject: Removed forgotten comment --- src/Generating/CompoGen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Generating/CompoGen.cpp') diff --git a/src/Generating/CompoGen.cpp b/src/Generating/CompoGen.cpp index 87557afa0..912d74248 100644 --- a/src/Generating/CompoGen.cpp +++ b/src/Generating/CompoGen.cpp @@ -631,7 +631,7 @@ void cCompoGenNether::ComposeTerrain(cChunkDesc & a_ChunkDesc) int Height = a_ChunkDesc.GetHeight(x, z); a_ChunkDesc.SetBlockType(x, Height, z, E_BLOCK_BEDROCK); - // int CeilingDisguiseHeight = Height - 2 - (m_Noise1.IntNoise2DInt(a_ChunkDesc.GetChunkX() * cChunkDef::Width + x, a_ChunkDesc.GetChunkZ() * cChunkDef::Width + z) % 3); + NOISE_DATATYPE CeilingDisguise = (m_Noise1.CubicNoise2D((float)(a_ChunkDesc.GetChunkX() * cChunkDef::Width + x) / 10, (float)(a_ChunkDesc.GetChunkZ() * cChunkDef::Width + z) / 10)); if (CeilingDisguise < 0) { -- cgit v1.2.3 From 4f5d73b7704e351365a987b421c35f1384afa240 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Tue, 29 Jul 2014 20:50:30 +0100 Subject: Slight cleanup after portals --- src/Generating/CompoGen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Generating/CompoGen.cpp') diff --git a/src/Generating/CompoGen.cpp b/src/Generating/CompoGen.cpp index 912d74248..178673e32 100644 --- a/src/Generating/CompoGen.cpp +++ b/src/Generating/CompoGen.cpp @@ -638,7 +638,7 @@ void cCompoGenNether::ComposeTerrain(cChunkDesc & a_ChunkDesc) CeilingDisguise = -CeilingDisguise; } - int CeilingDisguiseHeight = Height - 2 - CeilingDisguise * 3; + int CeilingDisguiseHeight = Height - 2 - (int)CeilingDisguise * 3; for (int y = Height - 1; y > CeilingDisguiseHeight; y--) { -- cgit v1.2.3