aboutsummaryrefslogtreecommitdiff
path: root/src/mapgen/mg_biome.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mapgen/mg_biome.h')
-rw-r--r--src/mapgen/mg_biome.h27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/mapgen/mg_biome.h b/src/mapgen/mg_biome.h
index be4cfea4d..c85afc3a0 100644
--- a/src/mapgen/mg_biome.h
+++ b/src/mapgen/mg_biome.h
@@ -97,6 +97,15 @@ public:
virtual BiomeGenType getType() const = 0;
+ // Clone this BiomeGen and set a the new BiomeManager to be used by the copy
+ virtual BiomeGen *clone(BiomeManager *biomemgr) const = 0;
+
+ // Check that the internal chunk size is what the mapgen expects, just to be sure.
+ inline void assertChunkSize(v3s16 expect) const
+ {
+ FATAL_ERROR_IF(m_csize != expect, "Chunk size mismatches");
+ }
+
// Calculates the biome at the exact position provided. This function can
// be called at any time, but may be less efficient than the latter methods,
// depending on implementation.
@@ -158,12 +167,18 @@ struct BiomeParamsOriginal : public BiomeParams {
class BiomeGenOriginal : public BiomeGen {
public:
BiomeGenOriginal(BiomeManager *biomemgr,
- BiomeParamsOriginal *params, v3s16 chunksize);
+ const BiomeParamsOriginal *params, v3s16 chunksize);
virtual ~BiomeGenOriginal();
BiomeGenType getType() const { return BIOMEGEN_ORIGINAL; }
+ BiomeGen *clone(BiomeManager *biomemgr) const;
+
+ // Slower, meant for Script API use
+ float calcHeatAtPoint(v3s16 pos) const;
+ float calcHumidityAtPoint(v3s16 pos) const;
Biome *calcBiomeAtPoint(v3s16 pos) const;
+
void calcBiomeNoise(v3s16 pmin);
biome_t *getBiomes(s16 *heightmap, v3s16 pmin);
@@ -176,7 +191,7 @@ public:
float *humidmap;
private:
- BiomeParamsOriginal *m_params;
+ const BiomeParamsOriginal *m_params;
Noise *noise_heat;
Noise *noise_humidity;
@@ -229,14 +244,6 @@ public:
virtual void clear();
- // For BiomeGen type 'BiomeGenOriginal'
- float getHeatAtPosOriginal(v3s16 pos, NoiseParams &np_heat,
- NoiseParams &np_heat_blend, u64 seed) const;
- float getHumidityAtPosOriginal(v3s16 pos, NoiseParams &np_humidity,
- NoiseParams &np_humidity_blend, u64 seed) const;
- const Biome *getBiomeFromNoiseOriginal(float heat, float humidity,
- v3s16 pos) const;
-
private:
BiomeManager() {};