aboutsummaryrefslogtreecommitdiff
path: root/src/map.cpp
AgeCommit message (Collapse)Author
2022-06-02Merge branch 'master' of https://github.com/minetest/minetestElias Fleckenstein
2022-05-23Use unordered_map instead of map for MapSectorsRichard Try
2022-05-17Merge branch 'master' of https://github.com/minetest/minetestElias Fleckenstein
2022-05-09Add more Prometheus metrics (#12274)sfan5
2022-05-02Async environment for mods to do concurrent tasks (#11131)sfan5
2022-04-07Disentangle map implementations (#12148)Jude Melton-Houghton
Fixes violation of Liskov substitution principle Fixes #12144
2022-03-29Optimize swapping nodes with equivalent lightingJude Melton-Houghton
2022-01-30Raise max mapgen limit constant to align with mapblock sizesfan5
2021-10-12Remove a few unused functions reported by callcatcher (#11658)SmallJoker
2021-09-19Merge branch 'master' of https://github.com/minetest/minetestElias Fleckenstein
2021-07-09Add API for mods to hook liquid transformation events (#11405)Warr1024
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.
2021-05-30Add core.compare_block_status function (#11247)SmallJoker
Makes it possible to check the status of the mapblock in a future-extensible way.
2021-02-10Merge branch 'master' of https://github.com/minetest/minetestElias Fleckenstein
2021-01-29Settings: Proper priority hierarchySmallJoker
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
2021-01-22Remove dead code (#10845)rubenwardy
2021-01-07Merge branch 'master' of https://github.com/minetest/minetestElias Fleckenstein
2020-12-15Allow configuring block disk and net compression. Change default disk level.Lars
2020-11-28Merged MinetestElias Fleckenstein
2020-11-26Avoid generating the same chunk more than once with multiple emerge threads.Lars
2020-11-04Revert "Make Lint Happy"Elias Fleckenstein
This reverts commit ad148587dcf5244c2d2011dba339786c765c54c4.
2020-11-04Make Lint HappyElias Fleckenstein
2020-10-05Remove unused functions reported by cppcheck (#10463)SmallJoker
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.
2020-07-07Revert "Verify database connection on interval (#9665)"rubenwardy
Fixes #10113 This reverts commit 5c588f89e79e02cba392abe3d00688772321f88b.
2020-05-26Fix liquids refusing to flow in X+ or Z+ in some cases (#9874)sfan5
Applies when a different: - falling liquid is neighboring - liquid is below
2020-05-20Cache liquid alternative IDs (#8053)Vitaliy
2020-04-29Add MetricsBackend with prometheus counter supportLoic Blot
2020-04-15Verify database connection on interval (#9665)Loïc Blot
2020-04-08Overall improvements to log messages (#9598)sfan5
Hide some unnecessarily verbose ones behind --trace or disable them entirely. Remove duplicate ones. Improve their contents in some places.
2020-03-10Remove unnecessary checks before delete (#9500)Nicolas Abril
Co-authored-by: Nicolas Abril <nicolasabril@alunos.utfpr.edu.br>
2020-02-13Fix param2 set to 240 if liquid source was renewedWuzzy
2019-10-24Change some rough/inappropriate language in comments (#9061)random-geek
2019-10-23Remove legacy flat-file map coderandom-geek
2019-09-24Fix some reference counters (memleak) (#8981)SmallJoker
Fix some reference counters (memleak) Map::dispatchEvent: Allocation safety using references
2019-08-24Improve occlusion culling in corridors with additional checksfan5
2019-08-24Restore approximate occlusion checksfan5
While less precise, it worked better which is what matters in the end.
2019-08-23Occlusion: Check for light_propagates and do mapblock bounds checksSmallJoker
2019-08-23Occlusion: Begin cleanupSmallJoker
2019-08-13Fix unnecessary exception use in 3 more methods (#8791)Jozef Behran
* 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.
2019-08-13Fix unnecessary exception use in Map::getSectorXXX (#8792)Jozef Behran
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.
2019-08-13Fix unnecessary exception use in Map::isNodeUndergroundJozef Behran
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.
2019-08-10Merge pull request #8776 from osjc/FixGetNodeJozef Behran
Finish getNode cleanup
2019-05-18Optimize string (mis)handling (#8128)Jozef Behran
* 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.
2018-07-25Allow an optional readonly base database (#7544)lhofhansl
* Allow an optional readonly base database * Added basic documentation
2018-07-22Add a MSVC / Windows compatible snprintf function (#7353)nOOb3167
Use sizeof where applicable for mt_snprintf
2018-03-09Variable name fix + structure creation unrolling in lighting codeLoic Blot
2018-02-26SAO limits: Allow SAOs to exist outside the set 'mapgen limit'paramat
2018-02-11map.cpp: Initialize NodeNeighbor, set NeighborType to u8 & cleanupLoic Blot
Cleanup: * Drop unused Map::transforming_liquid_size() * NodeNeighbor must use const ref for v3s16 * Add a missing default in a switch case
2017-11-08Move files to subdirectories (#6599)Vitaliy
* Move files around
2017-09-23Fix blocks written by vmanip not being marked as modifiedsfan5
This bug can be triggered by e.g. calling minetest.place_schematic() and stopping the server immediately afterwards.
2017-08-30Remove DSTACK support (#6346)Loïc Blot
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.