From 9a17b65f26eea5b9d7176e7df205f72ed2ff6c0f Mon Sep 17 00:00:00 2001 From: Loïc Blot Date: Wed, 26 Jul 2017 07:35:09 +0200 Subject: VoxelManip cleanups (const ref, const move) + function removal (#6169) * VoxelManip cleanups (const ref, const move) permitting to improve a little bit performance * VoxelArea: precalculate extent (performance enhancement) This permits to reduce extend high cost to zero and drop many v3s16 object creation/removal to calculate extent It rebalance the client thread update to updateFastFaceRow instead of MapBlockMesh generation This will also benefits to mapgen --- src/voxel.cpp | 37 +++---------------------------------- 1 file changed, 3 insertions(+), 34 deletions(-) (limited to 'src/voxel.cpp') diff --git a/src/voxel.cpp b/src/voxel.cpp index 08765c98e..981bc5823 100644 --- a/src/voxel.cpp +++ b/src/voxel.cpp @@ -55,7 +55,7 @@ void VoxelManipulator::clear() void VoxelManipulator::print(std::ostream &o, INodeDefManager *ndef, VoxelPrintMode mode) { - v3s16 em = m_area.getExtent(); + const v3s16 &em = m_area.getExtent(); v3s16 of = m_area.MinEdge; o<<"size: "< & from_nodes, - std::set & light_sources, INodeDefManager *nodemgr) -{ - if(from_nodes.empty()) - return; - - for(std::map::iterator j = from_nodes.begin(); - j != from_nodes.end(); ++j) - { - unspreadLight(bank, j->first, j->second, light_sources, nodemgr); - } -} - void VoxelManipulator::spreadLight(enum LightBank bank, v3s16 p, INodeDefManager *nodemgr) { -- cgit v1.2.3