aboutsummaryrefslogtreecommitdiff
path: root/src/mapblock.h
AgeCommit message (Collapse)Author
2023-01-06Occlusion culling algorithm based on recursive descend (#13104)x2048
Co-authored-by: DS <vorunbekannt75@web.de>
2022-11-03Reduce exposure of various internals (#12885)Loïc Blot
* refactoring(StaticObjectList): don't expose m_active and m_stored anymore This prevents our old crap code where anyone can access to StaticObjectList. use proper modifiers. It also permits to do a short cleanup on MapBlock using a helper * refactoring(MapBlock): reduce a bit exposed m_active_blocks variable * refactoring: MapBlock::m_node_timers is now private We already had various helpers to perform this privatization, just use it. Also factorize the MapBlock stepping code for timers using already existing code and importing them from ServerEnvironment to MapBlock. It's currently done pretty straight forward without any inheritance as MapBlock is just used everywhere, maybe in a future we'll have ServerMapBlock over MapBlock. Currently for a simple function let's just use proper objects and add a comment warning * refactoring(Server): fix duplicated function for add/remove node * refactoring(guiFormSpecMenu): add removeAll function to prevent duplicated code * refactoring(ShadowRenderer) + perf: code quality + increase performance * All callers are already using the point and we should never test a function with nullptr node, it's a bug. Removed workaround which was hacky and fix the bug * Drop clientmap lookup from shadowrendered, just use directly its pointer and forbid to push it in the generic list * Reduce memory pressure on the renderShadowObject by preventing deallocating and reallocating multiple vectors on each node * refactoring(MapBlock): reduce exposure of MapBlock::m_static_objects It's not complete as some parts of the code are pretty nested, but it's better than before :) * fix: better working on new functions & drop unwanted 2 lines Co-authored-by: Jude Melton-Houghton <jwmhjwmh@gmail.com> Co-authored-by: Jude Melton-Houghton <jwmhjwmh@gmail.com>
2022-10-09Embed data directly in mapblocksJude Melton-Houghton
2022-10-09Remove unused MapBlock functionalityJude 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-08-31Switch MapBlock compression to zstd (#10788)lhofhansl
* Add zstd support. * Rearrange serialization order * Compress entire mapblock Co-authored-by: sfan5 <sfan5@live.de>
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-01-22Remove dead code (#10845)rubenwardy
2020-12-15Allow configuring block disk and net compression. Change default disk level.Lars
2018-07-21Optimize ABM checks.Lars Hofhansl
See #7555 Cache (up to 64) node types for each active block. Check this cache first to see whether any ABM needs to be triggered for a block.
2018-02-04Remove unused light updating codeDániel Juhász
Also remove the unit test that tests the removed algorithms.
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-19Code modernization: src/m* (part 2)Loic Blot
* 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
2017-08-18Optimize headers (part 2) (#6272)Loïc Blot
* Optimize headers (part 2) * less debug.h in headers * less remoteplayer.h for everybody * Cleanup (part 2) * camera.h: mesh.h * mapgen.h: mapnode.h * serverenvironment.h: mapblock.h * nodedef.h: shader.h
2017-08-17C++ modernize: Pragma once (#6264)Loïc Blot
* Migrate cpp headers to pragma once
2017-06-17Cpp11 initializers 2 (#5999)Loïc Blot
* 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
2017-04-17MeshUpdateQueue: Add a MapBlock cache that minimizes the amount of MapBlock ↵Perttu Ahola
copying done in the main thread Cache size is configurable by the meshgen_block_cache_size (default 20 MB). New profiler stats: - MeshUpdateQueue MapBlock cache hit % - MeshUpdateQueue MapBlock cache size kB Removes one type of stutter that was seen on the client when received MapBlocks were being handled. (the "MeshMakeData::fill" stutter) Kind of related to at least #5239 Originally preceded by these commits, now includes them: - Move the mesh generator thread into src/mesh_generator_thread.{cpp,h} - mesh_generator_thread.cpp: Update code style - MeshUpdateThread: Modify interface to house a different implementation: Actual functionality will be changed by next commits. - MeshMakeData: Add fillBlockData() interface (so that caller can fill in stuff from eg. a MapBlock cache)
2017-04-13Add documentation for map block format 27 (#5576)Dániel Juhász
2017-03-27Map generation limit: Make per-worldparamat
The setting limits map generation but affects nothing else. Add 'mapgen_limit' to global mapgen parameters. Move 'blockpos_over_mapgen_limit()' to the only place it is called from: map.cpp. Allow teleportation to any part of the world even if over the set mapgen limit. Simplify the reading of this limit in mgvalleys. Remove the 'map_generation_limit' setting.
2017-03-20Map generation limit: Rewriteparamat
The previous implementation applied the setting to blockpos_over_limit(), objectpos_over_limit() and in createSector(), causing many bugs near the world edge. First revert the previous implementation. Rename blockpos_over_limit() to blockpos_over_max_limit() for clarity. Add a new function to mapblock.h called blockpos_over_mapgen_limit() that checks against the map_generation_limit setting, and call this only from the code that decides where mapgen stops. Use MAX_MAP_GENERATION_LIMIT in objectpos_over_limit() to reduce the chance of bugs, there is no need to use map_generation_limit here.
2017-03-19Update server min protocol version to v24 (#5411)Loïc Blot
* Update server min protocol version to v24 It's based on @sfan5 stats. See https://kitsunemimi.pw/tmp/serverlist_stats_2017-03-17.txt v24 was bumped 25/08/14 and 0.4.11 was released 25/12/14 * Drop protocol v23 and lesser code
2017-02-16Objectpos over limit: Avoid crash caused by sector over limitparamat
Reduce the object limit by mapblock size, to avoid objects being added just inside the map generation limit but in a block and sector that extend beyond the map generation limit. Change notification of 'objectpos over limit' from red in-chat ERROR to in-terminal only WARNING, since this will happen often using mob mods near the world's edge.
2017-02-13Lighting: Update lighting at block loadingDániel Juhász
This commit updates mapblocks' light if necessary when they are loaded. This removes ghost lighting.
2017-01-08Map generation limit: Cache as 'const' not 'const static'paramat
2017-01-08Map generation limit: Fix checks for block/sector over-limitparamat
Fix the maths that check if any part of a mapblock or sector is over the set map_generation_limit. Therefore avoid the loading of any over-limit blocks that were previously generated when map_generation_limit was larger. The set limit can vary for a world because it is not yet a per-world mapgen parameter, even when it is sometimes it will be changed deliberately. Therefore avoid a player being returned to world centre if they re-enter a world while being over-limit. Fix the createSector() crash caused by a mob spawning over-limit in an over-limit mapblock
2017-01-04Fixes for using std:vector in ABMHander and further perf improvementsLars Hofhansl
2016-06-11Make node timers more efficientEkdohibs
2015-09-16Fix object position border checkingest31
Borders have to be converted into BS format in order to be accurately comparable to object positions.
2015-09-15Disallow placing entities outside safe boundariesest31
Entity positions are serialized as F1000. Disallow placing entities outside safe borders with the minetest.add_entity call. Note that this patch only enforces those boundaries for placing entities, moving entities that move outside boundaries aren't affected. Thanks to @nanepiwo for pointing this out.
2015-09-14Serialisation: documentation fixes, clarifying renames and whitespace fixesest31
1. Do two renames: * SER_FMT_CLIENT_VER_LOWEST -> SER_FMT_VER_LOWEST_WRITE * SER_FMT_VER_LOWEST -> SER_FMT_VER_LOWEST_READ Now the two define values are consistently named with the _WRITE defines SER_FMT_VER_{HIGHEST,LOWEST}_WRITE, and to better point out what the two serialisation versions actually are for. 2. wrap some lines in doc/worldformat.txt, and point out that the node timers are serialized at a later point, as this can cause confusion about what now happens (if one doesn't strictly read the if block's conditions). 3. some whitespace fixes in NodeTimerList::serialize, and one new comment.
2015-08-02Add map limit config optionrubenwardy
2015-07-29Precalculate mapblock relative size. This permit to remove many s16 calculs ↵nerzhul
on runtime
2015-05-31Mapblock: nodecount refactorest31
Spare direct multoplication, use constant MapBlock::nodecount instead of local nodecount variables. Also use strides at one place instead of multiplications.
2015-05-17Record MapBlock modification reasons as flags instead of stringskwolekr
This improves performance of MapBlock::raiseModified by a factor of 6. Also, clean up mapblock.h a bit and inline small functions.
2015-03-07For usages of assert() that are meant to persist in Release builds (when ↵Craig Robbins
NDEBUG is defined), replace those usages with persistent alternatives
2015-02-17Replace std::list by std::vector into ClientMap::updateDrawList, ↵Loic Blot
Map::timerUpdate and ServerMap::save(). This will speedup the loop reading into those functions
2015-01-27Fix a crash (assert) when client set serial version < 24 in INITLoic Blot
When SER_FMT_VER_LOWEST is set to zero, then the test is stupid in INIT because all client works. In mapblock we check if client's serialization version is < 24, but if client sent serialization version < 24 (15 for example) the server set it and tried to send nodes, then BOOM To resolve the problem: * Create a different CLIENT_MIN_VERSION to handle this problem * Remove the exception * Use an assert in case of bad developer code
2015-01-18Water fixesgregorycu
Change must_reflow to a deque Add overload for MapBlock::raiseModified that takes a const char*. This is a speed improvement. Comment out unused variable Optimisations to block offset calculations
2014-12-12Fix typo in mapblock.hCraig Robbins
2014-11-14Remove most exceptions from getNode() (and variants)Craig Robbins
2014-04-18Remove liquid_finite and weatherproller
2013-11-17Actually fix weatherkwolekr
The real problem was that MapBlocks were not activated before getting sent to the client
2013-09-16Weather: Clean up getHeat/getHumidity somewhatkwolekr
2013-08-14Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenuKahrl
2013-08-02Weather backward compatibilityproller
2013-07-27Weather supportproller
2013-03-11Migrate to STL containers/algorithms.Ilya Zhuravlev
2013-02-24Update Copyright YearsSfan5