summaryrefslogtreecommitdiff
path: root/src/util/numeric.cpp
Commit message (Expand)AuthorAge
* numeric: Fix clang, broken since d5456daSmallJoker2019-02-09
* Use true pitch/yaw/roll rotations without loss of precision by pgimeno (#8019)Paul Ouellette2019-02-07
* Fix MurmurHash implementation to really be unaligned (#7482)sfan52018-06-26
* Use server's zoom fov for distant world loading.Lars Hofhansl2018-05-15
* Zoom adjustDist(): Improve variable name (#7208)Paramat2018-04-05
* Fix last performance-type-promotion-in-math-fn problemsLoic Blot2018-04-04
* Optimize a little bit isBlockInSight, adjustDist & collisions (#7193)Loïc Blot2018-04-04
* Fix last clang-tidy reported problems for performance-type-promotion-in-math-fnLoic Blot2018-04-03
* Fix various clang-tidy reported performance-type-promotion-in-math-fnLoïc Blot2018-04-03
* Allow zoom to actually show more data.Lars Hofhansl2017-11-15
* Move files to subdirectories (#6599)Vitaliy2017-11-08
* Code modernization: subfolders (#6283)Loïc Blot2017-08-19
* Clean up numeric.h and split FacePositionCache from itShadowNinja2017-05-06
* Remove `mathconstants.h` and use the correct way to get `M_PI` in MSVC. (#5072)red-0012017-01-20
* Fix incorrect distance computation for visible blocks (#4765)Rogier-52016-11-11
* use unordered containers where possible (patch 4 on X)Loic Blot2016-10-06
* HOTFIX: fix too agressive block cullingRealBadAngel2016-02-18
* Clean up threadingShadowNinja2015-08-23
* src/util/numeric.{cpp,h}: Fix FacePositionCache data raceBřetislav Štec2015-08-02
* Clean scaling pre-filter for formspec/HUD.Aaron Suen2015-04-01
* GenElementManager: Pass opaque handles to Lua and rename to ObjDefManagerkwolekr2015-03-31
* Add support for the PCG32 PRNG algo (and associated script APIs)kwolekr2015-03-22
* Performance Improvement: Use a cache which caches result for getFacePositions.Loic Blot2015-02-16
* Fix compiling with 32bit MinGWSfan52013-11-12
* Accept hexadecimal and string values for seedskwolekr2013-11-04
* include mathconstants.h in numerics.cppVincent Heuken2013-07-07
* Fix math for isBlockInSight. Fixes #718 (client-side).Aaron Suen2013-05-18
* Migrate to STL containers/algorithms.Ilya Zhuravlev2013-03-11
* Update Copyright YearsSfan52013-02-24
* Change Minetest-c55 to MinetestPilzAdam2013-02-24
* Hopefully fix includes on mingwPerttu Ahola2012-06-17
* Initially split utility.h to multiple files in util/Perttu Ahola2012-06-17
ass="hl kwb">enum EmergeAction { EMERGE_CANCELLED, EMERGE_ERRORED, EMERGE_FROM_MEMORY, EMERGE_FROM_DISK, EMERGE_GENERATED, }; // Callback typedef void (*EmergeCompletionCallback)( v3s16 blockpos, EmergeAction action, void *param); typedef std::vector< std::pair< EmergeCompletionCallback, void * > > EmergeCallbackList; struct BlockEmergeData { u16 peer_requested; u16 flags; EmergeCallbackList callbacks; }; class EmergeManager { public: INodeDefManager *ndef; bool enable_mapgen_debug_info; // Generation Notify u32 gen_notify_on; std::set<u32> gen_notify_on_deco_ids; // Map generation parameters MapgenParams params; // Managers of various map generation-related components BiomeManager *biomemgr; OreManager *oremgr; DecorationManager *decomgr; SchematicManager *schemmgr; // Methods EmergeManager(IGameDef *gamedef); ~EmergeManager(); void loadMapgenParams(); void initMapgens(); void startThreads(); void stopThreads(); bool isRunning(); bool enqueueBlockEmerge( u16 peer_id, v3s16 blockpos, bool allow_generate, bool ignore_queue_limits=false); bool enqueueBlockEmergeEx( v3s16 blockpos, u16 peer_id, u16 flags, EmergeCompletionCallback callback, void *callback_param); v3s16 getContainingChunk(v3s16 blockpos); Mapgen *getCurrentMapgen(); // Mapgen helpers methods Biome *getBiomeAtPoint(v3s16 p); int getGroundLevelAtPoint(v2s16 p); bool isBlockUnderground(v3s16 blockpos); static MapgenFactory *getMapgenFactory(const std::string &mgname); static void getMapgenNames( std::vector<const char *> *mgnames, bool include_hidden); static v3s16 getContainingChunk(v3s16 blockpos, s16 chunksize); private: std::vector<Mapgen *> m_mapgens; std::vector<EmergeThread *> m_threads; bool m_threads_active; Mutex m_queue_mutex; std::map<v3s16, BlockEmergeData> m_blocks_enqueued; std::map<u16, u16> m_peer_queue_count; u16 m_qlimit_total; u16 m_qlimit_diskonly; u16 m_qlimit_generate; // Requires m_queue_mutex held EmergeThread *getOptimalThread(); bool pushBlockEmergeData(v3s16 pos, u16 peer_requested, u16 flags, EmergeCompletionCallback callback, void *callback_param); bool popBlockEmergeData(v3s16 pos, BlockEmergeData *bedata); friend class EmergeThread; DISABLE_CLASS_COPY(EmergeManager); }; #endif