Fix missing destructor in VoxelBlock... woopsie

This commit is contained in:
Marc Gilleron 2019-05-08 20:36:27 +01:00
parent d21974e122
commit 035e45d0a3
2 changed files with 6 additions and 4 deletions

View File

@ -12,14 +12,14 @@ VoxelBlock *VoxelBlock::create(Vector3i bpos, Ref<VoxelBuffer> buffer, unsigned
block->_position_in_voxels = bpos * (size << p_lod_index);
block->voxels = buffer;
//block->map = &map;
return block;
}
VoxelBlock::VoxelBlock() :
voxels(NULL),
_mesh_update_count(0) {
voxels(NULL) {
}
VoxelBlock::~VoxelBlock() {
VisualServer &vs = *VisualServer::get_singleton();
if (_mesh_instance.is_valid()) {

View File

@ -19,6 +19,8 @@ public:
static VoxelBlock *create(Vector3i bpos, Ref<VoxelBuffer> buffer, unsigned int size, unsigned int p_lod_index);
~VoxelBlock();
void set_mesh(Ref<Mesh> mesh, Ref<World> world);
bool has_mesh() const;
@ -34,7 +36,7 @@ private:
Ref<Mesh> _mesh;
RID _mesh_instance;
int _mesh_update_count;
int _mesh_update_count = 0;
bool _visible = true;
};