From ebe91427c31f9de970f3a1a550ecb465f88c6761 Mon Sep 17 00:00:00 2001 From: Marc Gilleron Date: Sun, 1 Sep 2019 22:52:38 +0100 Subject: [PATCH] #ifdef out debug boxes --- terrain/voxel_lod_terrain.cpp | 10 +++++----- terrain/voxel_lod_terrain.h | 6 ++++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/terrain/voxel_lod_terrain.cpp b/terrain/voxel_lod_terrain.cpp index f563f7ef..b5fedb68 100644 --- a/terrain/voxel_lod_terrain.cpp +++ b/terrain/voxel_lod_terrain.cpp @@ -7,7 +7,7 @@ #include #include -#ifdef TOOLS_ENABLED +#ifdef VOXEL_DEBUG_BOXES #include #endif @@ -301,7 +301,7 @@ void VoxelLodTerrain::_set_lod_count(int p_lod_count) { for (Map::Element *E = _lod_octrees.front(); E; E = E->next()) { OctreeItem &item = E->value(); item.octree.create_from_lod_count(get_block_size(), p_lod_count, nda); -#ifdef TOOLS_ENABLED +#ifdef VOXEL_DEBUG_BOXES destroy_octree_debug_box(item, E->key()); create_octree_debug_box(item, E->key()); #endif @@ -686,7 +686,7 @@ void VoxelLodTerrain::_process() { OctreeItem &item = E->value(); Vector3i block_pos_maxlod = E->key(); -#ifdef TOOLS_ENABLED +#ifdef VOXEL_DEBUG_BOXES self->destroy_octree_debug_box(item, block_pos_maxlod); #endif @@ -720,7 +720,7 @@ void VoxelLodTerrain::_process() { item.octree.create_from_lod_count(block_size, self->get_lod_count(), nda); item.octree.set_split_scale(self->_lod_split_scale); -#ifdef TOOLS_ENABLED +#ifdef VOXEL_DEBUG_BOXES self->create_octree_debug_box(item, pos); #endif } @@ -1173,7 +1173,7 @@ void VoxelLodTerrain::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "collision_lod_count"), "set_collision_lod_count", "get_collision_lod_count"); } -#ifdef TOOLS_ENABLED +#ifdef VOXEL_DEBUG_BOXES void VoxelLodTerrain::create_octree_debug_box(OctreeItem &item, Vector3i pos) { CRASH_COND(item.debug_box != nullptr); diff --git a/terrain/voxel_lod_terrain.h b/terrain/voxel_lod_terrain.h index f8d1e89d..410418d8 100644 --- a/terrain/voxel_lod_terrain.h +++ b/terrain/voxel_lod_terrain.h @@ -9,6 +9,8 @@ #include #include +//#define VOXEL_DEBUG_BOXES + class VoxelMap; // Paged terrain made of voxel blocks of variable level of detail. @@ -108,12 +110,12 @@ private: struct OctreeItem { LodOctree octree; -#ifdef TOOLS_ENABLED +#ifdef VOXEL_DEBUG_BOXES Spatial *debug_box = nullptr; #endif }; -#ifdef TOOLS_ENABLED +#ifdef VOXEL_DEBUG_BOXES void create_octree_debug_box(OctreeItem &item, Vector3i pos); void destroy_octree_debug_box(OctreeItem &item, Vector3i pos); #endif