mirror of
https://github.com/Relintai/godot_voxel.git
synced 2024-11-11 20:35:08 +01:00
Count updates per block for debug purpose
This commit is contained in:
parent
f9034eba08
commit
ad37d7aff4
@ -16,7 +16,7 @@ VoxelBlock *VoxelBlock::create(Vector3i bpos, Ref<VoxelBuffer> buffer, unsigned
|
||||
}
|
||||
|
||||
VoxelBlock::VoxelBlock()
|
||||
: voxels(NULL) {
|
||||
: voxels(NULL), _mesh_update_count(0) {
|
||||
|
||||
VisualServer &vs = *VisualServer::get_singleton();
|
||||
|
||||
@ -55,6 +55,11 @@ void VoxelBlock::set_mesh(Ref<Mesh> mesh, Ref<World> world) {
|
||||
}
|
||||
|
||||
_mesh = mesh;
|
||||
++_mesh_update_count;
|
||||
|
||||
// if(_mesh_update_count > 1) {
|
||||
// print_line(String("Block {0} was updated {1} times").format(varray(pos.to_vec3(), _mesh_update_count)));
|
||||
// }
|
||||
}
|
||||
|
||||
void VoxelBlock::enter_world(World *world) {
|
||||
|
@ -28,6 +28,7 @@ private:
|
||||
|
||||
Ref<Mesh> _mesh;
|
||||
RID _mesh_instance;
|
||||
int _mesh_update_count;
|
||||
};
|
||||
|
||||
#endif // VOXEL_BLOCK_H
|
||||
|
Loading…
Reference in New Issue
Block a user