From 9c5aed85dfdd82f72587eff4ff0a827dc4c4153d Mon Sep 17 00:00:00 2001 From: Relintai Date: Tue, 27 Oct 2020 18:36:10 +0100 Subject: [PATCH] Did the same to the generation queue related methods in VoxelWorld. --- world/voxel_world.cpp | 34 +++++++++++++++++----------------- world/voxel_world.h | 16 ++++++++-------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/world/voxel_world.cpp b/world/voxel_world.cpp index 192a70b..00ee45b 100644 --- a/world/voxel_world.cpp +++ b/world/voxel_world.cpp @@ -361,7 +361,7 @@ Ref VoxelWorld::chunk_get_or_create(int x, int y, int z) { Ref VoxelWorld::chunk_create(const int x, const int y, const int z) { Ref c = call("_create_chunk", x, y, z, Ref()); - add_to_generation_queue(c); + generation_queue_add_to(c); return c; } @@ -500,43 +500,43 @@ void VoxelWorld::on_chunk_mesh_generation_finished(Ref p_chunk) { call_deferred("emit_signal", "chunk_mesh_generation_finished", p_chunk); } -void VoxelWorld::add_to_generation_queue(const Ref &chunk) { +void VoxelWorld::generation_queue_add_to(const Ref &chunk) { ERR_FAIL_COND(!chunk.is_valid()); set_process_internal(true); _generation_queue.push_back(chunk); } -Ref VoxelWorld::get_generation_queue_index(int index) { +Ref VoxelWorld::generation_queue_get_index(int index) { ERR_FAIL_INDEX_V(index, _generation_queue.size(), NULL); return _generation_queue.get(index); } -void VoxelWorld::remove_generation_queue_index(int index) { +void VoxelWorld::generation_queue_remove_index(int index) { ERR_FAIL_INDEX(index, _generation_queue.size()); _generation_queue.remove(index); } -int VoxelWorld::get_generation_queue_size() const { +int VoxelWorld::generation_queue_get_size() const { return _generation_queue.size(); } -void VoxelWorld::add_to_generation(const Ref &chunk) { +void VoxelWorld::generation_add_to(const Ref &chunk) { ERR_FAIL_COND(!chunk.is_valid()); _generating.push_back(chunk); } -Ref VoxelWorld::get_generation_index(const int index) { +Ref VoxelWorld::generation_get_index(const int index) { ERR_FAIL_INDEX_V(index, _generating.size(), NULL); return _generating.get(index); } -void VoxelWorld::remove_generation_index(const int index) { +void VoxelWorld::generation_remove_index(const int index) { ERR_FAIL_INDEX(index, _generating.size()); _generating.remove(index); } -int VoxelWorld::get_generation_size() const { +int VoxelWorld::generation_get_size() const { return _generating.size(); } @@ -1123,15 +1123,15 @@ void VoxelWorld::_bind_methods() { ClassDB::bind_method(D_METHOD("chunks_set"), &VoxelWorld::chunks_set); ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "chunks", PROPERTY_HINT_NONE, "17/17:VoxelChunk", PROPERTY_USAGE_DEFAULT, "VoxelChunk"), "chunks_set", "chunks_get"); - ClassDB::bind_method(D_METHOD("add_to_generation_queue", "chunk"), &VoxelWorld::add_to_generation_queue); - ClassDB::bind_method(D_METHOD("get_generation_queue_index", "index"), &VoxelWorld::get_generation_queue_index); - ClassDB::bind_method(D_METHOD("remove_generation_queue_index", "index"), &VoxelWorld::remove_generation_queue_index); - ClassDB::bind_method(D_METHOD("get_generation_queue_size"), &VoxelWorld::get_generation_queue_size); + ClassDB::bind_method(D_METHOD("generation_queue_add_to", "chunk"), &VoxelWorld::generation_queue_add_to); + ClassDB::bind_method(D_METHOD("generation_queue_get_index", "index"), &VoxelWorld::generation_queue_get_index); + ClassDB::bind_method(D_METHOD("generation_queue_remove_index", "index"), &VoxelWorld::generation_queue_remove_index); + ClassDB::bind_method(D_METHOD("generation_queue_get_size"), &VoxelWorld::generation_queue_get_size); - ClassDB::bind_method(D_METHOD("add_to_generation", "chunk"), &VoxelWorld::add_to_generation); - ClassDB::bind_method(D_METHOD("get_generation_index", "index"), &VoxelWorld::get_generation_index); - ClassDB::bind_method(D_METHOD("remove_generation_index", "index"), &VoxelWorld::remove_generation_index); - ClassDB::bind_method(D_METHOD("get_generation_size"), &VoxelWorld::get_generation_size); + ClassDB::bind_method(D_METHOD("generation_add_to", "chunk"), &VoxelWorld::generation_add_to); + ClassDB::bind_method(D_METHOD("generation_get_index", "index"), &VoxelWorld::generation_get_index); + ClassDB::bind_method(D_METHOD("generation_remove_index", "index"), &VoxelWorld::generation_remove_index); + ClassDB::bind_method(D_METHOD("generation_get_size"), &VoxelWorld::generation_get_size); ADD_SIGNAL(MethodInfo("generation_finished")); BIND_VMETHOD(MethodInfo("_generation_finished")); diff --git a/world/voxel_world.h b/world/voxel_world.h index 9205bcc..516944a 100644 --- a/world/voxel_world.h +++ b/world/voxel_world.h @@ -151,15 +151,15 @@ public: void on_chunk_mesh_generation_finished(Ref p_chunk); - void add_to_generation_queue(const Ref &chunk); - Ref get_generation_queue_index(const int index); - void remove_generation_queue_index(const int index); - int get_generation_queue_size() const; + void generation_queue_add_to(const Ref &chunk); + Ref generation_queue_get_index(const int index); + void generation_queue_remove_index(const int index); + int generation_queue_get_size() const; - void add_to_generation(const Ref &chunk); - Ref get_generation_index(const int index); - void remove_generation_index(const int index); - int get_generation_size() const; + void generation_add_to(const Ref &chunk); + Ref generation_get_index(const int index); + void generation_remove_index(const int index); + int generation_get_size() const; #if PROPS_PRESENT void prop_add(Transform tarnsform, const Ref &prop, const bool apply_voxel_scael = true);