20 #include "../Noise/Noise.h"
75 cHeiGenMultiCache(std::unique_ptr<cTerrainHeightGen> a_HeightGenToCache,
size_t a_SubCacheSize,
size_t a_NumSubCaches);
unsigned char HEIGHTTYPE
The type used by the heightmap.
float NOISE_DATATYPE
The datatype used by all the noise generators.
Wraps the chunk coords into a single structure.
HEIGHTTYPE HeightMap[Width *Width]
The type used for any heightmap operations and storage; idx = x + Width * z; Height points to the hig...
EMCSBiome BiomeMap[Width *Width]
The type used for any biomemap operations and storage inside Cuberite, using Cuberite biomes (need no...
The interface that a biome generator must implement A biome generator takes chunk coords on input and...
The interface that is used to query terrain height from the shape generator.
virtual HEIGHTTYPE GetHeightAt(int a_BlockX, int a_BlockZ)
Returns the height at the specified column.
A simple cache that stores N most recently generated chunks' heightmaps; N being settable upon creati...
virtual void GenHeightMap(cChunkCoords a_ChunkCoords, cChunkDef::HeightMap &a_HeightMap) override
Retrieves the heightmap for the specified chunk.
std::vector< size_t > m_CacheOrder
virtual HEIGHTTYPE GetHeightAt(int a_BlockX, int a_BlockZ) override
Returns the height at the specified column.
cTerrainHeightGen & m_HeiGenToCache
The terrain height generator that is being cached.
std::vector< sCacheData > m_CacheData
cHeiGenCache(cTerrainHeightGen &a_HeiGenToCache, size_t a_CacheSize)
cChunkDef::HeightMap m_HeightMap
sCacheData()
Default constructor: Fill in bogus coords, so that the item is not used until properly calculated.
Caches heightmaps in multiple underlying caches to improve the distribution and lower the chain lengt...
virtual HEIGHTTYPE GetHeightAt(int a_BlockX, int a_BlockZ) override
Returns the height at the specified column.
size_t m_NumSubCaches
Number of sub-caches, pulled out of m_SubCaches.size() for performance reasons.
static const size_t m_CoeffZ
The coefficient used to turn Z coords into index (x + Coeff * z).
cHeiGenMultiCache(std::unique_ptr< cTerrainHeightGen > a_HeightGenToCache, size_t a_SubCacheSize, size_t a_NumSubCaches)
virtual void GenHeightMap(cChunkCoords a_ChunkCoords, cChunkDef::HeightMap &a_HeightMap) override
Retrieves the heightmap for the specified chunk.
std::vector< std::unique_ptr< cHeiGenCache > > m_SubCaches
The individual sub-caches.
std::unique_ptr< cTerrainHeightGen > m_Underlying
The underlying height generator.
virtual void GenHeightMap(cChunkCoords a_ChunkCoords, cChunkDef::HeightMap &a_HeightMap) override
Retrieves the heightmap for the specified chunk.
virtual void InitializeHeightGen(cIniFile &a_IniFile) override
Initializes the generator, reading its parameters from the INI file.
virtual void GenHeightMap(cChunkCoords a_ChunkCoords, cChunkDef::HeightMap &a_HeightMap) override
Retrieves the heightmap for the specified chunk.
cHeiGenClassic(int a_Seed)
virtual void InitializeHeightGen(cIniFile &a_IniFile) override
Initializes the generator, reading its parameters from the INI file.
float GetNoise(float x, float y)
cHeiGenMountains(int a_Seed)
virtual void InitializeHeightGen(cIniFile &a_IniFile) override
Initializes the generator, reading its parameters from the INI file.
virtual void GenHeightMap(cChunkCoords a_ChunkCoords, cChunkDef::HeightMap &a_HeightMap) override
Retrieves the heightmap for the specified chunk.
cRidgedMultiNoise m_DitchNoise
cRidgedMultiNoise m_MountainNoise
virtual HEIGHTTYPE GetHeightAt(int a_BlockX, int a_BlockZ) override
Returns the height at the specified column.
virtual void InitializeHeightGen(cIniFile &a_IniFile) override
Initializes the generator, reading its parameters from the INI file.
virtual void GenHeightMap(cChunkCoords a_ChunkCoords, cChunkDef::HeightMap &a_HeightMap) override
Retrieves the heightmap for the specified chunk.
static const sGenParam m_GenParam[256]
cHeiGenBiomal(int a_Seed, cBiomeGen &a_BiomeGen)
cChunkDef::BiomeMap BiomeNeighbors[3][3]