mirror of
https://github.com/Relintai/godot_voxel.git
synced 2025-01-27 08:29:19 +01:00
Fix missing destructor in VoxelBlock... woopsie
This commit is contained in:
parent
d21974e122
commit
035e45d0a3
@ -12,14 +12,14 @@ VoxelBlock *VoxelBlock::create(Vector3i bpos, Ref<VoxelBuffer> buffer, unsigned
|
|||||||
block->_position_in_voxels = bpos * (size << p_lod_index);
|
block->_position_in_voxels = bpos * (size << p_lod_index);
|
||||||
|
|
||||||
block->voxels = buffer;
|
block->voxels = buffer;
|
||||||
//block->map = ↦
|
|
||||||
return block;
|
return block;
|
||||||
}
|
}
|
||||||
|
|
||||||
VoxelBlock::VoxelBlock() :
|
VoxelBlock::VoxelBlock() :
|
||||||
voxels(NULL),
|
voxels(NULL) {
|
||||||
_mesh_update_count(0) {
|
}
|
||||||
|
|
||||||
|
VoxelBlock::~VoxelBlock() {
|
||||||
VisualServer &vs = *VisualServer::get_singleton();
|
VisualServer &vs = *VisualServer::get_singleton();
|
||||||
|
|
||||||
if (_mesh_instance.is_valid()) {
|
if (_mesh_instance.is_valid()) {
|
||||||
|
@ -19,6 +19,8 @@ public:
|
|||||||
|
|
||||||
static VoxelBlock *create(Vector3i bpos, Ref<VoxelBuffer> buffer, unsigned int size, unsigned int p_lod_index);
|
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);
|
void set_mesh(Ref<Mesh> mesh, Ref<World> world);
|
||||||
bool has_mesh() const;
|
bool has_mesh() const;
|
||||||
|
|
||||||
@ -34,7 +36,7 @@ private:
|
|||||||
|
|
||||||
Ref<Mesh> _mesh;
|
Ref<Mesh> _mesh;
|
||||||
RID _mesh_instance;
|
RID _mesh_instance;
|
||||||
int _mesh_update_count;
|
int _mesh_update_count = 0;
|
||||||
bool _visible = true;
|
bool _visible = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user