diff options
author | Howaner <franzi.moos@googlemail.com> | 2015-01-25 00:34:19 +0100 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2015-01-25 00:34:19 +0100 |
commit | 1eedccc56a1a80b42adbea8dbbe968d42c7fe712 (patch) | |
tree | a5fe3fb72a3c3918b2c4ba413c686f718f5d403c /src/Generating | |
parent | C++11 and function rename. (diff) | |
parent | Gamosocm support (diff) | |
download | cuberite-1eedccc56a1a80b42adbea8dbbe968d42c7fe712.tar cuberite-1eedccc56a1a80b42adbea8dbbe968d42c7fe712.tar.gz cuberite-1eedccc56a1a80b42adbea8dbbe968d42c7fe712.tar.bz2 cuberite-1eedccc56a1a80b42adbea8dbbe968d42c7fe712.tar.lz cuberite-1eedccc56a1a80b42adbea8dbbe968d42c7fe712.tar.xz cuberite-1eedccc56a1a80b42adbea8dbbe968d42c7fe712.tar.zst cuberite-1eedccc56a1a80b42adbea8dbbe968d42c7fe712.zip |
Diffstat (limited to 'src/Generating')
-rw-r--r-- | src/Generating/BioGen.cpp | 14 | ||||
-rw-r--r-- | src/Generating/EndGen.cpp | 8 | ||||
-rw-r--r-- | src/Generating/Noise3DGenerator.cpp | 15 | ||||
-rw-r--r-- | src/Generating/StructGen.cpp | 14 | ||||
-rw-r--r-- | src/Generating/Trees.cpp | 14 |
5 files changed, 48 insertions, 17 deletions
diff --git a/src/Generating/BioGen.cpp b/src/Generating/BioGen.cpp index 2a4dbe794..2cc810d3b 100644 --- a/src/Generating/BioGen.cpp +++ b/src/Generating/BioGen.cpp @@ -733,7 +733,19 @@ cBioGenTwoLevel::cBioGenTwoLevel(int a_Seed) : m_Noise3(a_Seed + 5003), m_Noise4(a_Seed + 5004), m_Noise5(a_Seed + 5005), - m_Noise6(a_Seed + 5006) + m_Noise6(a_Seed + 5006), + m_FreqX1(0.0), + m_AmpX1(0.0), + m_FreqX2(0.0), + m_AmpX2(0.0), + m_FreqX3(0.0), + m_AmpX3(0.0), + m_FreqZ1(0.0), + m_AmpZ1(0.0), + m_FreqZ2(0.0), + m_AmpZ2(0.0), + m_FreqZ3(0.0), + m_AmpZ3(0.0) { } diff --git a/src/Generating/EndGen.cpp b/src/Generating/EndGen.cpp index 89d6117bb..c559e765f 100644 --- a/src/Generating/EndGen.cpp +++ b/src/Generating/EndGen.cpp @@ -39,7 +39,13 @@ cEndGen::cEndGen(int a_Seed) : m_IslandSizeZ(256), m_FrequencyX(80), m_FrequencyY(80), - m_FrequencyZ(80) + m_FrequencyZ(80), + m_MinChunkX(0), + m_MaxChunkX(0), + m_MinChunkZ(0), + m_MaxChunkZ(0), + m_LastChunkX(0x7fffffff), // Use dummy coords that won't ever be used by real chunks + m_LastChunkZ(0x7fffffff) { m_Perlin.AddOctave(1, 1); m_Perlin.AddOctave(2, 0.5); diff --git a/src/Generating/Noise3DGenerator.cpp b/src/Generating/Noise3DGenerator.cpp index b43a1a6de..eadc66a4e 100644 --- a/src/Generating/Noise3DGenerator.cpp +++ b/src/Generating/Noise3DGenerator.cpp @@ -379,7 +379,20 @@ cNoise3DComposable::cNoise3DComposable(int a_Seed) : m_ChoiceNoise(a_Seed), m_DensityNoiseA(a_Seed + 1), m_DensityNoiseB(a_Seed + 2), - m_BaseNoise(a_Seed + 3) + m_BaseNoise(a_Seed + 3), + m_HeightAmplification(0.0), + m_MidPoint(0.0), + m_FrequencyX(0.0), + m_FrequencyY(0.0), + m_FrequencyZ(0.0), + m_BaseFrequencyX(0.0), + m_BaseFrequencyZ(0.0), + m_ChoiceFrequencyX(0.0), + m_ChoiceFrequencyY(0.0), + m_ChoiceFrequencyZ(0.0), + m_AirThreshold(0.0), + m_LastChunkX(0x7fffffff), // Use dummy coords that won't ever be used by real chunks + m_LastChunkZ(0x7fffffff) { } diff --git a/src/Generating/StructGen.cpp b/src/Generating/StructGen.cpp index 2f685c808..2d5a73739 100644 --- a/src/Generating/StructGen.cpp +++ b/src/Generating/StructGen.cpp @@ -123,18 +123,18 @@ void cStructGenTrees::GenerateSingleTree( // Check if the generated image fits the terrain. Only the logs are checked: for (sSetBlockVector::const_iterator itr = TreeLogs.begin(); itr != TreeLogs.end(); ++itr) { - if ((itr->ChunkX != a_ChunkX) || (itr->ChunkZ != a_ChunkZ)) + if ((itr->m_ChunkX != a_ChunkX) || (itr->m_ChunkZ != a_ChunkZ)) { // Outside the chunk continue; } - if (itr->y >= cChunkDef::Height) + if (itr->m_RelY >= cChunkDef::Height) { // Above the chunk, cut off (this shouldn't happen too often, we're limiting trees to y < 230) continue; } - BLOCKTYPE Block = a_ChunkDesc.GetBlockType(itr->x, itr->y, itr->z); + BLOCKTYPE Block = a_ChunkDesc.GetBlockType(itr->m_RelX, itr->m_RelY, itr->m_RelZ); switch (Block) { CASE_TREE_ALLOWED_BLOCKS: @@ -167,14 +167,14 @@ void cStructGenTrees::ApplyTreeImage( // Put the generated image into a_BlockTypes, push things outside this chunk into a_Blocks for (sSetBlockVector::const_iterator itr = a_Image.begin(), end = a_Image.end(); itr != end; ++itr) { - if ((itr->ChunkX == a_ChunkX) && (itr->ChunkZ == a_ChunkZ) && (itr->y < cChunkDef::Height)) + if ((itr->m_ChunkX == a_ChunkX) && (itr->m_ChunkZ == a_ChunkZ) && (itr->m_RelY < cChunkDef::Height)) { // Inside this chunk, integrate into a_ChunkDesc: - switch (a_ChunkDesc.GetBlockType(itr->x, itr->y, itr->z)) + switch (a_ChunkDesc.GetBlockType(itr->m_RelX, itr->m_RelY, itr->m_RelZ)) { case E_BLOCK_LEAVES: { - if (itr->BlockType != E_BLOCK_LOG) + if (itr->m_BlockType != E_BLOCK_LOG) { break; } @@ -182,7 +182,7 @@ void cStructGenTrees::ApplyTreeImage( } CASE_TREE_OVERWRITTEN_BLOCKS: { - a_ChunkDesc.SetBlockTypeMeta(itr->x, itr->y, itr->z, itr->BlockType, itr->BlockMeta); + a_ChunkDesc.SetBlockTypeMeta(itr->m_RelX, itr->m_RelY, itr->m_RelZ, itr->m_BlockType, itr->m_BlockMeta); break; } diff --git a/src/Generating/Trees.cpp b/src/Generating/Trees.cpp index be8b0cd6b..a10e0f4f1 100644 --- a/src/Generating/Trees.cpp +++ b/src/Generating/Trees.cpp @@ -403,17 +403,17 @@ void GetLargeAppleTreeImage(int a_BlockX, int a_BlockY, int a_BlockZ, cNoise & a for (auto itr : a_LogBlocks) { // Get the log's X and Z coordinates - int X = itr.ChunkX * 16 + itr.x; - int Z = itr.ChunkZ * 16 + itr.z; + int X = itr.GetX(); + int Z = itr.GetZ(); - a_OtherBlocks.push_back(sSetBlock(X, itr.y - 2, Z, E_BLOCK_LEAVES, E_META_LEAVES_APPLE)); - PushCoordBlocks(X, itr.y - 2, Z, a_OtherBlocks, BigO1, ARRAYCOUNT(BigO1), E_BLOCK_LEAVES, E_META_LEAVES_APPLE); + a_OtherBlocks.push_back(sSetBlock(X, itr.m_RelY - 2, Z, E_BLOCK_LEAVES, E_META_LEAVES_APPLE)); + PushCoordBlocks(X, itr.m_RelY - 2, Z, a_OtherBlocks, BigO1, ARRAYCOUNT(BigO1), E_BLOCK_LEAVES, E_META_LEAVES_APPLE); for (int y = -1; y <= 1; y++) { - PushCoordBlocks (X, itr.y + y, Z, a_OtherBlocks, BigO2, ARRAYCOUNT(BigO2), E_BLOCK_LEAVES, E_META_LEAVES_APPLE); + PushCoordBlocks (X, itr.m_RelY + y, Z, a_OtherBlocks, BigO2, ARRAYCOUNT(BigO2), E_BLOCK_LEAVES, E_META_LEAVES_APPLE); } - PushCoordBlocks(X, itr.y + 2, Z, a_OtherBlocks, BigO1, ARRAYCOUNT(BigO1), E_BLOCK_LEAVES, E_META_LEAVES_APPLE); - a_OtherBlocks.push_back(sSetBlock(X, itr.y + 2, Z, E_BLOCK_LEAVES, E_META_LEAVES_APPLE)); + PushCoordBlocks(X, itr.m_RelY + 2, Z, a_OtherBlocks, BigO1, ARRAYCOUNT(BigO1), E_BLOCK_LEAVES, E_META_LEAVES_APPLE); + a_OtherBlocks.push_back(sSetBlock(X, itr.m_RelY + 2, Z, E_BLOCK_LEAVES, E_META_LEAVES_APPLE)); } // Trunk: |