X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fmg_biome.h;h=854ada5048b30c2cb663c9fb8503ed60e616f770;hb=4faaadc8d50d6ab7a19d22bd5a760c4b8321a51f;hp=389b7664fac79b59ee2d7cf0218ec0fa56c67f61;hpb=dfbdb5bcd7bc48efb21d585d5c22454a9d5f0f1e;p=dragonfireclient.git diff --git a/src/mg_biome.h b/src/mg_biome.h index 389b7664f..854ada504 100644 --- a/src/mg_biome.h +++ b/src/mg_biome.h @@ -1,6 +1,7 @@ /* Minetest -Copyright (C) 2010-2013 kwolekr, Ryan Kwolek +Copyright (C) 2014-2016 kwolekr, Ryan Kwolek +Copyright (C) 2014-2017 paramat 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 @@ -24,6 +25,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "nodedef.h" #include "noise.h" +class Server; class Settings; class BiomeManager; @@ -31,7 +33,9 @@ class BiomeManager; //// Biome //// -#define BIOME_NONE ((u8)0) +typedef u8 biome_t; + +#define BIOME_NONE ((biome_t)0) // TODO(hmmmm): Decide whether this is obsolete or will be used in the future enum BiomeType { @@ -52,11 +56,13 @@ class Biome : public ObjDef, public NodeResolver { content_t c_water_top; content_t c_water; content_t c_river_water; + content_t c_riverbed; content_t c_dust; s16 depth_top; s16 depth_filler; s16 depth_water_top; + s16 depth_riverbed; s16 y_min; s16 y_max; @@ -101,7 +107,7 @@ class BiomeGen { // Gets all biomes in current chunk using each corresponding element of // heightmap as the y position, then stores the results by biome index in // biomemap (also returned) - virtual u8 *getBiomes(s16 *heightmap) = 0; + virtual biome_t *getBiomes(s16 *heightmap) = 0; // Gets a single biome at the specified position, which must be contained // in the region formed by m_pmin and (m_pmin + m_csize - 1). @@ -111,10 +117,10 @@ class BiomeGen { virtual Biome *getBiomeAtIndex(size_t index, s16 y) const = 0; // Result of calcBiomes bulk computation. - u8 *biomemap; + biome_t *biomemap = nullptr; protected: - BiomeManager *m_bmgr; + BiomeManager *m_bmgr = nullptr; v3s16 m_pmin; v3s16 m_csize; }; @@ -130,8 +136,8 @@ class BiomeGen { struct BiomeParamsOriginal : public BiomeParams { BiomeParamsOriginal() : - np_heat(50, 50, v3f(750.0, 750.0, 750.0), 5349, 3, 0.5, 2.0), - np_humidity(50, 50, v3f(750.0, 750.0, 750.0), 842, 3, 0.5, 2.0), + np_heat(50, 50, v3f(1000.0, 1000.0, 1000.0), 5349, 3, 0.5, 2.0), + np_humidity(50, 50, v3f(1000.0, 1000.0, 1000.0), 842, 3, 0.5, 2.0), np_heat_blend(0, 1.5, v3f(8.0, 8.0, 8.0), 13, 2, 1.0, 2.0), np_humidity_blend(0, 1.5, v3f(8.0, 8.0, 8.0), 90003, 2, 1.0, 2.0) { @@ -157,7 +163,7 @@ class BiomeGenOriginal : public BiomeGen { Biome *calcBiomeAtPoint(v3s16 pos) const; void calcBiomeNoise(v3s16 pmin); - u8 *getBiomes(s16 *heightmap); + biome_t *getBiomes(s16 *heightmap); Biome *getBiomeAtPoint(v3s16 pos) const; Biome *getBiomeAtIndex(size_t index, s16 y) const; @@ -182,7 +188,7 @@ class BiomeGenOriginal : public BiomeGen { class BiomeManager : public ObjDefManager { public: - BiomeManager(IGameDef *gamedef); + BiomeManager(Server *server); virtual ~BiomeManager(); const char *getObjectTitle() const @@ -218,11 +224,8 @@ class BiomeManager : public ObjDefManager { virtual void clear(); - // Looks for pos in the biome cache, and if non-existent, looks up by noise - u8 getBiomeAtPoint(v3s16 pos); - private: - IGameDef *m_gamedef; + Server *m_server; };