1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-06 17:41:04 +00:00

Move biome calculation to BiomeGen

BiomeGen defines an interface that, given a set of BiomeParams, computes biomes
for a given area using the algorithm implemented by that specific BiomeGen.
This abstracts away the old system where each mapgen supplied the noises
required for biome generation.
This commit is contained in:
kwolekr 2016-04-28 03:43:09 -04:00
parent fa6b21a15b
commit 76f4856479
16 changed files with 421 additions and 304 deletions

View file

@ -39,6 +39,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#define MYCUBE(x) (x) * (x) * (x)
class BiomeManager;
class BiomeGenOriginal;
// Global profiler
//class Profiler;
@ -98,6 +99,7 @@ public:
private:
EmergeManager *m_emerge;
BiomeManager *bmgr;
BiomeGenOriginal *m_bgen;
int ystride;
int zstride;
@ -136,11 +138,6 @@ private:
Noise *noise_valley_depth;
Noise *noise_valley_profile;
Noise *noise_heat;
Noise *noise_heat_blend;
Noise *noise_humidity;
Noise *noise_humidity_blend;
content_t c_cobble;
content_t c_desert_stone;
content_t c_dirt;
@ -164,9 +161,7 @@ private:
float terrainLevelFromNoise(TerrainNoise *tn);
float adjustedTerrainLevelFromNoise(TerrainNoise *tn);
float humidityByTerrain(float humidity_base, float mount, float rivers, float valley);
MgStoneType generateBiomes(float *heat_map, float *humidity_map);
MgStoneType generateBiomes();
void dustTopNodes();
void generateCaves(s16 max_stone_y);