aboutsummaryrefslogtreecommitdiff
path: root/src/map.cpp
Commit message (Collapse)AuthorAge
* Enforce limits of settings that could cause buggy behaviour (#12450)SmallJoker2022-07-09
| | | Enforces the setting value bounds that are currently only limited by the GUI (settingtypes.txt).
* Use unordered_map instead of map for MapSectorsRichard Try2022-05-23
|
* Add more Prometheus metrics (#12274)sfan52022-05-09
|
* Async environment for mods to do concurrent tasks (#11131)sfan52022-05-02
|
* Disentangle map implementations (#12148)Jude Melton-Houghton2022-04-07
| | | | Fixes violation of Liskov substitution principle Fixes #12144
* Optimize swapping nodes with equivalent lightingJude Melton-Houghton2022-03-29
|
* Raise max mapgen limit constant to align with mapblock sizesfan52022-01-30
|
* Remove a few unused functions reported by callcatcher (#11658)SmallJoker2021-10-12
|
* Add API for mods to hook liquid transformation events (#11405)Warr10242021-07-09
| | | | | | | | | Add API for mods to hook liquid transformation events Without this API, there is no reliable way for mods to be notified when liquid transform modifies nodes and mods are forced to poll for changes. This allows mods to detect changes to flowing liquid nodes and liquid renewal using event-driven logic.
* Add core.compare_block_status function (#11247)SmallJoker2021-05-30
| | | Makes it possible to check the status of the mapblock in a future-extensible way.
* Settings: Proper priority hierarchySmallJoker2021-01-29
| | | | | | | | | | | Remove old defaults system Introduce priority-based fallback list Use new functions for map_meta special functions Change groups to use end tags Unittest changes: * Adapt unittest to the new code * Compare Settings objects
* Remove dead code (#10845)rubenwardy2021-01-22
|
* Allow configuring block disk and net compression. Change default disk level.Lars2020-12-15
|
* Avoid generating the same chunk more than once with multiple emerge threads.Lars2020-11-26
|
* Remove unused functions reported by cppcheck (#10463)SmallJoker2020-10-05
| | | | | | | Run unused functions reported by cppcheck This change removes a few (but not all) unused functions. Some unused helper functions were not removed due to their complexity and potential of future use.
* Revert "Verify database connection on interval (#9665)"rubenwardy2020-07-07
| | | | | | Fixes #10113 This reverts commit 5c588f89e79e02cba392abe3d00688772321f88b.
* Fix liquids refusing to flow in X+ or Z+ in some cases (#9874)sfan52020-05-26
| | | | | Applies when a different: - falling liquid is neighboring - liquid is below
* Cache liquid alternative IDs (#8053)Vitaliy2020-05-20
|
* Add MetricsBackend with prometheus counter supportLoic Blot2020-04-29
|
* Verify database connection on interval (#9665)Loïc Blot2020-04-15
|
* Overall improvements to log messages (#9598)sfan52020-04-08
| | | | Hide some unnecessarily verbose ones behind --trace or disable them entirely. Remove duplicate ones. Improve their contents in some places.
* Remove unnecessary checks before delete (#9500)Nicolas Abril2020-03-10
| | | Co-authored-by: Nicolas Abril <nicolasabril@alunos.utfpr.edu.br>
* Fix param2 set to 240 if liquid source was renewedWuzzy2020-02-13
|
* Change some rough/inappropriate language in comments (#9061)random-geek2019-10-24
|
* Remove legacy flat-file map coderandom-geek2019-10-23
|
* Fix some reference counters (memleak) (#8981)SmallJoker2019-09-24
| | | | | Fix some reference counters (memleak) Map::dispatchEvent: Allocation safety using references
* Improve occlusion culling in corridors with additional checksfan52019-08-24
|
* Restore approximate occlusion checksfan52019-08-24
| | | | While less precise, it worked better which is what matters in the end.
* Occlusion: Check for light_propagates and do mapblock bounds checksSmallJoker2019-08-23
|
* Occlusion: Begin cleanupSmallJoker2019-08-23
|
* Fix unnecessary exception use in 3 more methods (#8791)Jozef Behran2019-08-13
| | | | | | | | | | | | | | | | | | | | | | | | * Fix unnecessary exception use in Server::SendBlocks The code in this method calls getBlockNoCreate and then messes around with try...catch to skip blocks which are not in the memory. Additionally, it repeatedly calls m_env.getMap() inside this loop. Speed the code up by extracting the m_env.getMap() out of the loop and getting rid of the try...catch. * Fix unnecessary exception use in Server::SendBlock Another unnecessary try...catch is slowing down Server::SendBlock. Remove that to speed it up and get a nice side effect of simplifying the code in question. * Fix unnecessary exception use in MMVManip::initialEmerge Remove another unneeded exception usage from MMVManip::initialEmerge to speed that code up and simplify it but be careful to not remove the braces as there is a TimeTaker in use there.
* Fix unnecessary exception use in Map::getSectorXXX (#8792)Jozef Behran2019-08-13
| | | | | | | The Map::getSectorNoGenerate throws an exception but no other code is really dependent on that. Fix the odd instance of misuse in ClientMap::emergeSector and remove the exception throwing version of the method along with the "NoEx" suffixes in the names of these methods.
* Fix unnecessary exception use in Map::isNodeUndergroundJozef Behran2019-08-13
| | | | | | | | | | The isNodeUnderground calls getBlockNoCreate which calls getBlockNoCreateNoEx and throws InvalidPositionException if the returned value is nullptr, which isNodeUnderground then catches to return "false". Remove the try..catch in isNodeUnderground by calling getBlockNoCreateNoEx instead of getBlockNoCreate and checking the returned value for nullptr.
* Merge pull request #8776 from osjc/FixGetNodeJozef Behran2019-08-10
| | | Finish getNode cleanup
* Optimize string (mis)handling (#8128)Jozef Behran2019-05-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Optimize statbar drawing The texture name of the statbar is a string passed by value. That slows down the client and creates litter in the heap as the content of the string is allocated there. Convert the offending parameter to a const reference to avoid the performance hit. * Optimize texture cache There is an unnecessary temporary created when the texture path is being generated. This slows down the cache each time a new texture is encountered and it needs to be loaded into the cache. Additionally, the heap litter created by this unnecessary temporary is particularly troublesome here as the following code then piles another string (the resulting full path of the texture) on top of it, followed by the texture itself, which both are quite long term objects as they are subsequently inserted into the cache where they can remain for quite a while (especially if the texture turns out to be a common one like dirt, grass or stone). Use std::string.append to get rid of the temporary which solves both issues (speed and heap fragmentation). * Optimize animations in client Each time an animated node is updated, an unnecessary copy of the texture name is created, littering the heap with lots of fragments. This can be specifically troublesome when looking at oceans or large lava lakes as both of these nodes are usually animated (the lava animation is pretty visible). Convert the parameter of GenericCAO::updateTextures to a const reference to get rid of the unnecessary copy. There is a comment stating "std::string copy is mandatory as mod can be a class member and there is a swap on those class members ... do NOT pass by reference", reinforcing the belief that the unnecessary copy is in fact necessary. However one of the first things the code of the method does is to assign the parameter to its class member, creating another copy. By rearranging the code a little bit this "another copy" can then be used by the subsequent code, getting rid of the need to pass the parameter by value and thus saving that copying effort. * Optimize chat console history handling The GUIChatConsole::replaceAndAddToHistory was getting the line to work on by value which turns out to be unnecessary. Get rid of that unnecessary copy by converting the parameter to a const reference. * Optimize gui texture setting The code used to set the texture for GUI components was getting the name of the texture by value, creating unnecessary performance bottleneck for mods/games with heavily textured GUIs. Get rid of the bottleneck by passing the texture name as a const reference. * Optimize sound playing code in GUIEngine The GUIEngine's code receives the specification of the sound to be played by value, which turns out to be most likely a mistake as the underlying sound manager interface receives the same thing by reference. Convert the offending parameter to a const reference to get rid of the rather bulky copying effort and the associated performance hit. * Silence CLANG TIDY warnings for unit tests Change "std::string" to "const std::string &" to avoid an unnecessary local value copy, silencing the CLANG TIDY process. * Optimize formspec handling The "formspec prepend" parameter was passed to the formspec handling code by value, creating unnecessary copy of std::string and slowing down the game if mods add things like textured backgrounds for the player inventory and/or other forms. Get rid of that performance bottleneck by converting the parameter to a const reference. * Optimize hotbar image handling The code that sets the background images for the hotbar is getting the name of the image by value, creating an unnecessary std::string copying effort. Fix that by converting the relevant parameters to const references. * Optimize inventory deserialization The inventory manager deserialization code gets the serialized version of the inventory by value, slowing the server and the client down when there are inventory updates. This can get particularly troublesome with pipeworks which adds nodes that can mess around with inventories automatically or with mods that have mobs with inventories that actively use them. * Optimize texture scaling cache There is an io::path parameter passed by value in the procedure used to add images converted from textures, leading to slowdown when the image is not yet created and the conversion is thus needed. The performance hit is quite significant as io::path is similar to std::string so convert the parameter to a const reference to get rid of it. * Optimize translation file loader Use "std::string::append" when calculating the final index for the translation table to avoid unnecessary temporary strings. This speeds the translation file loader up significantly as std::string uses heap allocation which tends to be rather slow. Additionally, the heap is no longer being littered by these unnecessary string temporaries, increasing performance of code that gets executed after the translation file loader finishes. * Optimize server map saving When the directory structure for the world data is created during server map saving, an unnecessary value passing of the directory name slows things down. Remove that overhead by converting the offending parameter to a const reference.
* Allow an optional readonly base database (#7544)lhofhansl2018-07-25
| | | | | | * Allow an optional readonly base database * Added basic documentation
* Add a MSVC / Windows compatible snprintf function (#7353)nOOb31672018-07-22
| | | Use sizeof where applicable for mt_snprintf
* Variable name fix + structure creation unrolling in lighting codeLoic Blot2018-03-09
|
* SAO limits: Allow SAOs to exist outside the set 'mapgen limit'paramat2018-02-26
|
* map.cpp: Initialize NodeNeighbor, set NeighborType to u8 & cleanupLoic Blot2018-02-11
| | | | | | | Cleanup: * Drop unused Map::transforming_liquid_size() * NodeNeighbor must use const ref for v3s16 * Add a missing default in a switch case
* Move files to subdirectories (#6599)Vitaliy2017-11-08
| | | | * Move files around
* Fix blocks written by vmanip not being marked as modifiedsfan52017-09-23
| | | | | This bug can be triggered by e.g. calling minetest.place_schematic() and stopping the server immediately afterwards.
* Remove DSTACK support (#6346)Loïc Blot2017-08-30
| | | Debugstacks is not useful, we don't really use it, the DebugStack is not pertinent, gdb and lldb are better if we really want to debug.
* Modernize code: very last fixes (#6290)Loïc Blot2017-08-20
| | | Last modernization fixes
* 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
* Code modernization: src/m* (part 3)Loic Blot2017-08-19
| | | | | | | | * empty function * default constructor/destructor * for range-based loops * use emplace_back instead of push_back * remove some unused headers in some cpp variable
* Code modernization: src/m* (part 2)Loic Blot2017-08-19
| | | | | | | | | * empty function * default constructor/destructor * remove unused Map::emergeSector(a,b) * for range-based loops * migrate a dirs[7] table to direction tables * remove various old unused function
* 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
* Remove unused Map::getDayNightDiff + fix one undefined variable in mapblock.cppLoic Blot2017-07-26
|
* 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