aboutsummaryrefslogtreecommitdiff
path: root/src/mapsector.h
Commit message (Collapse)AuthorAge
* ServerMap saving: cleanups (#6274)Loïc Blot2017-08-19
| | | | * remove sector meta loading/saving from files which targets dead code (differs_from_disk is always empty) * this remove empty ServerMapSector and ClientMapSector, remove MapSector childs
* Modernize various files (src/m*) (#6267)Loïc Blot2017-08-18
| | | | | | | | | | | | * Modernize various files (src/m*) * range-based for loops * code style * C++ headers instead of C headers * Default operators * empty function Thanks to clang-tidy
* C++ modernize: Pragma once (#6264)Loïc Blot2017-08-17
| | | | * Migrate cpp headers to pragma once
* Cpp11 initializers 2 (#5999)Loïc Blot2017-06-17
| | | | | | | | | | * C++11 patchset 10: continue cleanup on constructors * Drop obsolete bool MainMenuData::enable_public (setting is called with cURL in server loop) * More classes cleanup * More classes cleanup + change NULL tests to boolean tests
* C++11 patchset 2: remove util/cpp11.h and util/cpp11_container.h (#5821)Loïc Blot2017-06-04
|
* Replace various std::map with UNORDERED_MAP + various cleanupsLoic Blot2016-10-05
| | | | | | | | | | | | This is part 2 for 5f084cd98d7b3326b51320455364337539710efd Other improvements: * Use the defined ItemGroupList when used * make Client::checkPrivilege const * inline some trivial functions * Add ActiveObjectMap typedef * Add SettingsEntries typedef
* Add count based unload limit for mapblocksest312015-08-13
|
* Replace std::list by std::vector into ClientMap::updateDrawList, ↵Loic Blot2015-02-17
| | | | | | Map::timerUpdate and ServerMap::save(). This will speedup the loop reading into those functions
* Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenuKahrl2013-08-14
|
* Migrate to STL containers/algorithms.Ilya Zhuravlev2013-03-11
|
* Update Copyright YearsSfan52013-02-24
|
* Change Minetest-c55 to MinetestPilzAdam2013-02-24
|
* Optimize headersPerttu Ahola2012-06-17
|
* Switch the license to be LGPLv2/later, with small parts still remaining as ↵Perttu Ahola2012-06-05
| | | | GPLv2/later, by agreement of major contributors
* GameDef compilesPerttu Ahola2011-11-29
|
* more reorganizing of map codePerttu Ahola2011-06-26
|
* cleaned map stuffPerttu Ahola2011-06-26
|
* New map generator added (and SQLite, messed up the commits at that time...) ↵Perttu Ahola2011-06-25
| | | | (import from temporary git repo)
* mapgen stuffPerttu Ahola2011-02-05
|
* map generation framework under development... not quite operational at this ↵Perttu Ahola2011-01-30
| | | | point.
* old water removed, some fixes here and therePerttu Ahola2011-01-17
|
* added dedicated server build without irrlichtPerttu Ahola2010-12-19
|
* better waterPerttu Ahola2010-11-30
|
* license stuffPerttu Ahola2010-11-29
| | | | | --HG-- rename : src/licensecomment.txt => licensecomment.txt
* sitä sun tätä tekeillä, toimii kivastiPerttu Ahola2010-11-29
|
* Initial filesPerttu Ahola2010-11-27
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). virtual Biome *getBiomeAtPoint(v3s16 pos) const = 0; // Same as above, but uses a raw numeric index correlating to the (x,z) position. virtual Biome *getBiomeAtIndex(size_t index, s16 y) const = 0; // Result of calcBiomes bulk computation. biome_t *biomemap = nullptr; protected: BiomeManager *m_bmgr = nullptr; v3s16 m_pmin; v3s16 m_csize; }; //// //// BiomeGen implementations //// // // Original biome algorithm (Whittaker's classification + surface height) // struct BiomeParamsOriginal : public BiomeParams { BiomeParamsOriginal() : 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) { } virtual void readParams(const Settings *settings); virtual void writeParams(Settings *settings) const; NoiseParams np_heat; NoiseParams np_humidity; NoiseParams np_heat_blend; NoiseParams np_humidity_blend; }; class BiomeGenOriginal : public BiomeGen { public: BiomeGenOriginal(BiomeManager *biomemgr, BiomeParamsOriginal *params, v3s16 chunksize); virtual ~BiomeGenOriginal(); BiomeGenType getType() const { return BIOMEGEN_ORIGINAL; } Biome *calcBiomeAtPoint(v3s16 pos) const; void calcBiomeNoise(v3s16 pmin); biome_t *getBiomes(s16 *heightmap); Biome *getBiomeAtPoint(v3s16 pos) const; Biome *getBiomeAtIndex(size_t index, s16 y) const; Biome *calcBiomeFromNoise(float heat, float humidity, s16 y) const; float *heatmap; float *humidmap; private: BiomeParamsOriginal *m_params; Noise *noise_heat; Noise *noise_humidity; Noise *noise_heat_blend; Noise *noise_humidity_blend; }; //// //// BiomeManager //// class BiomeManager : public ObjDefManager { public: BiomeManager(Server *server); virtual ~BiomeManager() = default; const char *getObjectTitle() const { return "biome"; } static Biome *create(BiomeType type) { return new Biome; } BiomeGen *createBiomeGen(BiomeGenType type, BiomeParams *params, v3s16 chunksize) { switch (type) { case BIOMEGEN_ORIGINAL: return new BiomeGenOriginal(this, (BiomeParamsOriginal *)params, chunksize); default: return NULL; } } static BiomeParams *createBiomeParams(BiomeGenType type) { switch (type) { case BIOMEGEN_ORIGINAL: return new BiomeParamsOriginal; default: return NULL; } } virtual void clear(); private: Server *m_server; };