summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpeterbell10 <peterbell10@live.co.uk>2017-05-27 14:27:31 +0200
committerLukas Pioch <lukas@zgow.de>2017-06-14 11:15:44 +0200
commit4dc72fe00b66ef7d55458f7753a186d83771222b (patch)
tree5933393c87be0984f3cec14af2896406f928f835
parentFastRandom rewrite (#3754) (diff)
downloadcuberite-4dc72fe00b66ef7d55458f7753a186d83771222b.tar
cuberite-4dc72fe00b66ef7d55458f7753a186d83771222b.tar.gz
cuberite-4dc72fe00b66ef7d55458f7753a186d83771222b.tar.bz2
cuberite-4dc72fe00b66ef7d55458f7753a186d83771222b.tar.lz
cuberite-4dc72fe00b66ef7d55458f7753a186d83771222b.tar.xz
cuberite-4dc72fe00b66ef7d55458f7753a186d83771222b.tar.zst
cuberite-4dc72fe00b66ef7d55458f7753a186d83771222b.zip
-rw-r--r--src/Generating/Noise3DGenerator.cpp24
-rw-r--r--src/Generating/Noise3DGenerator.h3
-rw-r--r--src/Generating/StructGen.cpp16
3 files changed, 2 insertions, 41 deletions
diff --git a/src/Generating/Noise3DGenerator.cpp b/src/Generating/Noise3DGenerator.cpp
index 54b65722f..114fc953e 100644
--- a/src/Generating/Noise3DGenerator.cpp
+++ b/src/Generating/Noise3DGenerator.cpp
@@ -236,7 +236,7 @@ void cNoise3DGenerator::DoGenerate(int a_ChunkX, int a_ChunkZ, cChunkDesc & a_Ch
}
}
- UpdateHeightmap(a_ChunkDesc);
+ a_ChunkDesc.UpdateHeightmap();
ComposeTerrain (a_ChunkDesc);
}
@@ -299,28 +299,6 @@ void cNoise3DGenerator::GenerateNoiseArray(int a_ChunkX, int a_ChunkZ, NOISE_DAT
-void cNoise3DGenerator::UpdateHeightmap(cChunkDesc & a_ChunkDesc)
-{
- for (int z = 0; z < cChunkDef::Width; z++)
- {
- for (int x = 0; x < cChunkDef::Width; x++)
- {
- for (HEIGHTTYPE y = cChunkDef::Height - 1; y > 0; y--)
- {
- if (a_ChunkDesc.GetBlockType(x, y, z) != E_BLOCK_AIR)
- {
- a_ChunkDesc.SetHeight(x, z, y);
- break;
- }
- } // for y
- } // for x
- } // for z
-}
-
-
-
-
-
void cNoise3DGenerator::ComposeTerrain(cChunkDesc & a_ChunkDesc)
{
// Make basic terrain composition:
diff --git a/src/Generating/Noise3DGenerator.h b/src/Generating/Noise3DGenerator.h
index 0b0730e21..91408a32b 100644
--- a/src/Generating/Noise3DGenerator.h
+++ b/src/Generating/Noise3DGenerator.h
@@ -61,9 +61,6 @@ protected:
/** Generates the 3D noise array used for terrain generation; a_Noise is of ChunkData-size */
void GenerateNoiseArray(int a_ChunkX, int a_ChunkZ, NOISE_DATATYPE * a_Noise);
- /** Updates heightmap based on the chunk's contents */
- void UpdateHeightmap(cChunkDesc & a_ChunkDesc);
-
/** Composes terrain - adds dirt, grass and sand */
void ComposeTerrain(cChunkDesc & a_ChunkDesc);
} ;
diff --git a/src/Generating/StructGen.cpp b/src/Generating/StructGen.cpp
index c1e6906fc..3e2ab8855 100644
--- a/src/Generating/StructGen.cpp
+++ b/src/Generating/StructGen.cpp
@@ -67,21 +67,7 @@ void cStructGenTrees::GenFinish(cChunkDesc & a_ChunkDesc)
} // for z
} // for x
- // Update the heightmap:
- for (int x = 0; x < cChunkDef::Width; x++)
- {
- for (int z = 0; z < cChunkDef::Width; z++)
- {
- for (HEIGHTTYPE y = cChunkDef::Height - 1; y >= 0; y--)
- {
- if (a_ChunkDesc.GetBlockType(x, y, z) != E_BLOCK_AIR)
- {
- a_ChunkDesc.SetHeight(x, z, y);
- break;
- }
- } // for y
- } // for z
- } // for x
+ a_ChunkDesc.UpdateHeightmap();
}