From 572dcbf6801af493d98907b32dff694d2c88e169 Mon Sep 17 00:00:00 2001 From: Marc Gilleron Date: Mon, 22 Apr 2019 21:15:45 +0100 Subject: [PATCH] Move this code closer to what uses it --- dmc/voxel_mesher_dmc.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/dmc/voxel_mesher_dmc.cpp b/dmc/voxel_mesher_dmc.cpp index db98d23..8c4ef8f 100644 --- a/dmc/voxel_mesher_dmc.cpp +++ b/dmc/voxel_mesher_dmc.cpp @@ -206,16 +206,6 @@ void generate_octree_top_down(OctreeNode *node, const VoxelAccess &voxels, float } } -template -void foreach_node(OctreeNode *root, Action_T &a, int depth = 0) { - a(root, depth); - for (int i = 0; i < 8; ++i) { - if (root->children[i]) { - foreach_node(root->children[i], a, depth + 1); - } - } -} - // Builds the octree bottom-up, to ensure that no detail can be missed by a top-down approach. class OctreeBuilderBottomUp { public: @@ -293,6 +283,16 @@ private: const float _geometry_error; }; +template +void foreach_node(OctreeNode *root, Action_T &a, int depth = 0) { + a(root, depth); + for (int i = 0; i < 8; ++i) { + if (root->children[i]) { + foreach_node(root->children[i], a, depth + 1); + } + } +} + Ref generate_debug_octree_mesh(OctreeNode *root) { struct GetMaxDepth {