1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

VoxelManipulator code cleanup (#15114)

* Cache node in voxel area index when possible

The index function according to the MSVC profiler actually takes up a significant time slice (around ~5% of total time for the process) during normal game-play.
Might not be accurate but still good to not recalculate it twice.

* Remove `setNodeNoRef` from VM

* VM: remove old commented out print statement
This commit is contained in:
red-001 2024-09-04 14:20:39 +01:00 committed by GitHub
parent 074700b35e
commit 486dc3288d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 19 deletions

View file

@ -87,7 +87,7 @@ void TestVoxelManipulator::testVoxelManipulator(const NodeDefManager *nodedef)
v.print(infostream, nodedef);
infostream << "*** Setting (-1,0,-1)=2 ***" << std::endl;
v.setNodeNoRef(v3s16(-1,0,-1), MapNode(t_CONTENT_GRASS));
v.setNode(v3s16(-1,0,-1), MapNode(t_CONTENT_GRASS));
v.print(infostream, nodedef);
UASSERT(v.getNode(v3s16(-1,0,-1)).getContent() == t_CONTENT_GRASS);