1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-14 00:55:20 +02:00

Implement get_node with a get_node_raw (#14384)

Add /bench_bulk_get_node
Considerably improves the execution speed of core.get_node
This commit is contained in:
DS
2024-03-03 15:53:23 +01:00
committed by GitHub
parent 879f7e9f03
commit d4d4712361
4 changed files with 90 additions and 49 deletions

View File

@@ -74,13 +74,10 @@ private:
// pos = {x=num, y=num, z=num}
static int l_swap_node(lua_State *L);
// get_node(pos)
// pos = {x=num, y=num, z=num}
static int l_get_node(lua_State *L);
// get_node_or_nil(pos)
// pos = {x=num, y=num, z=num}
static int l_get_node_or_nil(lua_State *L);
// get_node_raw(x, y, z) -> content, param1, param2, pos_ok
// Used to implement get_node and get_node_or_nil in lua.
// This is still faster than doing it from C++ even with optimized pushnode.
static int l_get_node_raw(lua_State *L);
// get_node_light(pos, timeofday)
// pos = {x=num, y=num, z=num}
@@ -245,7 +242,7 @@ public:
/*
* Duplicates of certain env APIs that operate not on the global
* map but on a VoxelManipulator. This is for emerge scripting.
* map but on a VoxelManipulator. This is for emerge scripting.
*/
class ModApiEnvVM : public ModApiEnvBase {
private: