1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-17 10:25:21 +02:00

Add initial Lua biomedef support, fixed biome selection

This commit is contained in:
kwolekr
2012-12-18 13:23:16 -05:00
committed by Perttu Ahola
parent 11afcbff69
commit 96898c1794
8 changed files with 419 additions and 197 deletions

View File

@@ -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();
};