minetest/src
Loïc Blot 322c8cf270
Reduce exposure of various internals (#12885)
* 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-11-03 17:35:31 +01:00
..
benchmark Add lighting test and benchmark (#12802) 2022-09-26 06:49:08 -04:00
client Reduce exposure of various internals (#12885) 2022-11-03 17:35:31 +01:00
content Safety check the map's blocksize (#12895) 2022-10-27 19:31:42 -07:00
database Avoid duplication of mod metadata in memory (#12562) 2022-09-26 17:03:43 -04:00
gui Reduce exposure of various internals (#12885) 2022-11-03 17:35:31 +01:00
irrlicht_changes Update my name 2022-06-16 21:38:32 +02:00
mapgen Optimize lighting calculation (#12797) 2022-10-09 10:50:26 -04:00
network Code optimizations / refactor (#12704) 2022-09-06 11:21:09 +01:00
script Allow rotating entity selectionboxes (#12379) 2022-10-30 16:53:14 +01:00
server Allow rotating entity selectionboxes (#12379) 2022-10-30 16:53:14 +01:00
threading Fix synchronization issue at thread start 2022-05-02 20:54:55 +02:00
unittest Speed up find_nodes_in_area (#12845) 2022-10-13 09:35:19 -04:00
util Allow rotating entity selectionboxes (#12379) 2022-10-30 16:53:14 +01:00
activeobject.h Removed some obsolete code (#10562) 2021-01-21 18:17:09 +00:00
activeobjectmgr.h Add nametag background setting and object property (#10937) 2021-02-17 19:51:28 +00:00
ban.cpp Add unittests on ActiveObject and BanManager class (#6866) 2018-01-01 18:48:52 +01:00
ban.h C++ modernize: Pragma once (#6264) 2017-08-17 22:19:39 +02:00
chat_interface.h C++ modernize: Pragma once (#6264) 2017-08-17 22:19:39 +02:00
chat.cpp Chat weblink: remove comma as delimiter (#12730) 2022-09-10 12:21:15 +02:00
chat.h Remove a few unused functions reported by callcatcher (#11658) 2021-10-12 20:12:20 +02:00
chatmessage.h Travis: Update clang from 4.0 to 5.0 (#6467) 2017-10-09 11:32:06 +02:00
clientiface.cpp Remove unused MapBlock functionality 2022-10-09 13:43:48 -04:00
clientiface.h Fix password changing getting stuck if wrong password is entered once 2022-04-28 19:55:36 +02:00
cmake_config_githash.h.in C++ modernize: Pragma once (#6264) 2017-08-17 22:19:39 +02:00
cmake_config.h.in Run Minetest update checker on startup (#7629) 2022-08-02 21:34:17 +02:00
CMakeLists.txt Check sizeof(int) and sizeof(size_t) 2022-10-23 21:59:12 +02:00
collision.cpp Avert collision static detection rounding error (#12822) 2022-09-30 06:31:24 -04:00
collision.h Expose collided objects in moveresult 2020-05-06 14:03:52 +02:00
config.h Run Minetest update checker on startup (#7629) 2022-08-02 21:34:17 +02:00
constants.h Raise max mapgen limit constant to align with mapblock size 2022-01-30 13:49:26 +01:00
content_mapnode.cpp Modernize src/c* src/d* and src/e* files (#6263) 2017-08-17 23:02:50 +02:00
content_mapnode.h C++ modernize: Pragma once (#6264) 2017-08-17 22:19:39 +02:00
content_nodemeta.cpp (se)SerializeString: Include max length in the name 2020-10-01 09:52:59 +02:00
content_nodemeta.h C++ modernize: Pragma once (#6264) 2017-08-17 22:19:39 +02:00
convert_json.cpp Sort out cURL timeouts and increase default 2021-04-02 00:19:39 +02:00
convert_json.h Sort out cURL timeouts and increase default 2021-04-02 00:19:39 +02:00
craftdef.cpp Fix inconsistent craft replacements (#9250) (#12819) 2022-09-30 06:30:39 -04:00
craftdef.h Clean up craft replacements docs 2019-12-07 23:46:24 +01:00
daynightratio.h Make natural night light as bright as MT 0.4.16 (#9053) 2019-10-18 21:54:44 +01:00
debug.cpp Fix some misspellings (#8104) 2019-01-16 13:39:13 +01:00
debug.h Remove DSTACK support (#6346) 2017-08-30 08:09:41 +02:00
defaultsettings.cpp Improve bloom effect (#12916) 2022-11-02 09:09:48 +01:00
defaultsettings.h Settings: Proper priority hierarchy 2021-01-29 17:32:35 +01:00
dummygamedef.h Avoid duplication of mod metadata in memory (#12562) 2022-09-26 17:03:43 -04:00
dummymap.h Add lighting test and benchmark (#12802) 2022-09-26 06:49:08 -04:00
emerge.cpp Remove unused MapBlock functionality 2022-10-09 13:43:48 -04:00
emerge.h Add more Prometheus metrics (#12274) 2022-05-09 21:20:58 +02:00
environment.cpp Reduce exposure of various internals (#12885) 2022-11-03 17:35:31 +01:00
environment.h Allow the ABM time budget to be configurable. 2020-08-18 16:04:32 -07:00
exceptions.h Remove dead code (#10845) 2021-01-22 15:09:26 +00:00
face_position_cache.cpp Modernize various files 2017-08-18 07:44:52 +02:00
face_position_cache.h C++ modernize: Pragma once (#6264) 2017-08-17 22:19:39 +02:00
filesys.cpp Code optimizations / refactor (#12704) 2022-09-06 11:21:09 +01:00
filesys.h Refactor ModConfiguration 2022-07-14 22:12:54 +01:00
gamedef.h Avoid duplication of mod metadata in memory (#12562) 2022-09-26 17:03:43 -04:00
gameparams.h Add register dialog to separate login/register (#12185) 2022-06-05 17:47:38 +02:00
gettext.cpp Gettext support on Android (#11435) 2021-08-08 18:59:07 +02:00
gettext.h Fix various code & correctness issues (#11815) 2021-12-05 14:40:30 +01:00
gettime.h Refactor local time getter functions (#12221) 2022-04-28 18:53:33 +02:00
httpfetch.cpp Print announce error response (#11878) 2022-01-01 22:44:56 +01:00
httpfetch.h Print announce error response (#11878) 2022-01-01 22:44:56 +01:00
hud.cpp Readd basic_debug as a HUD flag (#12020) 2022-03-05 22:16:17 +01:00
hud.h Readd basic_debug as a HUD flag (#12020) 2022-03-05 22:16:17 +01:00
inventory.cpp Clean up Game::handleDigging() and some related parts 2022-09-30 14:02:14 +02:00
inventory.h Clean up Game::handleDigging() and some related parts 2022-09-30 14:02:14 +02:00
inventorymanager.cpp Fix error msg if craft replacement w/ full inv (#12820) 2022-09-29 20:34:51 +02:00
inventorymanager.h Fix inventory swapping not calling all callbacks (#9923) 2020-09-04 20:49:07 +02:00
irr_aabb3d.h Revert 6587 - Optimize entity-entity collision (#7539) 2018-07-08 21:30:55 +01:00
irr_ptr.h Improve irr_ptr (#10808) 2021-01-24 14:40:34 +00:00
irr_v2d.h C++ modernize: Pragma once (#6264) 2017-08-17 22:19:39 +02:00
irr_v3d.h Revert 6587 - Optimize entity-entity collision (#7539) 2018-07-08 21:30:55 +01:00
irrlichttypes_bloated.h C++ modernize: Pragma once (#6264) 2017-08-17 22:19:39 +02:00
irrlichttypes_extrabloated.h Use true pitch/yaw/roll rotations without loss of precision by pgimeno (#8019) 2019-02-07 21:26:06 +00:00
irrlichttypes.h Irrlicht support code maintenance 2021-03-31 13:15:47 +02:00
itemdef.cpp Implement tool use sounds 2022-09-30 14:02:14 +02:00
itemdef.h Implement tool use sounds 2022-09-30 14:02:14 +02:00
itemgroup.h C++ modernize: Pragma once (#6264) 2017-08-17 22:19:39 +02:00
itemstackmetadata.cpp Avoid duplication of mod metadata in memory (#12562) 2022-09-26 17:03:43 -04:00
itemstackmetadata.h Avoid duplication of mod metadata in memory (#12562) 2022-09-26 17:03:43 -04:00
light.cpp Fix light overflow of u8 if light is saturated at 255 (#10305) 2020-08-23 15:39:55 +02:00
light.h Light curve: Simplify and improve code, fix darkened daytime sky (#7693) 2018-09-16 17:59:42 +01:00
lighting.h Add API to control shadow intensity from the game/mod (#11944) 2022-03-26 16:58:26 +01:00
log.cpp Add missing concurrency protection in logger (#12325) 2022-05-23 22:50:25 +02:00
log.h Add missing concurrency protection in logger (#12325) 2022-05-23 22:50:25 +02:00
main.cpp Remove unused MapBlock functionality 2022-10-09 13:43:48 -04:00
map_settings_manager.cpp Mainmenu game-related changes (#11887) 2022-01-09 21:15:35 +01:00
map_settings_manager.h Rework Settings to support arbitrary hierarchies (#11352) 2021-06-23 15:22:31 +02:00
map.cpp Reduce exposure of various internals (#12885) 2022-11-03 17:35:31 +01:00
map.h Speed up find_nodes_in_area (#12845) 2022-10-13 09:35:19 -04:00
mapblock.cpp Reduce exposure of various internals (#12885) 2022-11-03 17:35:31 +01:00
mapblock.h Reduce exposure of various internals (#12885) 2022-11-03 17:35:31 +01:00
mapnode.cpp Optimize lighting calculation (#12797) 2022-10-09 10:50:26 -04:00
mapnode.h Embed data directly in mapblocks 2022-10-09 13:43:48 -04:00
mapsector.cpp ServerMap saving: cleanups (#6274) 2017-08-19 11:29:46 +02:00
mapsector.h Minor clientmap improvements. 2020-10-19 09:31:09 -07:00
metadata.cpp Avoid duplication of mod metadata in memory (#12562) 2022-09-26 17:03:43 -04:00
metadata.h Avoid duplication of mod metadata in memory (#12562) 2022-09-26 17:03:43 -04:00
modchannels.cpp Move the codebase to C++14 2022-02-26 14:39:41 +01:00
modchannels.h Add session_t typedef + remove unused functions (#6470) 2017-09-27 19:47:36 +02:00
modifiedstate.h C++ modernize: Pragma once (#6264) 2017-08-17 22:19:39 +02:00
mtevent.h Darwin platform build fix (#10376) 2020-09-09 19:12:03 +02:00
nameidmapping.cpp (se)SerializeString: Include max length in the name 2020-10-01 09:52:59 +02:00
nameidmapping.h C++ modernize: Pragma once (#6264) 2017-08-17 22:19:39 +02:00
nodedef.cpp Check for falling float nodes in liquid transform (#12862) 2022-10-18 18:03:05 -04:00
nodedef.h Check for falling float nodes in liquid transform (#12862) 2022-10-18 18:03:05 -04:00
nodemetadata.cpp Avoid duplication of mod metadata in memory (#12562) 2022-09-26 17:03:43 -04:00
nodemetadata.h Avoid duplication of mod metadata in memory (#12562) 2022-09-26 17:03:43 -04:00
nodetimer.cpp Code modernization: src/n*, src/o* (#6280) 2017-08-19 11:30:46 +02:00
nodetimer.h Code optimizations / refactor (#12704) 2022-09-06 11:21:09 +01:00
noise.cpp Inline triLinearInterpolationNoEase and triLinearInterpolation (#12421) 2022-06-11 20:01:30 +02:00
noise.h Remove a few unused functions reported by callcatcher (#11658) 2021-10-12 20:12:20 +02:00
objdef.cpp Allow ObjDefManager instances to be cloned 2020-05-05 19:26:59 +02:00
objdef.h Fix remaining issues with mapgen scriptapi 2020-05-05 19:26:59 +02:00
object_properties.cpp Allow rotating entity selectionboxes (#12379) 2022-10-30 16:53:14 +01:00
object_properties.h Allow rotating entity selectionboxes (#12379) 2022-10-30 16:53:14 +01:00
particles.cpp Allow looped animation to be used safely with old clients 2022-09-10 12:21:29 +02:00
particles.h Explicitly initialize value of particle parameter. Fixes #12621. 2022-08-02 23:51:50 +02:00
pathfinder.cpp Reserve vectors before pushing and other code quality changes (#11161) 2021-04-05 13:38:31 +02:00
pathfinder.h Reduce ServerEnvironment propagation (#9642) 2020-04-11 19:59:43 +02:00
player.cpp Readd basic_debug as a HUD flag (#12020) 2022-03-05 22:16:17 +01:00
player.h Physics overrides: Move values to a common struct (#12591) 2022-08-12 10:17:02 +01:00
porting_android.cpp Android: Add support for sharing debug.txt (#12370) 2022-06-05 17:42:09 +01:00
porting_android.h Android: Add support for sharing debug.txt (#12370) 2022-06-05 17:42:09 +01:00
porting.cpp Add support for MINETEST_USERDATA environment variable (#12639) 2022-09-16 13:19:44 +02:00
porting.h Slap u64 on everything time-y (#10984) 2021-02-24 12:05:17 +01:00
profiler.cpp Minor profiler fixes. 2020-12-23 14:48:08 -08:00
profiler.h Better F6 profiler (#8750) 2019-08-13 19:56:55 +02:00
raycast.cpp Allow rotating entity selectionboxes (#12379) 2022-10-30 16:53:14 +01:00
raycast.h Allow rotating entity selectionboxes (#12379) 2022-10-30 16:53:14 +01:00
reflowscan.cpp Remove unused MapBlock functionality 2022-10-09 13:43:48 -04:00
reflowscan.h Node definition manager refactor (#7016) 2018-02-10 21:04:16 +01:00
remoteplayer.cpp Fix consistency of sky sun/moon texture behaviour 2022-01-22 11:18:34 -05:00
remoteplayer.h Add API to control shadow intensity from the game/mod (#11944) 2022-03-26 16:58:26 +01:00
rollback_interface.cpp Fix some reference counters (memleak) (#8981) 2019-09-24 19:05:28 +02:00
rollback_interface.h Code modernization: src/p*, src/q*, src/r*, src/s* (partial) (#6282) 2017-08-19 14:25:35 +02:00
rollback.cpp Fix possible unreliable behavior due to uninitialized variables 2022-05-10 22:36:25 +02:00
rollback.h Remove a few unused functions reported by callcatcher (#11658) 2021-10-12 20:12:20 +02:00
serialization.cpp Fix zlib (de)compressor memory leaks 2022-06-16 23:53:23 +02:00
serialization.h Switch MapBlock compression to zstd (#10788) 2021-08-31 17:32:31 -07:00
server.cpp Reduce exposure of various internals (#12885) 2022-11-03 17:35:31 +01:00
server.h Reduce exposure of various internals (#12885) 2022-11-03 17:35:31 +01:00
serverenvironment.cpp Reduce exposure of various internals (#12885) 2022-11-03 17:35:31 +01:00
serverenvironment.h Add unittests for item movement code (#11885) 2022-09-27 16:22:11 -04:00
serverlist.cpp Print announce error response (#11878) 2022-01-01 22:44:56 +01:00
serverlist.h Use JSON for favorites, move server list code to Lua (#10085) 2021-01-22 15:08:57 +00:00
settings_translation_file.cpp Update minetest.conf.example 2022-07-20 21:36:03 +02:00
settings.cpp Enforce limits of settings that could cause buggy behaviour (#12450) 2022-07-09 22:32:08 +02:00
settings.h Enforce limits of settings that could cause buggy behaviour (#12450) 2022-07-09 22:32:08 +02:00
skyparams.h Allow to set maximum star opacity at daytime (#11663) 2022-07-02 19:57:48 +01:00
sound.h Sounds: Various little improvements (#12486) 2022-07-09 22:32:24 +02:00
staticobject.cpp Reduce exposure of various internals (#12885) 2022-11-03 17:35:31 +01:00
staticobject.h Reduce exposure of various internals (#12885) 2022-11-03 17:35:31 +01:00
terminal_chat_console.cpp Fix compiler warnings 2022-04-08 14:55:21 +01:00
terminal_chat_console.h C++ modernize: Pragma once (#6264) 2017-08-17 22:19:39 +02:00
texture_override.cpp Textures: introduce world-align overrides (#12540) 2022-08-13 08:52:16 +02:00
texture_override.h Textures: introduce world-align overrides (#12540) 2022-08-13 08:52:16 +02:00
tileanimation.cpp Allow looped animation to be used safely with old clients 2022-09-10 12:21:29 +02:00
tileanimation.h Allow looped animation to be used safely with old clients 2022-09-10 12:21:29 +02:00
tool.cpp Code optimizations / refactor (#12704) 2022-09-06 11:21:09 +01:00
tool.h Add helper functions to make tool usable n times (#12047) 2022-06-03 21:47:04 +02:00
translation.cpp Update my name 2022-06-16 21:38:32 +02:00
translation.h Update my name 2022-06-16 21:38:32 +02:00
version.cpp Fully remove bitmap font support (#11863) 2022-01-08 14:53:25 +01:00
version.h C++ modernize: Pragma once (#6264) 2017-08-17 22:19:39 +02:00
voxel.cpp Optimize lighting calculation (#12797) 2022-10-09 10:50:26 -04:00
voxel.h VoxelArea: add_{x,y,z,p} must be static 2018-03-09 23:27:26 +01:00
voxelalgorithms.cpp Remove unused MapBlock functionality 2022-10-09 13:43:48 -04:00
voxelalgorithms.h Add lighting test and benchmark (#12802) 2022-09-26 06:49:08 -04:00