From 17e3651d0ee5ee75b4a67727a0884fe9558491da Mon Sep 17 00:00:00 2001 From: Marc Gilleron Date: Sat, 15 Feb 2020 16:37:23 +0000 Subject: [PATCH] Fix release compilation --- terrain/voxel_lod_terrain.cpp | 35 ++--------------------------------- terrain/voxel_lod_terrain.h | 6 ------ terrain/voxel_terrain.cpp | 4 ++-- voxel_buffer.cpp | 4 ---- voxel_buffer.h | 4 ---- 5 files changed, 4 insertions(+), 49 deletions(-) diff --git a/terrain/voxel_lod_terrain.cpp b/terrain/voxel_lod_terrain.cpp index daf6ccc12..cbddb8f02 100644 --- a/terrain/voxel_lod_terrain.cpp +++ b/terrain/voxel_lod_terrain.cpp @@ -968,19 +968,13 @@ void VoxelLodTerrain::_process() { //print_line(String("Loaded {0} blocks").format(varray(output.emerged_blocks.size()))); -#ifdef TOOLS_ENABLED - for (int i = 0; i < _lod_count; ++i) { - _lods[i].debug_unexpected_block_drops.clear(); - } -#endif - for (int i = 0; i < output.blocks.size(); ++i) { VOXEL_PROFILE_SCOPE(profile_process_get_loading_responses_block); const VoxelDataLoader::OutputBlock &ob = output.blocks[i]; - if(ob.data.type == VoxelDataLoader::TYPE_SAVE) { + if (ob.data.type == VoxelDataLoader::TYPE_SAVE) { // That's a save confirmation event. // Note: in the future, if blocks don't get copied before being sent for saving, // we will need to use block versionning to know when we can reset the `modified` flag properly @@ -1014,9 +1008,6 @@ void VoxelLodTerrain::_process() { // print_line(String("Received a block loading drop while we were still expecting it: lod{0} ({1}, {2}, {3})") // .format(varray(ob.lod, ob.position.x, ob.position.y, ob.position.z))); -#ifdef TOOLS_ENABLED - lod.debug_unexpected_block_drops.push_back(ob.position); -#endif ++_stats.dropped_block_loads; continue; } @@ -1563,27 +1554,6 @@ Array VoxelLodTerrain::debug_raycast_block(Vector3 world_origin, Vector3 world_d return hits; } -Array VoxelLodTerrain::debug_get_last_unexpected_block_drops() const { - - Array lods; - lods.resize(_lod_count); - - for (int i = 0; i < _lod_count; ++i) { - const Lod &lod = _lods[i]; - - Array drops; - drops.resize(lod.debug_unexpected_block_drops.size()); - - for (int j = 0; j < lod.debug_unexpected_block_drops.size(); ++j) { - drops[j] = lod.debug_unexpected_block_drops[j].to_vec3(); - } - - lods[i] = drops; - } - - return lods; -} - Dictionary VoxelLodTerrain::debug_get_block_info(Vector3 fbpos, int lod_index) const { Dictionary d; @@ -1631,7 +1601,7 @@ Array VoxelLodTerrain::_b_debug_print_sdf_top_down(Vector3 center, Vector3 exten Array image_array; image_array.resize(get_lod_count()); - for(int lod_index = 0; lod_index < get_lod_count(); ++lod_index) { + for (int lod_index = 0; lod_index < get_lod_count(); ++lod_index) { const Rect3i world_box = Rect3i::from_center_extents(Vector3i(center) >> lod_index, Vector3i(extents) >> lod_index); @@ -1694,7 +1664,6 @@ void VoxelLodTerrain::_bind_methods() { ClassDB::bind_method(D_METHOD("debug_raycast_block", "origin", "dir"), &VoxelLodTerrain::debug_raycast_block); ClassDB::bind_method(D_METHOD("debug_get_block_info", "block_pos", "lod"), &VoxelLodTerrain::debug_get_block_info); - ClassDB::bind_method(D_METHOD("debug_get_last_unexpected_block_drops"), &VoxelLodTerrain::debug_get_last_unexpected_block_drops); ClassDB::bind_method(D_METHOD("debug_get_octrees"), &VoxelLodTerrain::debug_get_octrees); ClassDB::bind_method(D_METHOD("debug_save_all_modified_blocks"), &VoxelLodTerrain::_b_save_all_modified_blocks); ClassDB::bind_method(D_METHOD("debug_print_sdf_top_down", "center", "extents"), &VoxelLodTerrain::_b_debug_print_sdf_top_down); diff --git a/terrain/voxel_lod_terrain.h b/terrain/voxel_lod_terrain.h index 4c722f147..6e62d6c04 100644 --- a/terrain/voxel_lod_terrain.h +++ b/terrain/voxel_lod_terrain.h @@ -76,7 +76,6 @@ class VoxelLodTerrain : public Spatial { Dictionary get_statistics() const; Array debug_raycast_block(Vector3 world_origin, Vector3 world_direction) const; - Array debug_get_last_unexpected_block_drops() const; Dictionary debug_get_block_info(Vector3 fbpos, int lod_index) const; Array debug_get_octrees() const; @@ -160,11 +159,6 @@ class VoxelLodTerrain : public Spatial { // Members for memory caching std::vector blocks_to_load; - -#ifdef TOOLS_ENABLED - // TODO Debug, may be removed in the future - std::vector debug_unexpected_block_drops; -#endif }; FixedArray _lods; diff --git a/terrain/voxel_terrain.cpp b/terrain/voxel_terrain.cpp index 857db0042..7c1bd916a 100644 --- a/terrain/voxel_terrain.cpp +++ b/terrain/voxel_terrain.cpp @@ -23,8 +23,8 @@ VoxelTerrain::VoxelTerrain() { _view_distance_blocks = 8; _last_view_distance_blocks = 0; - _stream_thread = NULL; - _block_updater = NULL; + _stream_thread = nullptr; + _block_updater = nullptr; _run_in_editor = false; _smooth_meshing_enabled = false; diff --git a/voxel_buffer.cpp b/voxel_buffer.cpp index 388f392b0..56597f201 100644 --- a/voxel_buffer.cpp +++ b/voxel_buffer.cpp @@ -721,8 +721,6 @@ uint32_t VoxelBuffer::get_depth_bit_count(Depth d) { return ::get_depth_bit_count(d); } -#ifdef TOOLS_ENABLED - Ref VoxelBuffer::debug_print_sdf_to_image_top_down() { Image *im = memnew(Image); im->create(_size.x, _size.z, false, Image::FORMAT_RGB8); @@ -745,8 +743,6 @@ Ref VoxelBuffer::debug_print_sdf_to_image_top_down() { return Ref(im); } -#endif - void VoxelBuffer::_bind_methods() { ClassDB::bind_method(D_METHOD("create", "sx", "sy", "sz"), &VoxelBuffer::_b_create); diff --git a/voxel_buffer.h b/voxel_buffer.h index 5919806cd..4629b65fc 100644 --- a/voxel_buffer.h +++ b/voxel_buffer.h @@ -141,13 +141,9 @@ class VoxelBuffer : public Reference { // } // } -#ifdef TOOLS_ENABLED - // Debugging Ref debug_print_sdf_to_image_top_down(); -#endif - private: void create_channel_noinit(int i, Vector3i size); void create_channel(int i, Vector3i size, uint64_t defval);