diff --git a/doc_classes/TerrainLibrary.xml b/doc_classes/TerrainLibrary.xml index 7c760d8..a483068 100644 --- a/doc_classes/TerrainLibrary.xml +++ b/doc_classes/TerrainLibrary.xml @@ -343,37 +343,37 @@ - + - + - + - + - + - + diff --git a/doc_classes/TerrainLibraryMerger.xml b/doc_classes/TerrainLibraryMerger.xml index 637a064..0c25c4c 100644 --- a/doc_classes/TerrainLibraryMerger.xml +++ b/doc_classes/TerrainLibraryMerger.xml @@ -32,7 +32,7 @@ - + diff --git a/doc_classes/TerrainLibraryMergerPCM.xml b/doc_classes/TerrainLibraryMergerPCM.xml index 2e84c8e..b0cf5ec 100644 --- a/doc_classes/TerrainLibraryMergerPCM.xml +++ b/doc_classes/TerrainLibraryMergerPCM.xml @@ -32,7 +32,7 @@ - + diff --git a/doc_classes/TerrainLibrarySimple.xml b/doc_classes/TerrainLibrarySimple.xml index c1569eb..817867f 100644 --- a/doc_classes/TerrainLibrarySimple.xml +++ b/doc_classes/TerrainLibrarySimple.xml @@ -13,7 +13,7 @@ - + diff --git a/library/terrain_library.cpp b/library/terrain_library.cpp index dd9c988..0bef9f2 100644 --- a/library/terrain_library.cpp +++ b/library/terrain_library.cpp @@ -394,19 +394,19 @@ void TerrainLibrary::prop_materials_set(const Vector &materials) { } //Surfaces -Ref TerrainLibrary::voxel_surface_get(const int index) { +Ref TerrainLibrary::terra_surface_get(const int index) { return Ref(); } -void TerrainLibrary::voxel_surface_add(Ref value) { +void TerrainLibrary::terra_surface_add(Ref value) { } -void TerrainLibrary::voxel_surface_set(int index, Ref value) { +void TerrainLibrary::terra_surface_set(int index, Ref value) { } -void TerrainLibrary::voxel_surface_remove(const int index) { +void TerrainLibrary::terra_surface_remove(const int index) { } -int TerrainLibrary::voxel_surface_get_num() const { +int TerrainLibrary::terra_surface_get_num() const { return 0; } -void TerrainLibrary::voxel_surfaces_clear() { +void TerrainLibrary::terra_surfaces_clear() { } Ref TerrainLibrary::scene_get(const int id) { @@ -593,12 +593,12 @@ void TerrainLibrary::_bind_methods() { ClassDB::bind_method(D_METHOD("prop_materials_set"), &TerrainLibrary::prop_materials_set); ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "prop_materials", PROPERTY_HINT_NONE, "17/17:Material", PROPERTY_USAGE_DEFAULT, "Material"), "prop_materials_set", "prop_materials_get"); - ClassDB::bind_method(D_METHOD("voxel_surface_get", "index"), &TerrainLibrary::voxel_surface_get); - ClassDB::bind_method(D_METHOD("voxel_surface_add", "value"), &TerrainLibrary::voxel_surface_add); - ClassDB::bind_method(D_METHOD("voxel_surface_set", "index", "surface"), &TerrainLibrary::voxel_surface_set); - ClassDB::bind_method(D_METHOD("voxel_surface_remove", "index"), &TerrainLibrary::voxel_surface_remove); - ClassDB::bind_method(D_METHOD("voxel_surface_get_num"), &TerrainLibrary::voxel_surface_get_num); - ClassDB::bind_method(D_METHOD("voxel_surfaces_clear"), &TerrainLibrary::voxel_surfaces_clear); + ClassDB::bind_method(D_METHOD("terra_surface_get", "index"), &TerrainLibrary::terra_surface_get); + ClassDB::bind_method(D_METHOD("terra_surface_add", "value"), &TerrainLibrary::terra_surface_add); + ClassDB::bind_method(D_METHOD("terra_surface_set", "index", "surface"), &TerrainLibrary::terra_surface_set); + ClassDB::bind_method(D_METHOD("terra_surface_remove", "index"), &TerrainLibrary::terra_surface_remove); + ClassDB::bind_method(D_METHOD("terra_surface_get_num"), &TerrainLibrary::terra_surface_get_num); + ClassDB::bind_method(D_METHOD("terra_surfaces_clear"), &TerrainLibrary::terra_surfaces_clear); ClassDB::bind_method(D_METHOD("scene_get", "index"), &TerrainLibrary::scene_get); ClassDB::bind_method(D_METHOD("scene_add", "value"), &TerrainLibrary::scene_add); diff --git a/library/terrain_library.h b/library/terrain_library.h index 36714fc..89f14b1 100644 --- a/library/terrain_library.h +++ b/library/terrain_library.h @@ -145,12 +145,12 @@ public: Vector prop_materials_get(); void prop_materials_set(const Vector &materials); - virtual Ref voxel_surface_get(const int index); - virtual void voxel_surface_add(Ref value); - virtual void voxel_surface_set(const int index, Ref value); - virtual void voxel_surface_remove(const int index); - virtual int voxel_surface_get_num() const; - virtual void voxel_surfaces_clear(); + virtual Ref terra_surface_get(const int index); + virtual void terra_surface_add(Ref value); + virtual void terra_surface_set(const int index, Ref value); + virtual void terra_surface_remove(const int index); + virtual int terra_surface_get_num() const; + virtual void terra_surfaces_clear(); virtual Ref scene_get(const int id); virtual void scene_add(Ref value); diff --git a/library/terrain_library_merger.cpp b/library/terrain_library_merger.cpp index dae482c..9062959 100644 --- a/library/terrain_library_merger.cpp +++ b/library/terrain_library_merger.cpp @@ -78,67 +78,67 @@ void TerrainLibraryMerger::set_margin(const int margin) { } //Surfaces -Ref TerrainLibraryMerger::voxel_surface_get(const int index) { - ERR_FAIL_INDEX_V(index, _voxel_surfaces.size(), Ref(NULL)); +Ref TerrainLibraryMerger::terra_surface_get(const int index) { + ERR_FAIL_INDEX_V(index, _terra_surfaces.size(), Ref(NULL)); - return _voxel_surfaces[index]; + return _terra_surfaces[index]; } -void TerrainLibraryMerger::voxel_surface_add(Ref value) { +void TerrainLibraryMerger::terra_surface_add(Ref value) { ERR_FAIL_COND(!value.is_valid()); value->set_library(Ref(this)); - value->set_id(_voxel_surfaces.size()); + value->set_id(_terra_surfaces.size()); - _voxel_surfaces.push_back(value); + _terra_surfaces.push_back(value); } -void TerrainLibraryMerger::voxel_surface_set(const int index, Ref value) { +void TerrainLibraryMerger::terra_surface_set(const int index, Ref value) { ERR_FAIL_COND(index < 0); - if (_voxel_surfaces.size() < index) { - _voxel_surfaces.resize(index + 1); + if (_terra_surfaces.size() < index) { + _terra_surfaces.resize(index + 1); } - if (_voxel_surfaces[index].is_valid()) { - _voxel_surfaces.get(index)->set_library(Ref(NULL)); + if (_terra_surfaces[index].is_valid()) { + _terra_surfaces.get(index)->set_library(Ref(NULL)); } if (value.is_valid()) { value->set_library(Ref(this)); - _voxel_surfaces.set(index, value); + _terra_surfaces.set(index, value); } } -void TerrainLibraryMerger::voxel_surface_remove(const int index) { - _voxel_surfaces.remove(index); +void TerrainLibraryMerger::terra_surface_remove(const int index) { + _terra_surfaces.remove(index); } -int TerrainLibraryMerger::voxel_surface_get_num() const { - return _voxel_surfaces.size(); +int TerrainLibraryMerger::terra_surface_get_num() const { + return _terra_surfaces.size(); } -void TerrainLibraryMerger::voxel_surfaces_clear() { +void TerrainLibraryMerger::terra_surfaces_clear() { _packer->clear(); - for (int i = 0; i < _voxel_surfaces.size(); i++) { - Ref surface = _voxel_surfaces[i]; + for (int i = 0; i < _terra_surfaces.size(); i++) { + Ref surface = _terra_surfaces[i]; if (surface.is_valid()) { surface->set_library(NULL); } } - _voxel_surfaces.clear(); + _terra_surfaces.clear(); } -Vector TerrainLibraryMerger::get_voxel_surfaces() { - VARIANT_ARRAY_GET(_voxel_surfaces); +Vector TerrainLibraryMerger::get_terra_surfaces() { + VARIANT_ARRAY_GET(_terra_surfaces); } -void TerrainLibraryMerger::set_voxel_surfaces(const Vector &surfaces) { - _voxel_surfaces.clear(); +void TerrainLibraryMerger::set_terra_surfaces(const Vector &surfaces) { + _terra_surfaces.clear(); for (int i = 0; i < surfaces.size(); i++) { Ref surface = Ref(surfaces[i]); @@ -147,7 +147,7 @@ void TerrainLibraryMerger::set_voxel_surfaces(const Vector &surfaces) { surface->set_library(Ref(this)); } - _voxel_surfaces.push_back(surface); + _terra_surfaces.push_back(surface); } } @@ -229,8 +229,8 @@ Ref TerrainLibraryMerger::get_prop_packer() { void TerrainLibraryMerger::refresh_rects() { bool texture_added = false; - for (int i = 0; i < _voxel_surfaces.size(); i++) { - Ref surface = Ref(_voxel_surfaces[i]); + for (int i = 0; i < _terra_surfaces.size(); i++) { + Ref surface = Ref(_terra_surfaces[i]); if (surface.is_valid()) { for (int j = 0; j < TerrainSurface::TERRAIN_SIDES_COUNT; ++j) { @@ -284,8 +284,8 @@ void TerrainLibraryMerger::refresh_rects() { } #endif - for (int i = 0; i < _voxel_surfaces.size(); i++) { - Ref surface = _voxel_surfaces[i]; + for (int i = 0; i < _terra_surfaces.size(); i++) { + Ref surface = _terra_surfaces[i]; if (surface.is_valid()) { surface->refresh_rects(); @@ -391,15 +391,15 @@ TerrainLibraryMerger::TerrainLibraryMerger() { } TerrainLibraryMerger::~TerrainLibraryMerger() { - for (int i = 0; i < _voxel_surfaces.size(); ++i) { - Ref surface = _voxel_surfaces[i]; + for (int i = 0; i < _terra_surfaces.size(); ++i) { + Ref surface = _terra_surfaces[i]; if (surface.is_valid()) { surface->set_library(Ref()); } } - _voxel_surfaces.clear(); + _terra_surfaces.clear(); _packer->clear(); _packer.unref(); @@ -466,9 +466,9 @@ void TerrainLibraryMerger::_bind_methods() { ClassDB::bind_method(D_METHOD("set_margin", "size"), &TerrainLibraryMerger::set_margin); ADD_PROPERTY(PropertyInfo(Variant::INT, "margin"), "set_margin", "get_margin"); - ClassDB::bind_method(D_METHOD("get_voxel_surfaces"), &TerrainLibraryMerger::get_voxel_surfaces); - ClassDB::bind_method(D_METHOD("set_voxel_surfaces"), &TerrainLibraryMerger::set_voxel_surfaces); - ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "voxel_surfaces", PROPERTY_HINT_NONE, "17/17:TerrainSurfaceMerger", PROPERTY_USAGE_DEFAULT, "TerrainSurfaceMerger"), "set_voxel_surfaces", "get_voxel_surfaces"); + ClassDB::bind_method(D_METHOD("get_terra_surfaces"), &TerrainLibraryMerger::get_terra_surfaces); + ClassDB::bind_method(D_METHOD("set_terra_surfaces"), &TerrainLibraryMerger::set_terra_surfaces); + ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "terra_surfaces", PROPERTY_HINT_NONE, "17/17:TerrainSurfaceMerger", PROPERTY_USAGE_DEFAULT, "TerrainSurfaceMerger"), "set_terra_surfaces", "get_terra_surfaces"); #ifdef PROPS_PRESENT ClassDB::bind_method(D_METHOD("get_props"), &TerrainLibraryMerger::get_props); diff --git a/library/terrain_library_merger.h b/library/terrain_library_merger.h index cc457ac..66437fa 100644 --- a/library/terrain_library_merger.h +++ b/library/terrain_library_merger.h @@ -63,15 +63,15 @@ public: int get_margin() const; void set_margin(const int margin); - Ref voxel_surface_get(const int index); - void voxel_surface_add(Ref value); - void voxel_surface_set(const int index, Ref value); - void voxel_surface_remove(const int index); - int voxel_surface_get_num() const; - void voxel_surfaces_clear(); + Ref terra_surface_get(const int index); + void terra_surface_add(Ref value); + void terra_surface_set(const int index, Ref value); + void terra_surface_remove(const int index); + int terra_surface_get_num() const; + void terra_surfaces_clear(); - Vector get_voxel_surfaces(); - void set_voxel_surfaces(const Vector &surfaces); + Vector get_terra_surfaces(); + void set_terra_surfaces(const Vector &surfaces); #ifdef PROPS_PRESENT Ref get_prop(const int index); @@ -104,7 +104,7 @@ protected: static void _bind_methods(); - Vector > _voxel_surfaces; + Vector > _terra_surfaces; #ifdef PROPS_PRESENT Vector > _props; #endif diff --git a/library/terrain_library_merger_pcm.cpp b/library/terrain_library_merger_pcm.cpp index 86c711e..48ae09b 100644 --- a/library/terrain_library_merger_pcm.cpp +++ b/library/terrain_library_merger_pcm.cpp @@ -132,11 +132,11 @@ void TerrainLibraryMergerPCM::_material_cache_get_key(Ref chunk) { for (int i = 0; i < surfaces.size(); ++i) { int s = surfaces[i] - 1; - if (_voxel_surfaces.size() <= s) { + if (_terra_surfaces.size() <= s) { continue; } - Ref ms = _voxel_surfaces[s]; + Ref ms = _terra_surfaces[s]; if (!ms.is_valid()) { continue; @@ -421,67 +421,67 @@ void TerrainLibraryMergerPCM::set_margin(const int margin) { } //Surfaces -Ref TerrainLibraryMergerPCM::voxel_surface_get(const int index) { - ERR_FAIL_INDEX_V(index, _voxel_surfaces.size(), Ref(NULL)); +Ref TerrainLibraryMergerPCM::terra_surface_get(const int index) { + ERR_FAIL_INDEX_V(index, _terra_surfaces.size(), Ref(NULL)); - return _voxel_surfaces[index]; + return _terra_surfaces[index]; } -void TerrainLibraryMergerPCM::voxel_surface_add(Ref value) { +void TerrainLibraryMergerPCM::terra_surface_add(Ref value) { ERR_FAIL_COND(!value.is_valid()); value->set_library(Ref(this)); - value->set_id(_voxel_surfaces.size()); + value->set_id(_terra_surfaces.size()); - _voxel_surfaces.push_back(value); + _terra_surfaces.push_back(value); } -void TerrainLibraryMergerPCM::voxel_surface_set(const int index, Ref value) { +void TerrainLibraryMergerPCM::terra_surface_set(const int index, Ref value) { ERR_FAIL_COND(index < 0); - if (_voxel_surfaces.size() < index) { - _voxel_surfaces.resize(index + 1); + if (_terra_surfaces.size() < index) { + _terra_surfaces.resize(index + 1); } - if (_voxel_surfaces[index].is_valid()) { - _voxel_surfaces.get(index)->set_library(Ref(NULL)); + if (_terra_surfaces[index].is_valid()) { + _terra_surfaces.get(index)->set_library(Ref(NULL)); } if (value.is_valid()) { value->set_library(Ref(this)); - _voxel_surfaces.set(index, value); + _terra_surfaces.set(index, value); } } -void TerrainLibraryMergerPCM::voxel_surface_remove(const int index) { - _voxel_surfaces.remove(index); +void TerrainLibraryMergerPCM::terra_surface_remove(const int index) { + _terra_surfaces.remove(index); } -int TerrainLibraryMergerPCM::voxel_surface_get_num() const { - return _voxel_surfaces.size(); +int TerrainLibraryMergerPCM::terra_surface_get_num() const { + return _terra_surfaces.size(); } -void TerrainLibraryMergerPCM::voxel_surfaces_clear() { +void TerrainLibraryMergerPCM::terra_surfaces_clear() { _packer->clear(); - for (int i = 0; i < _voxel_surfaces.size(); i++) { - Ref surface = _voxel_surfaces[i]; + for (int i = 0; i < _terra_surfaces.size(); i++) { + Ref surface = _terra_surfaces[i]; if (surface.is_valid()) { surface->set_library(NULL); } } - _voxel_surfaces.clear(); + _terra_surfaces.clear(); } -Vector TerrainLibraryMergerPCM::get_voxel_surfaces() { - VARIANT_ARRAY_GET(_voxel_surfaces); +Vector TerrainLibraryMergerPCM::get_terra_surfaces() { + VARIANT_ARRAY_GET(_terra_surfaces); } -void TerrainLibraryMergerPCM::set_voxel_surfaces(const Vector &surfaces) { - _voxel_surfaces.clear(); +void TerrainLibraryMergerPCM::set_terra_surfaces(const Vector &surfaces) { + _terra_surfaces.clear(); for (int i = 0; i < surfaces.size(); i++) { Ref surface = Ref(surfaces[i]); @@ -490,7 +490,7 @@ void TerrainLibraryMergerPCM::set_voxel_surfaces(const Vector &surfaces surface->set_library(Ref(this)); } - _voxel_surfaces.push_back(surface); + _terra_surfaces.push_back(surface); } } @@ -572,8 +572,8 @@ Ref TerrainLibraryMergerPCM::get_prop_packer() { void TerrainLibraryMergerPCM::refresh_rects() { bool texture_added = false; - for (int i = 0; i < _voxel_surfaces.size(); i++) { - Ref surface = Ref(_voxel_surfaces[i]); + for (int i = 0; i < _terra_surfaces.size(); i++) { + Ref surface = Ref(_terra_surfaces[i]); if (surface.is_valid()) { for (int j = 0; j < TerrainSurface::TERRAIN_SIDES_COUNT; ++j) { @@ -627,8 +627,8 @@ void TerrainLibraryMergerPCM::refresh_rects() { } #endif - for (int i = 0; i < _voxel_surfaces.size(); i++) { - Ref surface = _voxel_surfaces[i]; + for (int i = 0; i < _terra_surfaces.size(); i++) { + Ref surface = _terra_surfaces[i]; if (surface.is_valid()) { surface->refresh_rects(); @@ -734,15 +734,15 @@ TerrainLibraryMergerPCM::TerrainLibraryMergerPCM() { } TerrainLibraryMergerPCM::~TerrainLibraryMergerPCM() { - for (int i = 0; i < _voxel_surfaces.size(); ++i) { - Ref surface = _voxel_surfaces[i]; + for (int i = 0; i < _terra_surfaces.size(); ++i) { + Ref surface = _terra_surfaces[i]; if (surface.is_valid()) { surface->set_library(Ref()); } } - _voxel_surfaces.clear(); + _terra_surfaces.clear(); _packer->clear(); _packer.unref(); @@ -807,9 +807,9 @@ void TerrainLibraryMergerPCM::_bind_methods() { ClassDB::bind_method(D_METHOD("set_margin", "size"), &TerrainLibraryMergerPCM::set_margin); ADD_PROPERTY(PropertyInfo(Variant::INT, "margin"), "set_margin", "get_margin"); - ClassDB::bind_method(D_METHOD("get_voxel_surfaces"), &TerrainLibraryMergerPCM::get_voxel_surfaces); - ClassDB::bind_method(D_METHOD("set_voxel_surfaces"), &TerrainLibraryMergerPCM::set_voxel_surfaces); - ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "voxel_surfaces", PROPERTY_HINT_NONE, "17/17:TerrainSurfaceMerger", PROPERTY_USAGE_DEFAULT, "TerrainSurfaceMerger"), "set_voxel_surfaces", "get_voxel_surfaces"); + ClassDB::bind_method(D_METHOD("get_terra_surfaces"), &TerrainLibraryMergerPCM::get_terra_surfaces); + ClassDB::bind_method(D_METHOD("set_terra_surfaces"), &TerrainLibraryMergerPCM::set_terra_surfaces); + ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "terra_surfaces", PROPERTY_HINT_NONE, "17/17:TerrainSurfaceMerger", PROPERTY_USAGE_DEFAULT, "TerrainSurfaceMerger"), "set_terra_surfaces", "get_terra_surfaces"); #ifdef PROPS_PRESENT ClassDB::bind_method(D_METHOD("get_props"), &TerrainLibraryMergerPCM::get_props); diff --git a/library/terrain_library_merger_pcm.h b/library/terrain_library_merger_pcm.h index a220da2..8a68ee8 100644 --- a/library/terrain_library_merger_pcm.h +++ b/library/terrain_library_merger_pcm.h @@ -78,15 +78,15 @@ public: int get_margin() const; void set_margin(const int margin); - Ref voxel_surface_get(const int index); - void voxel_surface_add(Ref value); - void voxel_surface_set(const int index, Ref value); - void voxel_surface_remove(const int index); - int voxel_surface_get_num() const; - void voxel_surfaces_clear(); + Ref terra_surface_get(const int index); + void terra_surface_add(Ref value); + void terra_surface_set(const int index, Ref value); + void terra_surface_remove(const int index); + int terra_surface_get_num() const; + void terra_surfaces_clear(); - Vector get_voxel_surfaces(); - void set_voxel_surfaces(const Vector &surfaces); + Vector get_terra_surfaces(); + void set_terra_surfaces(const Vector &surfaces); #ifdef PROPS_PRESENT Ref get_prop(const int index); @@ -122,7 +122,7 @@ protected: Map > _material_cache; Map > _prop_material_cache; - Vector > _voxel_surfaces; + Vector > _terra_surfaces; #ifdef PROPS_PRESENT Vector > _props; #endif diff --git a/library/terrain_library_simple.cpp b/library/terrain_library_simple.cpp index 8285d99..80fd227 100644 --- a/library/terrain_library_simple.cpp +++ b/library/terrain_library_simple.cpp @@ -43,57 +43,57 @@ void TerrainLibrarySimple::set_atlas_rows(int s) { } //Surfaces -Ref TerrainLibrarySimple::voxel_surface_get(const int index) { - ERR_FAIL_INDEX_V(index, _voxel_surfaces.size(), Ref(NULL)); +Ref TerrainLibrarySimple::terra_surface_get(const int index) { + ERR_FAIL_INDEX_V(index, _terra_surfaces.size(), Ref(NULL)); - return _voxel_surfaces[index]; + return _terra_surfaces[index]; } -void TerrainLibrarySimple::voxel_surface_add(Ref value) { +void TerrainLibrarySimple::terra_surface_add(Ref value) { ERR_FAIL_COND(!value.is_valid()); value->set_library(Ref(this)); - value->set_id(_voxel_surfaces.size()); + value->set_id(_terra_surfaces.size()); - _voxel_surfaces.push_back(value); + _terra_surfaces.push_back(value); } -void TerrainLibrarySimple::voxel_surface_set(const int index, Ref value) { +void TerrainLibrarySimple::terra_surface_set(const int index, Ref value) { ERR_FAIL_COND(index < 0); - if (_voxel_surfaces.size() < index) { - _voxel_surfaces.resize(index + 1); + if (_terra_surfaces.size() < index) { + _terra_surfaces.resize(index + 1); } - if (_voxel_surfaces[index].is_valid()) { - _voxel_surfaces.get(index)->set_library(Ref(NULL)); + if (_terra_surfaces[index].is_valid()) { + _terra_surfaces.get(index)->set_library(Ref(NULL)); } if (value.is_valid()) { value->set_library(Ref(this)); - _voxel_surfaces.set(index, value); + _terra_surfaces.set(index, value); } } -void TerrainLibrarySimple::voxel_surface_remove(const int index) { - _voxel_surfaces.VREMOVE(index); +void TerrainLibrarySimple::terra_surface_remove(const int index) { + _terra_surfaces.VREMOVE(index); } -int TerrainLibrarySimple::voxel_surface_get_num() const { - return _voxel_surfaces.size(); +int TerrainLibrarySimple::terra_surface_get_num() const { + return _terra_surfaces.size(); } -void TerrainLibrarySimple::voxel_surfaces_clear() { - _voxel_surfaces.clear(); +void TerrainLibrarySimple::terra_surfaces_clear() { + _terra_surfaces.clear(); } -Vector TerrainLibrarySimple::get_voxel_surfaces() { - VARIANT_ARRAY_GET(_voxel_surfaces); +Vector TerrainLibrarySimple::get_terra_surfaces() { + VARIANT_ARRAY_GET(_terra_surfaces); } -void TerrainLibrarySimple::set_voxel_surfaces(const Vector &surfaces) { - _voxel_surfaces.clear(); +void TerrainLibrarySimple::set_terra_surfaces(const Vector &surfaces) { + _terra_surfaces.clear(); for (int i = 0; i < surfaces.size(); i++) { Ref surface = Ref(surfaces[i]); @@ -103,15 +103,15 @@ void TerrainLibrarySimple::set_voxel_surfaces(const Vector &surfaces) { surface->refresh_rects(); } - _voxel_surfaces.push_back(surface); + _terra_surfaces.push_back(surface); } set_initialized(true); } void TerrainLibrarySimple::refresh_rects() { - for (int i = 0; i < _voxel_surfaces.size(); i++) { - Ref surface = Ref(_voxel_surfaces[i]); + for (int i = 0; i < _terra_surfaces.size(); i++) { + Ref surface = Ref(_terra_surfaces[i]); if (surface.is_valid()) { surface->refresh_rects(); @@ -125,15 +125,15 @@ TerrainLibrarySimple::TerrainLibrarySimple() { } TerrainLibrarySimple::~TerrainLibrarySimple() { - for (int i = 0; i < _voxel_surfaces.size(); ++i) { - Ref surface = _voxel_surfaces[i]; + for (int i = 0; i < _terra_surfaces.size(); ++i) { + Ref surface = _terra_surfaces[i]; if (surface.is_valid()) { surface->set_library(Ref()); } } - _voxel_surfaces.clear(); + _terra_surfaces.clear(); } void TerrainLibrarySimple::_bind_methods() { @@ -145,7 +145,7 @@ void TerrainLibrarySimple::_bind_methods() { ClassDB::bind_method(D_METHOD("set_atlas_rows", "value"), &TerrainLibrarySimple::set_atlas_rows); ADD_PROPERTY(PropertyInfo(Variant::INT, "atlas_rows"), "set_atlas_rows", "get_atlas_rows"); - ClassDB::bind_method(D_METHOD("get_voxel_surfaces"), &TerrainLibrarySimple::get_voxel_surfaces); - ClassDB::bind_method(D_METHOD("set_voxel_surfaces"), &TerrainLibrarySimple::set_voxel_surfaces); - ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "voxel_surfaces", PROPERTY_HINT_NONE, "17/17:TerrainSurfaceSimple", PROPERTY_USAGE_DEFAULT, "TerrainSurfaceSimple"), "set_voxel_surfaces", "get_voxel_surfaces"); + ClassDB::bind_method(D_METHOD("get_terra_surfaces"), &TerrainLibrarySimple::get_terra_surfaces); + ClassDB::bind_method(D_METHOD("set_terra_surfaces"), &TerrainLibrarySimple::set_terra_surfaces); + ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "terra_surfaces", PROPERTY_HINT_NONE, "17/17:TerrainSurfaceSimple", PROPERTY_USAGE_DEFAULT, "TerrainSurfaceSimple"), "set_terra_surfaces", "get_terra_surfaces"); } diff --git a/library/terrain_library_simple.h b/library/terrain_library_simple.h index 2d2ec84..3992ab9 100644 --- a/library/terrain_library_simple.h +++ b/library/terrain_library_simple.h @@ -51,15 +51,15 @@ public: int get_atlas_rows() const; void set_atlas_rows(int s); - Ref voxel_surface_get(const int index); - void voxel_surface_add(Ref value); - void voxel_surface_set(const int index, Ref value); - void voxel_surface_remove(const int index); - int voxel_surface_get_num() const; - void voxel_surfaces_clear(); + Ref terra_surface_get(const int index); + void terra_surface_add(Ref value); + void terra_surface_set(const int index, Ref value); + void terra_surface_remove(const int index); + int terra_surface_get_num() const; + void terra_surfaces_clear(); - Vector get_voxel_surfaces(); - void set_voxel_surfaces(const Vector &surfaces); + Vector get_terra_surfaces(); + void set_terra_surfaces(const Vector &surfaces); void refresh_rects(); @@ -70,7 +70,7 @@ protected: static void _bind_methods(); private: - Vector > _voxel_surfaces; + Vector > _terra_surfaces; //atlas int _atlas_columns; diff --git a/meshers/blocky/terrain_mesher_blocky.cpp b/meshers/blocky/terrain_mesher_blocky.cpp index fc937f6..6e6caa7 100644 --- a/meshers/blocky/terrain_mesher_blocky.cpp +++ b/meshers/blocky/terrain_mesher_blocky.cpp @@ -120,7 +120,7 @@ void TerrainMesherBlocky::add_chunk_normal(Ref chunk) { Ref surface; if (!mcache.is_valid()) { - surface = _library->voxel_surface_get(type - 1); + surface = _library->terra_surface_get(type - 1); } else { surface = mcache->surface_id_get(type - 1); } @@ -287,7 +287,7 @@ void TerrainMesherBlocky::add_chunk_lod(Ref chunk) { Ref surface; if (!mcache.is_valid()) { - surface = _library->voxel_surface_get(type - 1); + surface = _library->terra_surface_get(type - 1); } else { surface = mcache->surface_id_get(type - 1); } @@ -456,7 +456,7 @@ void TerrainMesherBlocky::create_margin_zmin(Ref chunk) { Ref surface; if (!mcache.is_valid()) { - surface = _library->voxel_surface_get(type - 1); + surface = _library->terra_surface_get(type - 1); } else { surface = mcache->surface_id_get(type - 1); } @@ -628,7 +628,7 @@ void TerrainMesherBlocky::create_margin_zmax(Ref chunk) { Ref surface; if (!mcache.is_valid()) { - surface = _library->voxel_surface_get(type - 1); + surface = _library->terra_surface_get(type - 1); } else { surface = mcache->surface_id_get(type - 1); } @@ -800,7 +800,7 @@ void TerrainMesherBlocky::create_margin_xmin(Ref chunk) { Ref surface; if (!mcache.is_valid()) { - surface = _library->voxel_surface_get(type - 1); + surface = _library->terra_surface_get(type - 1); } else { surface = mcache->surface_id_get(type - 1); } @@ -970,7 +970,7 @@ void TerrainMesherBlocky::create_margin_xmax(Ref chunk) { Ref surface; if (!mcache.is_valid()) { - surface = _library->voxel_surface_get(type - 1); + surface = _library->terra_surface_get(type - 1); } else { surface = mcache->surface_id_get(type - 1); } @@ -1133,7 +1133,7 @@ void TerrainMesherBlocky::create_face(Ref chunk, int dataxm Ref surface; if (!mcache.is_valid()) { - surface = _library->voxel_surface_get(type - 1); + surface = _library->terra_surface_get(type - 1); } else { surface = mcache->surface_id_get(type - 1); } diff --git a/meshers/blocky/terrain_mesher_liquid_blocky.cpp b/meshers/blocky/terrain_mesher_liquid_blocky.cpp index 8a114bb..a381308 100644 --- a/meshers/blocky/terrain_mesher_liquid_blocky.cpp +++ b/meshers/blocky/terrain_mesher_liquid_blocky.cpp @@ -67,8 +67,8 @@ void TerrainMesherLiquidBlocky::_add_chunk(Ref p_chunk) { } Vector liquids; - for (int i = 0; i < _library->voxel_surface_get_num(); ++i) { - Ref surface = _library->voxel_surface_get(i); + for (int i = 0; i < _library->terra_surface_get_num(); ++i) { + Ref surface = _library->terra_surface_get(i); if (!surface.is_valid()) continue; @@ -94,7 +94,7 @@ void TerrainMesherLiquidBlocky::_add_chunk(Ref p_chunk) { if (liquids.find(type) == -1) continue; - Ref surface = _library->voxel_surface_get(type - 1); + Ref surface = _library->terra_surface_get(type - 1); if (!surface.is_valid()) continue; diff --git a/world/terrain_world_editor.cpp b/world/terrain_world_editor.cpp index 5f87440..92cc67e 100644 --- a/world/terrain_world_editor.cpp +++ b/world/terrain_world_editor.cpp @@ -182,8 +182,8 @@ void TerrainWorldEditor::edit(TerrainWorld *p_world) { library->refresh_rects(); bool f = false; - for (int i = 0; i < library->voxel_surface_get_num(); ++i) { - Ref surface = library->voxel_surface_get(i); + for (int i = 0; i < library->terra_surface_get_num(); ++i) { + Ref surface = library->terra_surface_get(i); if (!surface.is_valid()) continue;