diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-04-27 21:46:25 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-04-27 21:46:25 +0200 |
commit | ac8db4d16b7c097d31a7952428a499c5cd6ef849 (patch) | |
tree | fd88aa0355091567e7cc22caa25c232bc2d524d0 /source/Generating/Noise3DGenerator.h | |
parent | Fixed a few possible crashes upon server stop (diff) | |
download | cuberite-ac8db4d16b7c097d31a7952428a499c5cd6ef849.tar cuberite-ac8db4d16b7c097d31a7952428a499c5cd6ef849.tar.gz cuberite-ac8db4d16b7c097d31a7952428a499c5cd6ef849.tar.bz2 cuberite-ac8db4d16b7c097d31a7952428a499c5cd6ef849.tar.lz cuberite-ac8db4d16b7c097d31a7952428a499c5cd6ef849.tar.xz cuberite-ac8db4d16b7c097d31a7952428a499c5cd6ef849.tar.zst cuberite-ac8db4d16b7c097d31a7952428a499c5cd6ef849.zip |
Diffstat (limited to '')
-rw-r--r-- | source/Generating/Noise3DGenerator.h | 44 |
1 files changed, 42 insertions, 2 deletions
diff --git a/source/Generating/Noise3DGenerator.h b/source/Generating/Noise3DGenerator.h index 44f4f3fce..071b19019 100644 --- a/source/Generating/Noise3DGenerator.h +++ b/source/Generating/Noise3DGenerator.h @@ -8,8 +8,7 @@ #pragma once
-#include "ChunkGenerator.h"
-#include "ChunkDesc.h"
+#include "ComposableGenerator.h"
#include "../Noise.h"
@@ -55,3 +54,44 @@ protected: +
+class cNoise3DComposable :
+ public cTerrainHeightGen,
+ public cTerrainCompositionGen
+{
+public:
+ cNoise3DComposable(int a_Seed);
+
+ void Initialize(cIniFile & a_IniFile);
+
+protected:
+ cNoise m_Noise1;
+ cNoise m_Noise2;
+ cNoise m_Noise3;
+
+ int m_SeaLevel;
+ NOISE_DATATYPE m_HeightAmplification;
+ NOISE_DATATYPE m_MidPoint; // Where the vertical "center" of the noise should be
+ NOISE_DATATYPE m_FrequencyX;
+ NOISE_DATATYPE m_FrequencyY;
+ NOISE_DATATYPE m_FrequencyZ;
+ NOISE_DATATYPE m_AirThreshold;
+
+ int m_LastChunkX;
+ int m_LastChunkZ;
+ NOISE_DATATYPE m_NoiseArray[17 * 17 * 257]; // x + 17 * z + 17 * 17 * y
+
+
+ /// Generates the 3D noise array used for terrain generation, unless the LastChunk coords are equal to coords given
+ void GenerateNoiseArrayIfNeeded(int a_ChunkX, int a_ChunkZ);
+
+ // cTerrainHeightGen overrides:
+ virtual void GenHeightMap(int a_ChunkX, int a_ChunkZ, cChunkDef::HeightMap & a_HeightMap) override;
+
+ // cTerrainCompositionGen overrides:
+ virtual void ComposeTerrain(cChunkDesc & a_ChunkDesc) override;
+} ;
+
+
+
+
|