aboutsummaryrefslogtreecommitdiff
path: root/src/biome.h
diff options
context:
space:
mode:
authorWeblate <42@minetest.ru>2013-04-07 13:39:28 +0200
committerWeblate <42@minetest.ru>2013-04-07 13:39:28 +0200
commitfeb7de91ec34ef1ca3152270a7bc62b2e308f1bd (patch)
tree65c33378bae9b7ac565b979237b6d594b511171f /src/biome.h
parent33052abf42886ef03c4f46196cab6f767259a672 (diff)
parent4468ea84e6d0faede5a01e8d97d359c537aa7ec8 (diff)
downloadminetest-feb7de91ec34ef1ca3152270a7bc62b2e308f1bd.tar.gz
minetest-feb7de91ec34ef1ca3152270a7bc62b2e308f1bd.tar.bz2
minetest-feb7de91ec34ef1ca3152270a7bc62b2e308f1bd.zip
Merge remote branch 'origin/master'
Diffstat (limited to 'src/biome.h')
-rw-r--r--src/biome.h75
1 files changed, 33 insertions, 42 deletions
diff --git a/src/biome.h b/src/biome.h
index c30af46ad..17703db5a 100644
--- a/src/biome.h
+++ b/src/biome.h
@@ -1,6 +1,6 @@
/*
Minetest
-Copyright (C) 2010-2013 kwolekr, Ryan Kwolek <kwolekr2@cs.scranton.edu>
+Copyright (C) 2010-2013 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@@ -27,7 +27,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "noise.h"
#include "mapgen.h"
-
enum BiomeTerrainType
{
BIOME_TERRAIN_NORMAL,
@@ -37,62 +36,54 @@ enum BiomeTerrainType
BIOME_TERRAIN_FLAT
};
+extern NoiseParams nparams_biome_def_heat;
+extern NoiseParams nparams_biome_def_humidity;
+
class Biome {
public:
- MapNode n_top;
- MapNode n_filler;
- s16 ntopnodes;
- s8 groupid;
- s8 flags;
- s16 height_min;
- s16 height_max;
- float heat_min;
- float heat_max;
- float humidity_min;
- float humidity_max;
+ u8 id;
std::string name;
- NoiseParams *np;
+ u32 flags;
+
+ std::string top_nodename;
+ std::string filler_nodename;
- virtual void genColumn(Mapgen *mg, int x, int z, int y1, int y2);
- virtual int getSurfaceHeight(float noise_terrain);
-};
-
-class BiomeLiquid : public Biome {
- virtual void genColumn(Mapgen *mg, int x, int z, int y1, int y2);
-};
+ content_t c_top;
+ s16 top_depth;
-class BiomeHell : public Biome {
- virtual void genColumn(Mapgen *mg, int x, int z, int y1, int y2);
- 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);
+ content_t c_filler;
+ s16 filler_height;
+
+ s16 height_min;
+ s16 height_max;
+ float heat_point;
+ float humidity_point;
};
-class BiomeSuperflat : public Biome {
- virtual void genColumn(Mapgen *mg, int x, int z, int y1, int y2);
- virtual int getSurfaceHeight(float noise_terrain);
+struct BiomeNoiseInput {
+ v2s16 mapsize;
+ float *heat_map;
+ float *humidity_map;
+ s16 *height_map;
};
class BiomeDefManager {
public:
- std::vector<float> bgroup_freqs;
- std::vector<std::vector<Biome *> *> bgroups;
- Biome *biome_default;
- IGameDef *m_gamedef;
- INodeDefManager *ndef;
+ std::vector<Biome *> biomes;
- BiomeDefManager(IGameDef *gamedef);
- ~BiomeDefManager();
+ bool biome_registration_finished;
+ NoiseParams *np_heat;
+ NoiseParams *np_humidity;
+ BiomeDefManager();
+ ~BiomeDefManager();
+
Biome *createBiome(BiomeTerrainType btt);
- Biome *getBiome(float bgfreq, float heat, float humidity);
+ void calcBiomes(BiomeNoiseInput *input, u8 *biomeid_map);
+ Biome *getBiome(float heat, float humidity, s16 y);
- void addBiomeGroup(float freq);
void addBiome(Biome *b);
- void addDefaultBiomes();
+ void resolveNodeNames(INodeDefManager *ndef);
};
#endif