Count updates per block for debug purpose

This commit is contained in:
Marc Gilleron 2018-09-29 17:08:05 +01:00
parent f9034eba08
commit ad37d7aff4
2 changed files with 7 additions and 1 deletions

View File

@ -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) {

View File

@ -28,6 +28,7 @@ private:
Ref<Mesh> _mesh;
RID _mesh_instance;
int _mesh_update_count;
};
#endif // VOXEL_BLOCK_H