]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/mg_biome.h
Remove unused variable Client::m_active_blocks
[dragonfireclient.git] / src / mg_biome.h
index 9c653a7687e677b45febfc5bbf54508245ab5b7a..e289fb16dd71657b928f902df25c532c4d256c39 100644 (file)
@@ -21,70 +21,68 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define MG_BIOME_HEADER
 
 #include "mapgen.h"
-#include "noise.h"
 
-//#include <string>
-//#include "nodedef.h"
-//#include "gamedef.h"
-//#include "mapnode.h"
+struct NoiseParams;
 
-enum BiomeTerrainType
+enum BiomeType
 {
-       BIOME_TERRAIN_NORMAL,
-       BIOME_TERRAIN_LIQUID,
-       BIOME_TERRAIN_NETHER,
-       BIOME_TERRAIN_AETHER,
-       BIOME_TERRAIN_FLAT
+       BIOME_NORMAL,
+       BIOME_LIQUID,
+       BIOME_NETHER,
+       BIOME_AETHER,
+       BIOME_FLAT
 };
 
-extern NoiseParams nparams_biome_def_heat;
-extern NoiseParams nparams_biome_def_humidity;
-
-
-struct BiomeNoiseInput {
-       v2s16 mapsize;
-       float *heat_map;
-       float *humidity_map;
-       s16 *height_map;
-};
-
-class Biome : public GenElement {
+class Biome : public ObjDef, public NodeResolver {
 public:
        u32 flags;
 
        content_t c_top;
        content_t c_filler;
+       content_t c_stone;
+       content_t c_water_top;
        content_t c_water;
+       content_t c_river_water;
        content_t c_dust;
-       content_t c_dust_water;
 
        s16 depth_top;
        s16 depth_filler;
+       s16 depth_water_top;
 
-       s16 height_min;
-       s16 height_max;
+       s16 y_min;
+       s16 y_max;
        float heat_point;
        float humidity_point;
+
+       virtual void resolveNodeNames();
 };
 
-class BiomeManager : public GenElementManager {
+class BiomeManager : public ObjDefManager {
 public:
-       static const char *ELEMENT_TITLE;
-       static const size_t ELEMENT_LIMIT = 0x100;
-
-       NoiseParams *np_heat;
-       NoiseParams *np_humidity;
+       static const char *OBJECT_TITLE;
 
        BiomeManager(IGameDef *gamedef);
-       ~BiomeManager();
+       virtual ~BiomeManager();
 
-       Biome *create(int btt)
+       const char *getObjectTitle() const
+       {
+               return "biome";
+       }
+
+       static Biome *create(BiomeType type)
        {
                return new Biome;
        }
 
-       void calcBiomes(BiomeNoiseInput *input, u8 *biomeid_map);
+       virtual void clear();
+
+       void calcBiomes(s16 sx, s16 sy, float *heat_map, float *humidity_map,
+               s16 *height_map, u8 *biomeid_map);
        Biome *getBiome(float heat, float humidity, s16 y);
+
+private:
+       IGameDef *m_gamedef;
 };
 
 #endif
+