From fbceed36663ab142c43198824ed19fb444e6d10b Mon Sep 17 00:00:00 2001 From: Marc Gilleron Date: Sat, 3 Sep 2022 17:46:20 +0100 Subject: [PATCH] Fix errors in unused template functions --- storage/voxel_data.h | 54 -------------------------------------------- 1 file changed, 54 deletions(-) diff --git a/storage/voxel_data.h b/storage/voxel_data.h index 6f24d837..d4e3c7f9 100644 --- a/storage/voxel_data.h +++ b/storage/voxel_data.h @@ -110,60 +110,6 @@ public: // This is necessary for editing destructively. bool is_area_loaded(const Box3i p_voxels_box) const; - // Executes a read+write operation on all voxels in the given area, on a specific channel. - // If the area intersects the boundaries of the volume, it will be clipped. - // If the area intersects blocks that aren't loaded, the operation will be cancelled. - // Returns the box of voxels which were effectively processed. - template - Box3i write_box(const Box3i &p_voxel_box, unsigned int channel_index, F action) { - const Box3i voxel_box = p_voxel_box.clipped(get_bounds()); - if (!is_area_loaded(voxel_box)) { - ZN_PRINT_VERBOSE("Area not editable"); - return Box3i(); - } - Ref generator = _generator; - VoxelDataLodMap::Lod &data_lod0 = _data->lods[0]; - { - // New blocks can be created in the map so we have to lock for writing - RWLockWrite wlock(data_lod0.map_lock); - data_lod0.map.write_box( - voxel_box, channel_index, action, [&generator](VoxelBufferInternal &voxels, Vector3i pos) { - if (generator.is_valid()) { - VoxelGenerator::VoxelQueryData q{ voxels, pos, 0 }; - generator->generate_block(q); - } - }); - } - return voxel_box; - } - - // Executes a read+write operation on all voxels in the given area, on two specific channels. - // If the area intersects the boundaries of the volume, it will be clipped. - // If the area intersects blocks that aren't loaded, the operation will be cancelled. - // Returns the box of voxels which were effectively processed. - template - Box3i write_box_2(const Box3i &p_voxel_box, unsigned int channel1_index, unsigned int channel2_index, F action) { - const Box3i voxel_box = p_voxel_box.clipped(get_bounds()); - if (!is_area_loaded(voxel_box)) { - ZN_PRINT_VERBOSE("Area not editable"); - return Box3i(); - } - Ref generator = _generator; - VoxelDataLodMap::Lod &data_lod0 = _data->lods[0]; - { - // New blocks can be created in the map so we have to lock for writing - RWLockWrite wlock(data_lod0.map_lock); - data_lod0.map.write_box_2(voxel_box, channel1_index, channel2_index, action, - [&generator](VoxelBufferInternal &voxels, Vector3i pos) { - if (generator.is_valid()) { - VoxelGenerator::VoxelQueryData q{ voxels, pos, 0 }; - generator->generate_block(q); - } - }); - } - return voxel_box; - } - // Generates all non-present blocks in preparation for an edit. // Every block intersecting with the box at every LOD will be checked. // This function runs sequentially and should be thread-safe. May be used if blocks are immediately needed.