aboutsummaryrefslogtreecommitdiff
path: root/src/biome.h
diff options
context:
space:
mode:
authorkwolekr <mirrorisim@gmail.com>2012-12-18 13:23:16 -0500
committerPerttu Ahola <celeron55@gmail.com>2013-01-21 21:41:37 +0200
commit96898c179458174f858bab6363636ef231b49865 (patch)
treeff40e2830df3bd491774714bfcc85dc9d56d3f94 /src/biome.h
parent11afcbff69c95915e5142bc4b55636ff6358ece9 (diff)
downloadhax-minetest-server-96898c179458174f858bab6363636ef231b49865.tar.gz
hax-minetest-server-96898c179458174f858bab6363636ef231b49865.zip
Add initial Lua biomedef support, fixed biome selection
Diffstat (limited to 'src/biome.h')
-rw-r--r--src/biome.h24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/biome.h b/src/biome.h
index 5e43ab6d7..bb35dd1c4 100644
--- a/src/biome.h
+++ b/src/biome.h
@@ -20,12 +20,23 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#ifndef BIOME_HEADER
#define BIOME_HEADER
+#include <string>
#include "nodedef.h"
#include "gamedef.h"
#include "mapnode.h"
#include "noise.h"
#include "mapgen.h"
+
+enum BiomeTerrainType
+{
+ BIOME_TERRAIN_NORMAL,
+ BIOME_TERRAIN_LIQUID,
+ BIOME_TERRAIN_NETHER,
+ BIOME_TERRAIN_AETHER,
+ BIOME_TERRAIN_FLAT
+};
+
class Biome {
public:
MapNode n_top;
@@ -38,14 +49,14 @@ public:
float heat_max;
float humidity_min;
float humidity_max;
- const char *name;
+ std::string name;
NoiseParams *np;
virtual void genColumn(Mapgen *mg, int x, int z, int y1, int y2);
virtual int getSurfaceHeight(float noise_terrain);
};
-class BiomeOcean : public Biome {
+class BiomeLiquid : public Biome {
virtual void genColumn(Mapgen *mg, int x, int z, int y1, int y2);
};
@@ -54,6 +65,11 @@ class BiomeHell : public Biome {
virtual int getSurfaceHeight(float noise_terrain);
};
+class BiomeAether : public Biome {
+ virtual void genColumn(Mapgen *mg, int x, int z, int y1, int y2);
+ virtual int getSurfaceHeight(float noise_terrain);
+};
+
class BiomeSuperflat : public Biome {
virtual void genColumn(Mapgen *mg, int x, int z, int y1, int y2);
virtual int getSurfaceHeight(float noise_terrain);
@@ -70,9 +86,11 @@ public:
BiomeDefManager(IGameDef *gamedef);
~BiomeDefManager();
+ Biome *createBiome(BiomeTerrainType btt);
Biome *getBiome(float bgfreq, float heat, float humidity);
- void addBiome();
+ void addBiomeGroup(float freq);
+ void addBiome(int groupid, Biome *b);
void addDefaultBiomes();
};