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/cavegen.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/cavegen.cpp') diff --git a/src/cavegen.cpp b/src/cavegen.cpp index a2ecca483..fc9526b4f 100644 --- a/src/cavegen.cpp +++ b/src/cavegen.cpp @@ -73,7 +73,7 @@ void CavesNoiseIntersection::generateCaves(MMVManip *vm, noise_cave1->perlinMap3D(nmin.X, nmin.Y - 1, nmin.Z); noise_cave2->perlinMap3D(nmin.X, nmin.Y - 1, nmin.Z); - v3s16 em = vm->m_area.getExtent(); + const v3s16 &em = vm->m_area.getExtent(); u32 index2d = 0; // Biomemap index for (s16 z = nmin.Z; z <= nmax.Z; z++) @@ -208,7 +208,7 @@ bool CavernsNoise::generateCaverns(MMVManip *vm, v3s16 nmin, v3s16 nmax) //// Place nodes bool near_cavern = false; - v3s16 em = vm->m_area.getExtent(); + const v3s16 &em = vm->m_area.getExtent(); u32 index2d = 0; for (s16 z = nmin.Z; z <= nmax.Z; z++) -- cgit v1.2.3