diff --git a/modules/voxelman/areas/world_area.h b/modules/voxelman/areas/world_area.h index 2c5113059..88cc52c01 100644 --- a/modules/voxelman/areas/world_area.h +++ b/modules/voxelman/areas/world_area.h @@ -22,21 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - -#include "core/version.h" - -#if VERSION_MAJOR > 3 -#include "core/object/ref_counted.h" -#ifndef Reference -#define Reference RefCounted -#endif -#include "core/string/ustring.h" -#else #include "core/reference.h" #include "core/ustring.h" -#endif #include "core/math/aabb.h" #include "scene/resources/texture.h" diff --git a/modules/voxelman/data/voxel_light.h b/modules/voxelman/data/voxel_light.h index 38b7d06a7..01a59be9e 100644 --- a/modules/voxelman/data/voxel_light.h +++ b/modules/voxelman/data/voxel_light.h @@ -22,23 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - -#include "core/version.h" - -#if VERSION_MAJOR > 3 -#include "core/object/ref_counted.h" -#ifndef Reference -#define Reference RefCounted -#endif -#include "core/templates/vector.h" -#include "core/math/color.h" -#else +#include "core/color.h" #include "core/reference.h" #include "core/vector.h" -#include "core/color.h" -#endif class VoxelLight : public Reference { GDCLASS(VoxelLight, Reference); diff --git a/modules/voxelman/level_generator/voxel_level_generator.cpp b/modules/voxelman/level_generator/voxel_level_generator.cpp index 21da49c6e..0fba4665c 100644 --- a/modules/voxelman/level_generator/voxel_level_generator.cpp +++ b/modules/voxelman/level_generator/voxel_level_generator.cpp @@ -27,13 +27,9 @@ SOFTWARE. #include "../world/voxel_chunk.h" void VoxelLevelGenerator::generate_chunk(Ref chunk) { -#if VERSION_MAJOR < 4 if (has_method("_generate_chunk")) { call("_generate_chunk", chunk); } -#else - GDVIRTUAL_CALL(_generate_chunk, chunk); -#endif } VoxelLevelGenerator::VoxelLevelGenerator() { @@ -43,11 +39,7 @@ VoxelLevelGenerator::~VoxelLevelGenerator() { } void VoxelLevelGenerator::_bind_methods() { -#if VERSION_MAJOR < 4 BIND_VMETHOD(MethodInfo("_generate_chunk", PropertyInfo(Variant::OBJECT, "chunk", PROPERTY_HINT_RESOURCE_TYPE, "VoxelChunk"))); -#else - GDVIRTUAL_BIND(_generate_chunk, "chunk"); -#endif ClassDB::bind_method(D_METHOD("generate_chunk", "chunk"), &VoxelLevelGenerator::generate_chunk); } diff --git a/modules/voxelman/level_generator/voxel_level_generator.h b/modules/voxelman/level_generator/voxel_level_generator.h index 1fc9ad574..db309082d 100644 --- a/modules/voxelman/level_generator/voxel_level_generator.h +++ b/modules/voxelman/level_generator/voxel_level_generator.h @@ -22,18 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - -#include "core/version.h" - -#if VERSION_MAJOR > 3 -#include "core/io/resource.h" -#include "core/object/gdvirtual.gen.inc" -#include "core/object/script_language.h" -#else #include "core/resource.h" -#endif class VoxelChunk; @@ -43,10 +32,6 @@ class VoxelLevelGenerator : public Resource { public: void generate_chunk(Ref chunk); -#if VERSION_MAJOR >= 4 - GDVIRTUAL1(_generate_chunk, Ref); -#endif - VoxelLevelGenerator(); ~VoxelLevelGenerator(); diff --git a/modules/voxelman/level_generator/voxel_level_generator_flat.h b/modules/voxelman/level_generator/voxel_level_generator_flat.h index dac5eb27f..1c918de07 100644 --- a/modules/voxelman/level_generator/voxel_level_generator_flat.h +++ b/modules/voxelman/level_generator/voxel_level_generator_flat.h @@ -22,9 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - #include "voxel_level_generator.h" class VoxelChunk; diff --git a/modules/voxelman/library/voxel_library.cpp b/modules/voxelman/library/voxel_library.cpp index 15ac0a97f..3e854b92b 100644 --- a/modules/voxelman/library/voxel_library.cpp +++ b/modules/voxelman/library/voxel_library.cpp @@ -47,7 +47,6 @@ bool VoxelLibrary::_supports_caching() { return false; } - //Materials Ref VoxelLibrary::material_get(const int index) { ERR_FAIL_INDEX_V(index, _materials.size(), Ref()); @@ -103,11 +102,7 @@ void VoxelLibrary::material_set(const int index, const Ref &value) { } void VoxelLibrary::material_remove(const int index) { -#if VERSION_MAJOR <= 3 _materials.remove(index); -#else - _materials.remove_at(index); -#endif } int VoxelLibrary::material_get_num() const { @@ -174,7 +169,6 @@ void VoxelLibrary::liquid_material_cache_unref(const int key) { void VoxelLibrary::_liquid_material_cache_unref(const int key) { } - void VoxelLibrary::liquid_material_add(const Ref &value) { ERR_FAIL_COND(!value.is_valid()); @@ -188,11 +182,7 @@ void VoxelLibrary::liquid_material_set(const int index, const Ref &val } void VoxelLibrary::liquid_material_remove(const int index) { -#if VERSION_MAJOR <= 3 _liquid_materials.remove(index); -#else - _liquid_materials.remove_at(index); -#endif } int VoxelLibrary::liquid_material_get_num() const { @@ -259,7 +249,6 @@ void VoxelLibrary::prop_material_cache_unref(const int key) { void VoxelLibrary::_prop_material_cache_unref(const int key) { } - void VoxelLibrary::prop_material_add(const Ref &value) { ERR_FAIL_COND(!value.is_valid()); @@ -273,11 +262,7 @@ void VoxelLibrary::prop_material_set(const int index, const Ref &value } void VoxelLibrary::prop_material_remove(const int index) { -#if VERSION_MAJOR <= 3 _prop_materials.remove(index); -#else - _prop_materials.remove_at(index); -#endif } int VoxelLibrary::prop_material_get_num() const { @@ -357,13 +342,9 @@ void VoxelLibrary::refresh_rects() { } void VoxelLibrary::setup_material_albedo(int material_index, Ref texture) { -#if VERSION_MAJOR < 4 if (has_method("_setup_material_albedo")) { call("_setup_material_albedo", material_index, texture); } -#else - GDVIRTUAL_CALL(_setup_material_albedo, material_index, texture); -#endif } VoxelLibrary::VoxelLibrary() { @@ -381,30 +362,16 @@ void VoxelLibrary::_bind_methods() { ClassDB::bind_method(D_METHOD("set_initialized", "value"), &VoxelLibrary::set_initialized); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "initialized", PROPERTY_HINT_NONE, "", 0), "set_initialized", "get_initialized"); -#if VERSION_MAJOR < 4 BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::BOOL, "ret"), "_supports_caching")); -#else - GDVIRTUAL_BIND(_supports_caching); -#endif ClassDB::bind_method(D_METHOD("_supports_caching"), &VoxelLibrary::_supports_caching); ClassDB::bind_method(D_METHOD("supports_caching"), &VoxelLibrary::supports_caching); -#if VERSION_MAJOR < 4 BIND_VMETHOD(MethodInfo("_setup_material_albedo", PropertyInfo(Variant::INT, "material_index"), PropertyInfo(Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"))); -#else - GDVIRTUAL_BIND(_setup_material_albedo, "material_index", "texture"); -#endif -#if VERSION_MAJOR < 4 BIND_VMETHOD(MethodInfo("_material_cache_get_key", PropertyInfo(Variant::OBJECT, "chunk", PROPERTY_HINT_RESOURCE_TYPE, "VoxelChunk"))); BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::OBJECT, "ret", PROPERTY_HINT_RESOURCE_TYPE, "TerrainMaterialCache"), "_material_cache_get", PropertyInfo(Variant::INT, "key"))); BIND_VMETHOD(MethodInfo("_material_cache_unref", PropertyInfo(Variant::INT, "key"))); -#else - GDVIRTUAL_BIND(_material_cache_get_key, "chunk", "texture"); - GDVIRTUAL_BIND(_material_cache_get, "key"); - GDVIRTUAL_BIND(_material_cache_unref, "key"); -#endif ClassDB::bind_method(D_METHOD("material_get", "index"), &VoxelLibrary::material_get); ClassDB::bind_method(D_METHOD("material_lod_get", "index"), &VoxelLibrary::material_lod_get); @@ -426,15 +393,9 @@ void VoxelLibrary::_bind_methods() { ClassDB::bind_method(D_METHOD("materials_set"), &VoxelLibrary::materials_set); ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "materials", PROPERTY_HINT_NONE, "17/17:Material", PROPERTY_USAGE_DEFAULT, "Material"), "materials_set", "materials_get"); -#if VERSION_MAJOR < 4 BIND_VMETHOD(MethodInfo("_liquid_material_cache_get_key", PropertyInfo(Variant::OBJECT, "chunk", PROPERTY_HINT_RESOURCE_TYPE, "VoxelChunk"))); BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::OBJECT, "ret", PROPERTY_HINT_RESOURCE_TYPE, "TerrainMaterialCache"), "_liquid_material_cache_get", PropertyInfo(Variant::INT, "key"))); BIND_VMETHOD(MethodInfo("_liquid_material_cache_unref", PropertyInfo(Variant::INT, "key"))); -#else - GDVIRTUAL_BIND(_liquid_material_cache_get_key, "chunk", "texture"); - GDVIRTUAL_BIND(_liquid_material_cache_get, "key"); - GDVIRTUAL_BIND(_liquid_material_cache_unref, "key"); -#endif ClassDB::bind_method(D_METHOD("liquid_material_get", "index"), &VoxelLibrary::liquid_material_get); ClassDB::bind_method(D_METHOD("liquid_material_lod_get", "index"), &VoxelLibrary::liquid_material_lod_get); @@ -456,15 +417,9 @@ void VoxelLibrary::_bind_methods() { ClassDB::bind_method(D_METHOD("liquid_materials_set"), &VoxelLibrary::liquid_materials_set); ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "liquid_materials", PROPERTY_HINT_NONE, "17/17:Material", PROPERTY_USAGE_DEFAULT, "Material"), "liquid_materials_set", "liquid_materials_get"); -#if VERSION_MAJOR < 4 BIND_VMETHOD(MethodInfo("_prop_material_cache_get_key", PropertyInfo(Variant::OBJECT, "chunk", PROPERTY_HINT_RESOURCE_TYPE, "VoxelChunk"))); BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::OBJECT, "ret", PROPERTY_HINT_RESOURCE_TYPE, "TerrainMaterialCache"), "_prop_material_cache_get", PropertyInfo(Variant::INT, "key"))); BIND_VMETHOD(MethodInfo("_prop_material_cache_unref", PropertyInfo(Variant::INT, "key"))); -#else - GDVIRTUAL_BIND(_prop_material_cache_get_key, "chunk", "texture"); - GDVIRTUAL_BIND(_prop_material_cache_get, "key"); - GDVIRTUAL_BIND(_prop_material_cache_unref, "key"); -#endif ClassDB::bind_method(D_METHOD("prop_material_get", "index"), &VoxelLibrary::prop_material_get); ClassDB::bind_method(D_METHOD("prop_material_lod_get", "index"), &VoxelLibrary::prop_material_lod_get); diff --git a/modules/voxelman/library/voxel_library.h b/modules/voxelman/library/voxel_library.h index bca97b75e..bbaed9980 100644 --- a/modules/voxelman/library/voxel_library.h +++ b/modules/voxelman/library/voxel_library.h @@ -22,16 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - -#include "core/version.h" - -#if VERSION_MAJOR > 3 -#include "core/io/resource.h" -#else #include "core/resource.h" -#endif #include "core/math/rect2.h" #include "scene/resources/material.h" @@ -41,10 +32,6 @@ SOFTWARE. #include "../defines.h" -#if GODOT4 -#define Texture Texture2D -#endif - class VoxelMaterialCache; class VoxelChunk; class VoxelSurface; @@ -158,11 +145,6 @@ public: void setup_material_albedo(int material_index, Ref texture); - -#if VERSION_MAJOR >= 4 - GDVIRTUAL2(_setup_material_albedo, int, Ref); -#endif - VoxelLibrary(); ~VoxelLibrary(); @@ -170,9 +152,9 @@ protected: static void _bind_methods(); bool _initialized; - Vector > _materials; - Vector > _liquid_materials; - Vector > _prop_materials; + Vector> _materials; + Vector> _liquid_materials; + Vector> _prop_materials; }; #endif // VOXEL_LIBRARY_H diff --git a/modules/voxelman/library/voxel_library_merger.cpp b/modules/voxelman/library/voxel_library_merger.cpp index 6937319cb..e1b178e67 100644 --- a/modules/voxelman/library/voxel_library_merger.cpp +++ b/modules/voxelman/library/voxel_library_merger.cpp @@ -207,11 +207,7 @@ Rect2 VoxelLibraryMerger::get_prop_uv_rect(const Ref &texture) { return Rect2(0, 0, 1, 1); } -#if VERSION_MAJOR < 4 Ref image = tex->get_data(); -#else - Ref image = tex->get_image(); -#endif if (!image.is_valid()) { return Rect2(0, 0, 1, 1); @@ -371,11 +367,7 @@ void VoxelLibraryMerger::_setup_material_albedo(const int material_index, const VoxelLibraryMerger::VoxelLibraryMerger() { _packer.INSTANCE(); -#if GODOT4 -#warning implement -#else _packer->set_texture_flags(Texture::FLAG_MIPMAPS | Texture::FLAG_FILTER); -#endif _packer->set_max_atlas_size(1024); _packer->set_keep_original_atlases(false); @@ -383,11 +375,7 @@ VoxelLibraryMerger::VoxelLibraryMerger() { _prop_packer.INSTANCE(); -#if GODOT4 -#warning implement -#else _prop_packer->set_texture_flags(Texture::FLAG_MIPMAPS | Texture::FLAG_FILTER); -#endif _prop_packer->set_max_atlas_size(1024); _prop_packer->set_keep_original_atlases(false); diff --git a/modules/voxelman/library/voxel_library_merger.h b/modules/voxelman/library/voxel_library_merger.h index d96887308..aa2996904 100644 --- a/modules/voxelman/library/voxel_library_merger.h +++ b/modules/voxelman/library/voxel_library_merger.h @@ -22,18 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - -#include "core/version.h" - -#if VERSION_MAJOR > 3 -#include "core/io/resource.h" -#include "core/templates/map.h" -#else #include "core/resource.h" #include "core/map.h" -#endif #include "voxel_library.h" diff --git a/modules/voxelman/library/voxel_library_merger_pcm.cpp b/modules/voxelman/library/voxel_library_merger_pcm.cpp index 3a63ca956..d33ebeae0 100644 --- a/modules/voxelman/library/voxel_library_merger_pcm.cpp +++ b/modules/voxelman/library/voxel_library_merger_pcm.cpp @@ -710,11 +710,7 @@ void VoxelLibraryMergerPCM::_setup_material_albedo(const int material_index, con VoxelLibraryMergerPCM::VoxelLibraryMergerPCM() { _packer.instance(); -#if GODOT4 -#warning implement -#else _packer->set_texture_flags(Texture::FLAG_MIPMAPS | Texture::FLAG_FILTER); -#endif _packer->set_max_atlas_size(1024); _packer->set_keep_original_atlases(false); @@ -722,11 +718,7 @@ VoxelLibraryMergerPCM::VoxelLibraryMergerPCM() { _prop_packer.instance(); -#if GODOT4 -#warning implement -#else _prop_packer->set_texture_flags(Texture::FLAG_MIPMAPS | Texture::FLAG_FILTER); -#endif _prop_packer->set_max_atlas_size(1024); _prop_packer->set_keep_original_atlases(false); diff --git a/modules/voxelman/library/voxel_library_merger_pcm.h b/modules/voxelman/library/voxel_library_merger_pcm.h index 468c5285b..63b822621 100644 --- a/modules/voxelman/library/voxel_library_merger_pcm.h +++ b/modules/voxelman/library/voxel_library_merger_pcm.h @@ -22,18 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - -#include "core/version.h" - -#if VERSION_MAJOR > 3 -#include "core/io/resource.h" -#include "core/templates/map.h" -#else -#include "core/resource.h" #include "core/map.h" -#endif +#include "core/resource.h" #include "voxel_library.h" @@ -123,12 +113,12 @@ protected: static void _bind_methods(); - Map > _material_cache; - Map > _prop_material_cache; + Map> _material_cache; + Map> _prop_material_cache; - Vector > _voxel_surfaces; + Vector> _voxel_surfaces; #ifdef PROPS_PRESENT - Vector > _props; + Vector> _props; #endif //todo remove these diff --git a/modules/voxelman/library/voxel_library_simple.h b/modules/voxelman/library/voxel_library_simple.h index b0a45b933..bcd8be416 100644 --- a/modules/voxelman/library/voxel_library_simple.h +++ b/modules/voxelman/library/voxel_library_simple.h @@ -22,19 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - -#include "core/version.h" - -#if VERSION_MAJOR > 3 -#include "core/object/ref_counted.h" -#ifndef Reference -#define Reference RefCounted -#endif -#else #include "core/resource.h" -#endif #include "voxel_library.h" @@ -74,7 +62,7 @@ public: protected: static void _bind_methods(); - Vector > _voxel_surfaces; + Vector> _voxel_surfaces; //atlas int _atlas_columns; diff --git a/modules/voxelman/library/voxel_material_cache.cpp b/modules/voxelman/library/voxel_material_cache.cpp index 47b8ed4bc..35a51c765 100644 --- a/modules/voxelman/library/voxel_material_cache.cpp +++ b/modules/voxelman/library/voxel_material_cache.cpp @@ -256,13 +256,9 @@ void VoxelMaterialCache::refresh_rects() { } void VoxelMaterialCache::setup_material_albedo(Ref texture) { -#if VERSION_MAJOR < 4 if (has_method("_setup_material_albedo")) { call("_setup_material_albedo", texture); } -#else - GDVIRTUAL_CALL(_setup_material_albedo, texture); -#endif } VoxelMaterialCache::VoxelMaterialCache() { @@ -286,11 +282,7 @@ void VoxelMaterialCache::_bind_methods() { ClassDB::bind_method(D_METHOD("inc_ref_count"), &VoxelMaterialCache::inc_ref_count); ClassDB::bind_method(D_METHOD("dec_ref_count"), &VoxelMaterialCache::dec_ref_count); -#if VERSION_MAJOR < 4 BIND_VMETHOD(MethodInfo("_setup_material_albedo", PropertyInfo(Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"))); -#else - GDVIRTUAL_BIND(_setup_material_albedo, "texture"); -#endif ClassDB::bind_method(D_METHOD("material_get", "index"), &VoxelMaterialCache::material_get); ClassDB::bind_method(D_METHOD("material_lod_get", "index"), &VoxelMaterialCache::material_lod_get); diff --git a/modules/voxelman/library/voxel_material_cache.h b/modules/voxelman/library/voxel_material_cache.h index 3d3f696a8..0365c2b9e 100644 --- a/modules/voxelman/library/voxel_material_cache.h +++ b/modules/voxelman/library/voxel_material_cache.h @@ -22,20 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - -#include "core/version.h" - -#if VERSION_MAJOR > 3 -#include "core/io/resource.h" -#include "core/math/color.h" -#include "core/templates/vector.h" -#else #include "core/color.h" #include "core/resource.h" #include "core/vector.h" -#endif #include "core/math/rect2.h" #include "scene/resources/material.h" @@ -96,10 +85,6 @@ public: void setup_material_albedo(Ref texture); -#if VERSION_MAJOR >= 4 - GDVIRTUAL1(_setup_material_albedo, Ref); -#endif - VoxelMaterialCache(); ~VoxelMaterialCache(); diff --git a/modules/voxelman/library/voxel_material_cache_pcm.h b/modules/voxelman/library/voxel_material_cache_pcm.h index b3e6d1e58..ab4ed3c35 100644 --- a/modules/voxelman/library/voxel_material_cache_pcm.h +++ b/modules/voxelman/library/voxel_material_cache_pcm.h @@ -22,22 +22,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - #include "voxel_material_cache.h" -#include "core/version.h" - -#if VERSION_MAJOR > 3 -#include "core/io/resource.h" -#include "core/math/color.h" -#include "core/templates/vector.h" -#else #include "core/color.h" #include "core/resource.h" #include "core/vector.h" -#endif #include "core/math/rect2.h" #include "scene/resources/material.h" diff --git a/modules/voxelman/library/voxel_surface.h b/modules/voxelman/library/voxel_surface.h index a241649c1..61230634a 100644 --- a/modules/voxelman/library/voxel_surface.h +++ b/modules/voxelman/library/voxel_surface.h @@ -22,21 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - - -#include "core/version.h" - -#if VERSION_MAJOR > 3 -#include "core/io/resource.h" -#include "core/templates/vector.h" -#include "core/math/color.h" -#else +#include "core/color.h" #include "core/resource.h" #include "core/vector.h" -#include "core/color.h" -#endif #include "core/math/rect2.h" #include "scene/resources/material.h" @@ -57,9 +45,9 @@ public: I_____I/ - I y - I I - O----- x I B + I y + I I + O----- x I B / I F I / / z+ I ---I/ */ diff --git a/modules/voxelman/library/voxel_surface_merger.cpp b/modules/voxelman/library/voxel_surface_merger.cpp index 02f4c83af..45628cc0e 100644 --- a/modules/voxelman/library/voxel_surface_merger.cpp +++ b/modules/voxelman/library/voxel_surface_merger.cpp @@ -24,12 +24,6 @@ SOFTWARE. #include "voxel_library_merger.h" -#include "../defines.h" - -#if GODOT4 -#define Texture Texture2D -#endif - Ref VoxelSurfaceMerger::get_region(const VoxelSurfaceSides side) { return _regions[side]; } diff --git a/modules/voxelman/library/voxel_surface_merger.h b/modules/voxelman/library/voxel_surface_merger.h index 987848d85..513dfaaf4 100644 --- a/modules/voxelman/library/voxel_surface_merger.h +++ b/modules/voxelman/library/voxel_surface_merger.h @@ -22,21 +22,12 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - #include "voxel_surface.h" #include "scene/resources/texture.h" #include "../../texture_packer/texture_packer.h" -#include "../defines.h" - -#if GODOT4 -#define Texture Texture2D -#endif - class VoxelSurfaceMerger : public VoxelSurface { GDCLASS(VoxelSurfaceMerger, VoxelSurface) diff --git a/modules/voxelman/library/voxel_surface_simple.h b/modules/voxelman/library/voxel_surface_simple.h index 185827f32..50f1e927b 100644 --- a/modules/voxelman/library/voxel_surface_simple.h +++ b/modules/voxelman/library/voxel_surface_simple.h @@ -22,9 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - #include "voxel_surface.h" class VoxelSurfaceSimple : public VoxelSurface { diff --git a/modules/voxelman/meshers/blocky/voxel_mesher_blocky.h b/modules/voxelman/meshers/blocky/voxel_mesher_blocky.h index 9c1391d56..22b8bd65b 100644 --- a/modules/voxelman/meshers/blocky/voxel_mesher_blocky.h +++ b/modules/voxelman/meshers/blocky/voxel_mesher_blocky.h @@ -22,16 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - -#include "core/version.h" - -#if VERSION_MAJOR > 3 -#include "core/math/color.h" -#else #include "core/color.h" -#endif #include "core/math/vector2.h" #include "core/math/vector3.h" diff --git a/modules/voxelman/meshers/blocky/voxel_mesher_liquid_blocky.h b/modules/voxelman/meshers/blocky/voxel_mesher_liquid_blocky.h index e37e24b5d..cd199e16c 100644 --- a/modules/voxelman/meshers/blocky/voxel_mesher_liquid_blocky.h +++ b/modules/voxelman/meshers/blocky/voxel_mesher_liquid_blocky.h @@ -22,16 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - -#include "core/version.h" - -#if VERSION_MAJOR > 3 -#include "core/math/color.h" -#else #include "core/color.h" -#endif #include "core/math/vector2.h" #include "core/math/vector3.h" diff --git a/modules/voxelman/meshers/cubic/voxel_cube_points.cpp b/modules/voxelman/meshers/cubic/voxel_cube_points.cpp index e49a0eda7..5582f08ce 100644 --- a/modules/voxelman/meshers/cubic/voxel_cube_points.cpp +++ b/modules/voxelman/meshers/cubic/voxel_cube_points.cpp @@ -815,7 +815,6 @@ VoxelCubePoints::~VoxelCubePoints() { } void VoxelCubePoints::_bind_methods() { - ClassDB::bind_method(D_METHOD("get_x"), &VoxelCubePoints::get_x); ClassDB::bind_method(D_METHOD("set_x", "value"), &VoxelCubePoints::set_x); ADD_PROPERTY(PropertyInfo(Variant::INT, "x"), "set_x", "get_x"); diff --git a/modules/voxelman/meshers/cubic/voxel_cube_points.h b/modules/voxelman/meshers/cubic/voxel_cube_points.h index 324f8cbd2..d48fd95b8 100644 --- a/modules/voxelman/meshers/cubic/voxel_cube_points.h +++ b/modules/voxelman/meshers/cubic/voxel_cube_points.h @@ -22,21 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - -#include "core/version.h" - -#if VERSION_MAJOR > 3 -#include "core/object/ref_counted.h" -#ifndef Reference -#define Reference RefCounted -#endif -#include "core/templates/vector.h" -#else #include "core/reference.h" #include "core/vector.h" -#endif class VoxelChunk; class SubVoxelFacePointsHelper; diff --git a/modules/voxelman/meshers/cubic/voxel_mesher_cubic.h b/modules/voxelman/meshers/cubic/voxel_mesher_cubic.h index 88924e054..3dda27ac3 100644 --- a/modules/voxelman/meshers/cubic/voxel_mesher_cubic.h +++ b/modules/voxelman/meshers/cubic/voxel_mesher_cubic.h @@ -22,16 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - -#include "core/version.h" - -#if VERSION_MAJOR > 3 -#include "core/math/color.h" -#else #include "core/color.h" -#endif #include "core/math/vector2.h" #include "core/math/vector3.h" diff --git a/modules/voxelman/meshers/default/voxel_mesher_default.h b/modules/voxelman/meshers/default/voxel_mesher_default.h index 2b162e35d..d4e829a6c 100644 --- a/modules/voxelman/meshers/default/voxel_mesher_default.h +++ b/modules/voxelman/meshers/default/voxel_mesher_default.h @@ -22,16 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - -#include "core/version.h" - -#if VERSION_MAJOR > 3 -#include "core/math/color.h" -#else #include "core/color.h" -#endif #include "core/math/vector2.h" #include "core/math/vector3.h" diff --git a/modules/voxelman/meshers/marching_cubes/marching_cubes_cell_data.h b/modules/voxelman/meshers/marching_cubes/marching_cubes_cell_data.h index 37ab4b269..67e8f1de4 100644 --- a/modules/voxelman/meshers/marching_cubes/marching_cubes_cell_data.h +++ b/modules/voxelman/meshers/marching_cubes/marching_cubes_cell_data.h @@ -22,20 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - #include "core/version.h" -#if VERSION_MAJOR > 3 -#include "core/object/ref_counted.h" -#ifndef Reference -#define Reference RefCounted -#endif -#else #include "core/reference.h" -#endif - #include "marching_cubes_tables.h" diff --git a/modules/voxelman/meshers/marching_cubes/marching_cubes_tables.h b/modules/voxelman/meshers/marching_cubes/marching_cubes_tables.h index 49f455e32..b7b50a6b5 100644 --- a/modules/voxelman/meshers/marching_cubes/marching_cubes_tables.h +++ b/modules/voxelman/meshers/marching_cubes/marching_cubes_tables.h @@ -34,9 +34,6 @@ // //================================================================================ - - - #include "core/math/vector3.h" namespace MarchingCubes { diff --git a/modules/voxelman/meshers/marching_cubes/voxel_mesher_marching_cubes.cpp b/modules/voxelman/meshers/marching_cubes/voxel_mesher_marching_cubes.cpp index 2945c2859..c697c4504 100644 --- a/modules/voxelman/meshers/marching_cubes/voxel_mesher_marching_cubes.cpp +++ b/modules/voxelman/meshers/marching_cubes/voxel_mesher_marching_cubes.cpp @@ -20,15 +20,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "core/version.h" - -#if VERSION_MAJOR > 3 -#include "core/variant/array.h" -#include "core/variant/dictionary.h" -#else #include "core/array.h" #include "core/dictionary.h" -#endif #include "voxel_mesher_marching_cubes.h" @@ -39,13 +32,7 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR < 4 #include "servers/visual_server.h" -#else -#include "servers/rendering_server.h" - -typedef class RenderingServer VisualServer; -#endif void VoxelMesherMarchingCubes::get_voxel_type_array(int *arr, Ref chunk, const int x, const int y, const int z, const int size) { uint8_t *channel_type = chunk->channel_get(_channel_index_type); diff --git a/modules/voxelman/meshers/marching_cubes/voxel_mesher_marching_cubes.h b/modules/voxelman/meshers/marching_cubes/voxel_mesher_marching_cubes.h index 2dc45ecab..4ba7d4d3e 100644 --- a/modules/voxelman/meshers/marching_cubes/voxel_mesher_marching_cubes.h +++ b/modules/voxelman/meshers/marching_cubes/voxel_mesher_marching_cubes.h @@ -22,19 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - #include "core/version.h" -#if VERSION_MAJOR > 3 -#include "core/object/ref_counted.h" -#ifndef Reference -#define Reference RefCounted -#endif -#else #include "core/reference.h" -#endif #include "../default/voxel_mesher_default.h" #include "marching_cubes_cell_data.h" diff --git a/modules/voxelman/meshers/voxel_mesher.cpp b/modules/voxelman/meshers/voxel_mesher.cpp index a995a3471..ee1c6802a 100644 --- a/modules/voxelman/meshers/voxel_mesher.cpp +++ b/modules/voxelman/meshers/voxel_mesher.cpp @@ -350,11 +350,7 @@ void VoxelMesher::remove_doubles() { for (int j = 0; j < indices.size(); ++j) { int index = indices[j]; -#if VERSION_MAJOR < 4 _vertices.remove(index); -#else - _vertices.remove_at(index); -#endif //make all indices that were bigger than the one we replaced one lower for (int k = 0; k < _indices.size(); ++k) { @@ -406,13 +402,8 @@ void VoxelMesher::remove_doubles_hashed() { for (int j = 0; j < indices.size(); ++j) { int index = indices[j]; -#if VERSION_MAJOR < 4 hashes.remove(index); _vertices.remove(index); -#else - hashes.remove_at(index); - _vertices.remove_at(index); -#endif //make all indices that were bigger than the one we replaced one lower for (int k = 0; k < _indices.size(); ++k) { @@ -753,11 +744,7 @@ Vector3 VoxelMesher::get_vertex(const int idx) const { } void VoxelMesher::remove_vertex(const int idx) { -#if VERSION_MAJOR < 4 _vertices.remove(idx); -#else - _vertices.remove_at(idx); -#endif } PoolVector VoxelMesher::get_normals() const { @@ -905,11 +892,7 @@ int VoxelMesher::get_index(const int idx) const { } void VoxelMesher::remove_index(const int idx) { -#if VERSION_MAJOR < 4 _indices.remove(idx); -#else - _indices.remove_at(idx); -#endif } VoxelMesher::VoxelMesher(const Ref &library) { @@ -948,15 +931,9 @@ VoxelMesher::~VoxelMesher() { } void VoxelMesher::_bind_methods() { -#if VERSION_MAJOR < 4 BIND_VMETHOD(MethodInfo("_add_chunk", PropertyInfo(Variant::OBJECT, "chunk", PROPERTY_HINT_RESOURCE_TYPE, "VoxelChunk"))); BIND_VMETHOD(MethodInfo("_bake_colors", PropertyInfo(Variant::OBJECT, "chunk", PROPERTY_HINT_RESOURCE_TYPE, "VoxelChunk"))); BIND_VMETHOD(MethodInfo("_bake_liquid_colors", PropertyInfo(Variant::OBJECT, "chunk", PROPERTY_HINT_RESOURCE_TYPE, "VoxelChunk"))); -#else - GDVIRTUAL_BIND(_add_chunk, "chunk"); - GDVIRTUAL_BIND(_bake_colors, "chunk"); - GDVIRTUAL_BIND(_bake_liquid_colors, "chunk"); -#endif ClassDB::bind_method(D_METHOD("get_channel_index_type"), &VoxelMesher::get_channel_index_type); ClassDB::bind_method(D_METHOD("set_channel_index_type", "value"), &VoxelMesher::set_channel_index_type); @@ -1014,11 +991,7 @@ void VoxelMesher::_bind_methods() { ClassDB::bind_method(D_METHOD("add_mesh_data_resource_transform_colored", "mesh", "transform", "colors", "uv_rect"), &VoxelMesher::add_mesh_data_resource_transform_colored, DEFVAL(Rect2(0, 0, 1, 1))); #endif -#if VERSION_MAJOR < 4 BIND_VMETHOD(MethodInfo("_add_mesher", PropertyInfo(Variant::OBJECT, "mesher", PROPERTY_HINT_RESOURCE_TYPE, "VoxelMesher"))); -#else - GDVIRTUAL_BIND(_add_mesher, "mesher"); -#endif ClassDB::bind_method(D_METHOD("add_mesher", "mesher"), &VoxelMesher::add_mesher); ClassDB::bind_method(D_METHOD("_add_mesher", "mesher"), &VoxelMesher::_add_mesher); diff --git a/modules/voxelman/meshers/voxel_mesher.h b/modules/voxelman/meshers/voxel_mesher.h index f382316ac..adbb2c0ce 100644 --- a/modules/voxelman/meshers/voxel_mesher.h +++ b/modules/voxelman/meshers/voxel_mesher.h @@ -22,23 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - -#include "core/version.h" - -#if VERSION_MAJOR > 3 -#include "core/object/ref_counted.h" -#ifndef Reference -#define Reference RefCounted -#endif -#include "core/templates/vector.h" -#include "core/math/color.h" -#else +#include "core/color.h" #include "core/reference.h" #include "core/vector.h" -#include "core/color.h" -#endif #include "../defines.h" @@ -71,7 +57,6 @@ class VoxelMesher : public Reference { public: struct Vertex { - Vector3 vertex; Color color; Vector3 normal; // normal, binormal, tangent @@ -154,7 +139,7 @@ public: PoolVector build_collider() const; - void bake_lights(MeshInstance *node, Vector > &lights); + void bake_lights(MeshInstance *node, Vector> &lights); Array build_mesh(); void build_mesh_into(RID mesh); @@ -197,13 +182,6 @@ public: void remove_index(const int idx); void add_indices(const int index); -#if VERSION_MAJOR >= 4 - GDVIRTUAL1(_add_chunk, Ref); - GDVIRTUAL1(_bake_colors, Ref); - GDVIRTUAL1(_bake_liquid_colors, Ref); - GDVIRTUAL1(_add_mesher, Ref); -#endif - VoxelMesher(const Ref &library); VoxelMesher(); ~VoxelMesher(); diff --git a/modules/voxelman/nodes/voxel_light_node.h b/modules/voxelman/nodes/voxel_light_node.h index d98f60a40..74d6d27a8 100644 --- a/modules/voxelman/nodes/voxel_light_node.h +++ b/modules/voxelman/nodes/voxel_light_node.h @@ -27,13 +27,7 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR < 4 #include "scene/3d/spatial.h" -#else -#include "scene/3d/node_3d.h" - -#define Spatial Node3D -#endif #include "core/math/vector3.h" diff --git a/modules/voxelman/world/blocky/voxel_chunk_blocky.h b/modules/voxelman/world/blocky/voxel_chunk_blocky.h index c9cd8088d..28a424d6a 100644 --- a/modules/voxelman/world/blocky/voxel_chunk_blocky.h +++ b/modules/voxelman/world/blocky/voxel_chunk_blocky.h @@ -22,9 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - #include "../default/voxel_chunk_default.h" class VoxelChunkBlocky : public VoxelChunkDefault { diff --git a/modules/voxelman/world/blocky/voxel_world_blocky.h b/modules/voxelman/world/blocky/voxel_world_blocky.h index d4bab5a1e..04c1cf6c6 100644 --- a/modules/voxelman/world/blocky/voxel_world_blocky.h +++ b/modules/voxelman/world/blocky/voxel_world_blocky.h @@ -22,9 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - #include "../default/voxel_world_default.h" class VoxelWorldBlocky : public VoxelWorldDefault { diff --git a/modules/voxelman/world/cubic/voxel_chunk_cubic.h b/modules/voxelman/world/cubic/voxel_chunk_cubic.h index a696cfad0..38970219c 100644 --- a/modules/voxelman/world/cubic/voxel_chunk_cubic.h +++ b/modules/voxelman/world/cubic/voxel_chunk_cubic.h @@ -22,9 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - #include "../default/voxel_chunk_default.h" class VoxelChunkCubic : public VoxelChunkDefault { diff --git a/modules/voxelman/world/cubic/voxel_world_cubic.h b/modules/voxelman/world/cubic/voxel_world_cubic.h index b983cc984..5b3bc4795 100644 --- a/modules/voxelman/world/cubic/voxel_world_cubic.h +++ b/modules/voxelman/world/cubic/voxel_world_cubic.h @@ -22,9 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - #include "../default/voxel_world_default.h" class VoxelWorldCubic : public VoxelWorldDefault { diff --git a/modules/voxelman/world/default/voxel_chunk_default.cpp b/modules/voxelman/world/default/voxel_chunk_default.cpp index 9e9e032e1..55d9d7ff4 100644 --- a/modules/voxelman/world/default/voxel_chunk_default.cpp +++ b/modules/voxelman/world/default/voxel_chunk_default.cpp @@ -123,13 +123,8 @@ RID VoxelChunkDefault::mesh_rid_get(const int mesh_index, const int mesh_type_in Variant v = m[mesh_type_index]; -#if VERSION_MAJOR > 3 - if (v.get_type() != Variant::RID) - return RID(); -#else if (v.get_type() != Variant::_RID) return RID(); -#endif return v; } @@ -147,11 +142,7 @@ void VoxelChunkDefault::mesh_rid_set(const int mesh_index, const int mesh_type_i Variant v = m[mesh_type_index]; -#if VERSION_MAJOR > 3 - ERR_FAIL_COND(v.get_type() != Variant::RID); -#else ERR_FAIL_COND(v.get_type() != Variant::_RID); -#endif m[mesh_type_index] = value; _rids[mesh_index] = m; @@ -379,12 +370,7 @@ void VoxelChunkDefault::colliders_create(const int mesh_index, const int layer_m ERR_FAIL_COND(m.has(MESH_TYPE_INDEX_SHAPE)); RID shape_rid = PhysicsServer::get_singleton()->shape_create(PhysicsServer::SHAPE_CONCAVE_POLYGON); -#if VERSION_MAJOR < 4 RID body_rid = PhysicsServer::get_singleton()->body_create(PhysicsServer::BODY_MODE_STATIC); -#else - RID body_rid = PhysicsServer::get_singleton()->body_create(); - PhysicsServer::get_singleton()->body_set_mode(body_rid, PhysicsServer::BODY_MODE_STATIC); -#endif PhysicsServer::get_singleton()->body_set_collision_layer(body_rid, layer_mask); PhysicsServer::get_singleton()->body_set_collision_mask(body_rid, layer_mask); @@ -839,11 +825,7 @@ void VoxelChunkDefault::_world_light_removed(const Ref &light) { int index = _lights.find(light); if (index != -1) { -#if VERSION_MAJOR < 4 _lights.remove(index); -#else - _lights.remove_at(index); -#endif set_lights_dirty(true); } diff --git a/modules/voxelman/world/default/voxel_chunk_default.h b/modules/voxelman/world/default/voxel_chunk_default.h index d905a4fb3..dc3ec2b66 100644 --- a/modules/voxelman/world/default/voxel_chunk_default.h +++ b/modules/voxelman/world/default/voxel_chunk_default.h @@ -22,21 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - -#include "core/version.h" - -#if VERSION_MAJOR > 3 -#include "core/string/ustring.h" -#include "core/config/engine.h" -#include "core/variant/array.h" -#else -#include "core/ustring.h" -#include "core/engine.h" #include "core/array.h" -#endif - +#include "core/engine.h" +#include "core/ustring.h" #include "../voxel_chunk.h" @@ -46,12 +34,12 @@ SOFTWARE. #include "core/os/thread.h" #include "core/os/thread_safe.h" -#include "scene/resources/packed_scene.h" -#include "../voxel_world.h" #include "../../data/voxel_light.h" -#include "../../meshers/voxel_mesher.h" -#include "../../library/voxel_surface.h" #include "../../library/voxel_library.h" +#include "../../library/voxel_surface.h" +#include "../../meshers/voxel_mesher.h" +#include "../voxel_world.h" +#include "scene/resources/packed_scene.h" class VoxelWorld; class VoxelJob; @@ -224,7 +212,7 @@ protected: RID _debug_mesh_instance; PoolVector3Array _debug_mesh_array; - Vector > _lights; + Vector> _lights; }; VARIANT_ENUM_CAST(VoxelChunkDefault::DefaultChannels); diff --git a/modules/voxelman/world/default/voxel_world_default.cpp b/modules/voxelman/world/default/voxel_world_default.cpp index 65c372c7a..0a5fee021 100644 --- a/modules/voxelman/world/default/voxel_world_default.cpp +++ b/modules/voxelman/world/default/voxel_world_default.cpp @@ -75,11 +75,7 @@ void VoxelWorldDefault::set_num_lods(const int value) { } void VoxelWorldDefault::update_lods() { -#if VERSION_MAJOR < 4 call("_update_lods"); -#else - GDVIRTUAL_CALL(_update_lods); -#endif } int VoxelWorldDefault::get_chunk_lod_falloff() const { @@ -362,11 +358,7 @@ void VoxelWorldDefault::_bind_methods() { ClassDB::bind_method(D_METHOD("set_num_lods", "value"), &VoxelWorldDefault::set_num_lods); ADD_PROPERTY(PropertyInfo(Variant::INT, "num_lods"), "set_num_lods", "get_num_lods"); -#if VERSION_MAJOR < 4 BIND_VMETHOD(MethodInfo("_update_lods")); -#else - GDVIRTUAL_BIND(_update_lods); -#endif ClassDB::bind_method(D_METHOD("update_lods"), &VoxelWorldDefault::update_lods); ClassDB::bind_method(D_METHOD("_update_lods"), &VoxelWorldDefault::_update_lods); diff --git a/modules/voxelman/world/default/voxel_world_default.h b/modules/voxelman/world/default/voxel_world_default.h index e10859210..8f4daaac3 100644 --- a/modules/voxelman/world/default/voxel_world_default.h +++ b/modules/voxelman/world/default/voxel_world_default.h @@ -22,9 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - #include "../voxel_world.h" class VoxelWorldDefault : public VoxelWorld { @@ -50,10 +47,6 @@ public: PoolColorArray get_vertex_colors(const Transform &transform, const PoolVector3Array &vertices, const float base_light_value = 0.45, const float ao_strength = 0.2); -#if VERSION_MAJOR >= 4 - GDVIRTUAL0(_update_lods); -#endif - VoxelWorldDefault(); ~VoxelWorldDefault(); diff --git a/modules/voxelman/world/environment_data.cpp b/modules/voxelman/world/environment_data.cpp index 4deea59f6..93bd077cd 100644 --- a/modules/voxelman/world/environment_data.cpp +++ b/modules/voxelman/world/environment_data.cpp @@ -64,11 +64,7 @@ void EnvironmentData::set_indirect_energy(const int index, const float value) { void EnvironmentData::setup(WorldEnvironment *world_environment, DirectionalLight *primary_light, DirectionalLight *secondary_light) { if (has_method("_setup")) { -#if VERSION_MAJOR < 4 call("_setup", world_environment, primary_light, secondary_light); -#else - GDVIRTUAL_CALL(_setup, world_environment, primary_light, secondary_light); -#endif } } void EnvironmentData::setup_bind(Node *world_environment, Node *primary_light, Node *secondary_light) { @@ -91,11 +87,7 @@ EnvironmentData::~EnvironmentData() { } void EnvironmentData::_bind_methods() { -#if VERSION_MAJOR < 4 BIND_VMETHOD(MethodInfo("_setup", PropertyInfo(Variant::OBJECT, "world_environment", PROPERTY_HINT_RESOURCE_TYPE, "WorldEnvironment"), PropertyInfo(Variant::OBJECT, "primary_light", PROPERTY_HINT_RESOURCE_TYPE, "DirectionalLight"), PropertyInfo(Variant::OBJECT, "secondary_light", PROPERTY_HINT_RESOURCE_TYPE, "DirectionalLight"))); -#else - GDVIRTUAL_BIND(_setup, "world_environment", "primary_light", "secondary_light"); -#endif ClassDB::bind_method(D_METHOD("get_environment"), &EnvironmentData::get_environment); ClassDB::bind_method(D_METHOD("set_environment", "value"), &EnvironmentData::set_environment); diff --git a/modules/voxelman/world/environment_data.h b/modules/voxelman/world/environment_data.h index 34dc1af96..594f5968a 100644 --- a/modules/voxelman/world/environment_data.h +++ b/modules/voxelman/world/environment_data.h @@ -22,18 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - -#include "core/version.h" - -#if VERSION_MAJOR > 3 -#include "core/io/resource.h" -#include "core/math/color.h" -#else #include "core/resource.h" #include "core/color.h" -#endif #include "../defines.h" @@ -63,10 +53,6 @@ public: void setup(WorldEnvironment *world_environment, DirectionalLight *primary_light, DirectionalLight *secondary_light); void setup_bind(Node *world_environment, Node *primary_light, Node *secondary_light); -#if VERSION_MAJOR >= 4 - GDVIRTUAL3(_setup, WorldEnvironment*, DirectionalLight*, DirectionalLight*); -#endif - EnvironmentData(); ~EnvironmentData(); diff --git a/modules/voxelman/world/jobs/voxel_job.cpp b/modules/voxelman/world/jobs/voxel_job.cpp index d0e8eb617..2ec387a6e 100644 --- a/modules/voxelman/world/jobs/voxel_job.cpp +++ b/modules/voxelman/world/jobs/voxel_job.cpp @@ -64,11 +64,7 @@ void VoxelJob::next_job() { } void VoxelJob::reset() { -#if VERSION_MAJOR < 4 call("_reset"); -#else - GDVIRTUAL_CALL(_reset); -#endif } void VoxelJob::_reset() { _build_done = false; @@ -88,11 +84,7 @@ void VoxelJob::_execute() { } void VoxelJob::execute_phase() { -#if VERSION_MAJOR < 4 call("_execute_phase"); -#else - GDVIRTUAL_CALL(_execute_phase); -#endif } void VoxelJob::_execute_phase() { @@ -100,22 +92,14 @@ void VoxelJob::_execute_phase() { } void VoxelJob::process(const float delta) { -#if VERSION_MAJOR < 4 if (has_method("_process")) { call("_process", delta); } -#else - GDVIRTUAL_CALL(_process, delta); -#endif } void VoxelJob::physics_process(const float delta) { -#if VERSION_MAJOR < 4 if (has_method("_physics_process")) { call("_physics_process", delta); } -#else - GDVIRTUAL_CALL(_physics_process, delta); -#endif } //Data Management functions @@ -273,11 +257,7 @@ Array VoxelJob::bake_mesh_array_uv(Array arr, Ref tex, const float mul_ ERR_FAIL_COND_V(arr.size() != VisualServer::ARRAY_MAX, arr); ERR_FAIL_COND_V(!tex.is_valid(), arr); -#if VERSION_MAJOR < 4 Ref img = tex->get_data(); -#else - Ref img = tex->get_image(); -#endif ERR_FAIL_COND_V(!img.is_valid(), arr); @@ -289,9 +269,7 @@ Array VoxelJob::bake_mesh_array_uv(Array arr, Ref tex, const float mul_ if (colors.size() < uvs.size()) colors.resize(uvs.size()); -#if !GODOT4 img->lock(); -#endif for (int i = 0; i < uvs.size(); ++i) { Vector2 uv = uvs[i]; @@ -305,9 +283,7 @@ Array VoxelJob::bake_mesh_array_uv(Array arr, Ref tex, const float mul_ colors.set(i, colors[i] * c * mul_color); } -#if !GODOT4 img->unlock(); -#endif arr[VisualServer::ARRAY_COLOR] = colors; @@ -348,13 +324,8 @@ VoxelJob::~VoxelJob() { } void VoxelJob::_bind_methods() { -#if VERSION_MAJOR < 4 BIND_VMETHOD(MethodInfo("_process", PropertyInfo(Variant::REAL, "delta"))); BIND_VMETHOD(MethodInfo("_physics_process", PropertyInfo(Variant::REAL, "delta"))); -#else - GDVIRTUAL_BIND(_process, "delta"); - GDVIRTUAL_BIND(_physics_process, "delta"); -#endif ClassDB::bind_method(D_METHOD("get_build_phase_type"), &VoxelJob::get_build_phase_type); ClassDB::bind_method(D_METHOD("set_build_phase_type", "value"), &VoxelJob::set_build_phase_type); @@ -371,22 +342,14 @@ void VoxelJob::_bind_methods() { ClassDB::bind_method(D_METHOD("next_job"), &VoxelJob::next_job); -#if VERSION_MAJOR < 4 BIND_VMETHOD(MethodInfo("_reset")); -#else - GDVIRTUAL_BIND(_reset); -#endif ClassDB::bind_method(D_METHOD("reset"), &VoxelJob::reset); ClassDB::bind_method(D_METHOD("_reset"), &VoxelJob::_reset); ClassDB::bind_method(D_METHOD("_execute"), &VoxelJob::_execute); -#if VERSION_MAJOR < 4 BIND_VMETHOD(MethodInfo("_execute_phase")); -#else - GDVIRTUAL_BIND(_execute_phase); -#endif ClassDB::bind_method(D_METHOD("execute_phase"), &VoxelJob::execute_phase); ClassDB::bind_method(D_METHOD("_execute_phase"), &VoxelJob::_execute_phase); @@ -418,11 +381,7 @@ void VoxelJob::_bind_methods() { ClassDB::bind_method(D_METHOD("should_do", "just_check"), &VoxelJob::should_do, DEFVAL(false)); ClassDB::bind_method(D_METHOD("should_return"), &VoxelJob::should_return); -#if VERSION_MAJOR < 4 BIND_VMETHOD(MethodInfo("_execute")); -#else - GDVIRTUAL_BIND(_execute); -#endif ClassDB::bind_method(D_METHOD("execute"), &VoxelJob::execute); @@ -495,11 +454,7 @@ bool VoxelJob::should_return() { void VoxelJob::execute() { ERR_FAIL_COND(!has_method("_execute")); -#if VERSION_MAJOR < 4 call("_execute"); -#else - GDVIRTUAL_CALL(_execute); -#endif } #endif diff --git a/modules/voxelman/world/jobs/voxel_job.h b/modules/voxelman/world/jobs/voxel_job.h index 51873aba1..2733f5f55 100644 --- a/modules/voxelman/world/jobs/voxel_job.h +++ b/modules/voxelman/world/jobs/voxel_job.h @@ -22,34 +22,16 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - #include "scene/resources/texture.h" #if THREAD_POOL_PRESENT #include "../../../thread_pool/thread_pool_job.h" #else - -#include "core/version.h" - -#if VERSION_MAJOR > 3 -#include "core/object/ref_counted.h" -#ifndef Reference -#define Reference RefCounted -#endif -#else #include "core/reference.h" #endif -#endif - #include "../../defines.h" -#if GODOT4 -#define Texture Texture2D -#endif - class VoxelChunk; #if THREAD_POOL_PRESENT @@ -102,14 +84,6 @@ public: void chunk_exit_tree(); -#if VERSION_MAJOR >= 4 - GDVIRTUAL1(_process, float); - GDVIRTUAL1(_physics_process, float); - - GDVIRTUAL0(_reset); - GDVIRTUAL0(_execute_phase); -#endif - VoxelJob(); ~VoxelJob(); @@ -151,10 +125,6 @@ public: void execute(); -#if VERSION_MAJOR >= 4 - GDVIRTUAL0(_execute); -#endif - private: bool _complete; bool _cancelled; diff --git a/modules/voxelman/world/jobs/voxel_light_job.h b/modules/voxelman/world/jobs/voxel_light_job.h index 9ee60204f..1749d5b78 100644 --- a/modules/voxelman/world/jobs/voxel_light_job.h +++ b/modules/voxelman/world/jobs/voxel_light_job.h @@ -22,9 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - #include "voxel_job.h" class VoxelMesher; diff --git a/modules/voxelman/world/jobs/voxel_mesher_job_step.h b/modules/voxelman/world/jobs/voxel_mesher_job_step.h index 0c305c3df..fcc47b3c1 100644 --- a/modules/voxelman/world/jobs/voxel_mesher_job_step.h +++ b/modules/voxelman/world/jobs/voxel_mesher_job_step.h @@ -22,19 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - #include "core/version.h" -#if VERSION_MAJOR > 3 -#include "core/object/ref_counted.h" -#ifndef Reference -#define Reference RefCounted -#endif -#else #include "core/reference.h" -#endif #ifdef MESH_UTILS_PRESENT #include "../../../mesh_utils/fast_quadratic_mesh_simplifier.h" @@ -66,19 +56,19 @@ public: int get_lod_index() const; void set_lod_index(const int value); - #ifdef MESH_UTILS_PRESENT - Ref get_fqms(); - void set_fqms(const Ref &val); +#ifdef MESH_UTILS_PRESENT + Ref get_fqms(); + void set_fqms(const Ref &val); - float get_simplification_step_ratio() const; - void set_simplification_step_ratio(const float value); + float get_simplification_step_ratio() const; + void set_simplification_step_ratio(const float value); - int get_simplification_steps() const; - void set_simplification_steps(const int value); + int get_simplification_steps() const; + void set_simplification_steps(const int value); - float get_simplification_agressiveness() const; - void set_simplification_agressiveness(const float value); - #endif + float get_simplification_agressiveness() const; + void set_simplification_agressiveness(const float value); +#endif VoxelMesherJobStep(); ~VoxelMesherJobStep(); @@ -89,12 +79,12 @@ protected: VoxelMesherJobStepType _job_type; int _lod_index; - #ifdef MESH_UTILS_PRESENT - Ref _fqms; - float _simplification_step_ratio; - int _simplification_steps; - float _simplification_agressiveness; - #endif +#ifdef MESH_UTILS_PRESENT + Ref _fqms; + float _simplification_step_ratio; + int _simplification_steps; + float _simplification_agressiveness; +#endif }; VARIANT_ENUM_CAST(VoxelMesherJobStep::VoxelMesherJobStepType); diff --git a/modules/voxelman/world/jobs/voxel_prop_job.h b/modules/voxelman/world/jobs/voxel_prop_job.h index 51e502cc3..9912330af 100644 --- a/modules/voxelman/world/jobs/voxel_prop_job.h +++ b/modules/voxelman/world/jobs/voxel_prop_job.h @@ -22,9 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - #include "voxel_job.h" #include "voxel_mesher_job_step.h" diff --git a/modules/voxelman/world/jobs/voxel_terrain_job.h b/modules/voxelman/world/jobs/voxel_terrain_job.h index c46e4cdee..c4b2addf7 100644 --- a/modules/voxelman/world/jobs/voxel_terrain_job.h +++ b/modules/voxelman/world/jobs/voxel_terrain_job.h @@ -22,9 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - #include "voxel_job.h" #include "../../defines.h" diff --git a/modules/voxelman/world/marching_cubes/voxel_chunk_marching_cubes.h b/modules/voxelman/world/marching_cubes/voxel_chunk_marching_cubes.h index a652aa10c..794414f98 100644 --- a/modules/voxelman/world/marching_cubes/voxel_chunk_marching_cubes.h +++ b/modules/voxelman/world/marching_cubes/voxel_chunk_marching_cubes.h @@ -22,9 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - #include "../default/voxel_chunk_default.h" class VoxelChunkMarchingCubes : public VoxelChunkDefault { diff --git a/modules/voxelman/world/marching_cubes/voxel_world_marching_cubes.h b/modules/voxelman/world/marching_cubes/voxel_world_marching_cubes.h index 6b25dc56d..a06945945 100644 --- a/modules/voxelman/world/marching_cubes/voxel_world_marching_cubes.h +++ b/modules/voxelman/world/marching_cubes/voxel_world_marching_cubes.h @@ -22,9 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - #include "../default/voxel_world_default.h" class VoxelWorldMarchingCubes : public VoxelWorldDefault { diff --git a/modules/voxelman/world/voxel_chunk.cpp b/modules/voxelman/world/voxel_chunk.cpp index 669122c3c..341bb11b2 100644 --- a/modules/voxelman/world/voxel_chunk.cpp +++ b/modules/voxelman/world/voxel_chunk.cpp @@ -273,11 +273,7 @@ void VoxelChunk::job_set(int index, const Ref &job) { void VoxelChunk::job_remove(const int index) { ERR_FAIL_INDEX(index, _jobs.size()); -#if VERSION_MAJOR < 4 _jobs.remove(index); -#else - _jobs.remove_at(index); -#endif } void VoxelChunk::job_add(const Ref &job) { _jobs.push_back(job); @@ -331,13 +327,9 @@ Ref VoxelChunk::job_get_current() { //Voxel Data void VoxelChunk::channel_setup() { -#if VERSION_MAJOR < 4 ERR_FAIL_COND_MSG(!has_method("_channel_setup"), "VoxelChunk: _setup_channels() is missing! Please implement it!"); call("_channel_setup"); -#else - GDVIRTUAL_CALL(_channel_setup); -#endif } void VoxelChunk::set_size(const int size_x, const int size_y, const int size_z, const int margin_start, const int margin_end) { @@ -635,21 +627,13 @@ void VoxelChunk::voxel_structure_remove(const Ref &structure) { int index = _voxel_structures.find(structure); if (index != -1) { -#if VERSION_MAJOR < 4 _voxel_structures.remove(index); -#else - _voxel_structures.remove_at(index); -#endif } } void VoxelChunk::voxel_structure_remove_index(const int index) { ERR_FAIL_INDEX(index, _voxel_structures.size()); -#if VERSION_MAJOR < 4 _voxel_structures.remove(index); -#else - _voxel_structures.remove_at(index); -#endif } void VoxelChunk::voxel_structure_clear() { _voxel_structures.clear(); @@ -685,11 +669,7 @@ void VoxelChunk::build() { ERR_FAIL_COND(!get_voxel_world()->is_inside_tree()); ERR_FAIL_COND(!is_in_tree()); -#if VERSION_MAJOR < 4 call("_build"); -#else - GDVIRTUAL_CALL(_build); -#endif } void VoxelChunk::_build() { @@ -710,44 +690,28 @@ void VoxelChunk::clear() { } void VoxelChunk::finalize_build() { -#if VERSION_MAJOR < 4 if (has_method("_finalize_build")) { call("_finalize_build"); } -#else - GDVIRTUAL_CALL(_finalize_build); -#endif } void VoxelChunk::bake_lights() { -#if VERSION_MAJOR < 4 if (has_method("_bake_lights")) { call("_bake_lights"); } -#else - GDVIRTUAL_CALL(_bake_lights); -#endif } void VoxelChunk::bake_light(Ref light) { if (!light.is_valid()) return; -#if VERSION_MAJOR < 4 if (has_method("_bake_light")) { call("_bake_light", light); } -#else - GDVIRTUAL_CALL(_bake_light, light); -#endif } void VoxelChunk::clear_baked_lights() { -#if VERSION_MAJOR < 4 if (has_method("_clear_baked_lights")) { call("_clear_baked_lights"); } -#else - GDVIRTUAL_CALL(_clear_baked_lights); -#endif } #if PROPS_PRESENT @@ -776,11 +740,7 @@ int VoxelChunk::prop_get_count() const { void VoxelChunk::prop_remove(const int index) { ERR_FAIL_INDEX(index, _props.size()); -#if VERSION_MAJOR < 4 _props.remove(index); -#else - _props.remove_at(index); -#endif } void VoxelChunk::props_clear() { _props.clear(); @@ -822,13 +782,9 @@ int VoxelChunk::mesh_data_resource_addv(const Vector3 &local_data_pos, const Ref _mesh_data_resources.push_back(e); -#if VERSION_MAJOR < 4 if (has_method("_mesh_data_resource_added")) { call("_mesh_data_resource_added", index); } -#else - GDVIRTUAL_CALL(_mesh_data_resource_added, index); -#endif return index; } @@ -866,13 +822,9 @@ int VoxelChunk::mesh_data_resource_add(const Transform &local_transform, const R _mesh_data_resources.push_back(e); -#if VERSION_MAJOR < 4 if (has_method("_mesh_data_resource_added")) { call("_mesh_data_resource_added", index); } -#else - GDVIRTUAL_CALL(_mesh_data_resource_added, index); -#endif return index; } @@ -948,11 +900,7 @@ int VoxelChunk::mesh_data_resource_get_count() const { void VoxelChunk::mesh_data_resource_remove(const int index) { ERR_FAIL_INDEX(index, _mesh_data_resources.size()); -#if VERSION_MAJOR < 4 _mesh_data_resources.remove(index); -#else - _mesh_data_resources.remove_at(index); -#endif } void VoxelChunk::mesh_data_resource_clear() { _mesh_data_resources.clear(); @@ -1027,11 +975,7 @@ int VoxelChunk::collider_get_count() const { void VoxelChunk::collider_remove(const int index) { ERR_FAIL_INDEX(index, _colliders.size()); -#if VERSION_MAJOR < 4 _colliders.remove(index); -#else - _colliders.remove_at(index); -#endif } void VoxelChunk::colliders_clear() { _colliders.clear(); @@ -1040,92 +984,52 @@ void VoxelChunk::colliders_clear() { void VoxelChunk::enter_tree() { _is_in_tree = true; -#if VERSION_MAJOR < 4 if (has_method("_enter_tree")) { call("_enter_tree"); } -#else - GDVIRTUAL_CALL(_enter_tree); -#endif } void VoxelChunk::exit_tree() { _is_in_tree = false; -#if VERSION_MAJOR < 4 if (has_method("_exit_tree")) { call("_exit_tree"); } -#else - GDVIRTUAL_CALL(_exit_tree); -#endif } void VoxelChunk::process(const float delta) { -#if VERSION_MAJOR < 4 if (has_method("_process")) { call("_process", delta); } -#else - GDVIRTUAL_CALL(_process, delta); -#endif } void VoxelChunk::physics_process(const float delta) { -#if VERSION_MAJOR < 4 if (has_method("_physics_process")) { call("_physics_process", delta); } -#else - GDVIRTUAL_CALL(_physics_process, delta); -#endif } void VoxelChunk::world_transform_changed() { call("_world_transform_changed"); -#if VERSION_MAJOR < 4 call("_world_transform_changed"); -#else - GDVIRTUAL_CALL(_world_transform_changed); -#endif } void VoxelChunk::visibility_changed(const bool visible) { -#if VERSION_MAJOR < 4 if (has_method("_visibility_changed")) { call("_visibility_changed", _is_visible); } -#else - GDVIRTUAL_CALL(_visibility_changed, _is_visible); -#endif } void VoxelChunk::world_light_added(const Ref &light) { -#if VERSION_MAJOR < 4 if (has_method("_world_light_added")) { call("_world_light_added", light); } -#else - GDVIRTUAL_CALL(_world_light_added, light); -#endif } void VoxelChunk::world_light_removed(const Ref &light) { -#if VERSION_MAJOR < 4 if (has_method("_world_light_removed")) { call("_world_light_removed", light); } -#else - GDVIRTUAL_CALL(_world_light_removed, light); -#endif } void VoxelChunk::generation_process(const float delta) { -#if VERSION_MAJOR < 4 call("_generation_process", delta); -#else - GDVIRTUAL_CALL(_generation_process, delta); -#endif } void VoxelChunk::generation_physics_process(const float delta) { -#if VERSION_MAJOR < 4 call("_generation_physics_process", delta); -#else - GDVIRTUAL_CALL(_generation_physics_process, delta); -#endif } Transform VoxelChunk::get_transform() const { @@ -1355,7 +1259,6 @@ void VoxelChunk::_get_property_list(List *p_list) const { void VoxelChunk::_bind_methods() { ADD_SIGNAL(MethodInfo("mesh_generation_finished", PropertyInfo(Variant::OBJECT, "chunk", PROPERTY_HINT_RESOURCE_TYPE, "VoxelChunk"))); -#if VERSION_MAJOR < 4 BIND_VMETHOD(MethodInfo("_mesh_data_resource_added", PropertyInfo(Variant::INT, "index"))); BIND_VMETHOD(MethodInfo("_channel_setup")); @@ -1363,21 +1266,11 @@ void VoxelChunk::_bind_methods() { BIND_VMETHOD(MethodInfo("_bake_lights")); BIND_VMETHOD(MethodInfo("_bake_light", PropertyInfo(Variant::OBJECT, "light", PROPERTY_HINT_RESOURCE_TYPE, "VoxelLight"))); BIND_VMETHOD(MethodInfo("_clear_baked_lights")); -#else - GDVIRTUAL_BIND(_mesh_data_resource_added, "index"); - - GDVIRTUAL_BIND(_channel_setup); - - GDVIRTUAL_BIND(_bake_lights); - GDVIRTUAL_BIND(_bake_light, "light"); - GDVIRTUAL_BIND(_clear_baked_lights); -#endif ClassDB::bind_method(D_METHOD("bake_lights"), &VoxelChunk::bake_lights); ClassDB::bind_method(D_METHOD("bake_light", "light"), &VoxelChunk::bake_light); ClassDB::bind_method(D_METHOD("clear_baked_lights"), &VoxelChunk::clear_baked_lights); -#if VERSION_MAJOR < 4 BIND_VMETHOD(MethodInfo("_enter_tree")); BIND_VMETHOD(MethodInfo("_exit_tree")); BIND_VMETHOD(MethodInfo("_process", PropertyInfo(Variant::REAL, "delta"))); @@ -1391,21 +1284,6 @@ void VoxelChunk::_bind_methods() { BIND_VMETHOD(MethodInfo("_generation_physics_process", PropertyInfo(Variant::REAL, "delta"))); BIND_VMETHOD(MethodInfo("_finalize_build")); -#else - GDVIRTUAL_BIND(_enter_tree); - GDVIRTUAL_BIND(_exit_tree); - GDVIRTUAL_BIND(_process, "delta"); - GDVIRTUAL_BIND(_physics_process, "delta"); - GDVIRTUAL_BIND(_world_transform_changed); - GDVIRTUAL_BIND(_visibility_changed, "visible"); - GDVIRTUAL_BIND(_world_light_added, "light"); - GDVIRTUAL_BIND(_world_light_removed, "light"); - - GDVIRTUAL_BIND(_generation_process, "delta"); - GDVIRTUAL_BIND(_generation_physics_process, "delta"); - - GDVIRTUAL_BIND(_finalize_build); -#endif ClassDB::bind_method(D_METHOD("enter_tree"), &VoxelChunk::enter_tree); ClassDB::bind_method(D_METHOD("exit_tree"), &VoxelChunk::exit_tree); @@ -1435,11 +1313,7 @@ void VoxelChunk::_bind_methods() { ClassDB::bind_method(D_METHOD("get_transform"), &VoxelChunk::get_transform); ClassDB::bind_method(D_METHOD("set_transform", "value"), &VoxelChunk::set_transform); -#if VERSION_MAJOR < 4 ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM, "transform"), "set_transform", "get_transform"); -#else - ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM3D, "transform"), "set_transform", "get_transform"); -#endif ClassDB::bind_method(D_METHOD("get_visible"), &VoxelChunk::get_visible); ClassDB::bind_method(D_METHOD("set_visible", "value"), &VoxelChunk::set_visible); @@ -1651,11 +1525,7 @@ void VoxelChunk::_bind_methods() { ClassDB::bind_method(D_METHOD("collider_remove", "index"), &VoxelChunk::collider_remove); ClassDB::bind_method(D_METHOD("colliders_clear"), &VoxelChunk::colliders_clear); -#if VERSION_MAJOR < 4 BIND_VMETHOD(MethodInfo("_build")); -#else - GDVIRTUAL_BIND(_build); -#endif ClassDB::bind_method(D_METHOD("build"), &VoxelChunk::build); ClassDB::bind_method(D_METHOD("_build"), &VoxelChunk::_build); diff --git a/modules/voxelman/world/voxel_chunk.h b/modules/voxelman/world/voxel_chunk.h index 893b674b3..ae300b9ca 100644 --- a/modules/voxelman/world/voxel_chunk.h +++ b/modules/voxelman/world/voxel_chunk.h @@ -22,22 +22,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - -#include "core/version.h" - -#if VERSION_MAJOR > 3 -#include "core/config/engine.h" -#include "core/io/resource.h" -#include "core/string/ustring.h" -#include "core/variant/array.h" -#else #include "core/array.h" #include "core/engine.h" #include "core/resource.h" #include "core/ustring.h" -#endif #include "../defines.h" @@ -62,13 +50,6 @@ include_pool_vector #include "core/version.h" -#if VERSION_MAJOR >= 4 -#define Texture Texture2D - -#include "core/math/transform_3d.h" - typedef class Transform3D Transform; -#endif - #include "../library/voxel_library.h" #include "../library/voxel_surface.h" ; //hackfix for a clang format issue @@ -319,31 +300,6 @@ public: Vector3 to_local(Vector3 p_global) const; Vector3 to_global(Vector3 p_local) const; -#if VERSION_MAJOR >= 4 - GDVIRTUAL1(_mesh_data_resource_added, int); - - GDVIRTUAL0(_channel_setup); - - GDVIRTUAL0(_bake_lights); - GDVIRTUAL1(_bake_light, Ref); - GDVIRTUAL0(_clear_baked_lights); - - GDVIRTUAL0(_enter_tree); - GDVIRTUAL0(_exit_tree); - GDVIRTUAL1(_process, float); - GDVIRTUAL1(_physics_process, float); - GDVIRTUAL0(_world_transform_changed); - GDVIRTUAL1(_visibility_changed, bool); - GDVIRTUAL1(_world_light_added, Ref); - GDVIRTUAL1(_world_light_removed, Ref); - - GDVIRTUAL1(_generation_process, float); - GDVIRTUAL1(_generation_physics_process, float); - - GDVIRTUAL0(_finalize_build); - GDVIRTUAL0(_build); -#endif - VoxelChunk(); ~VoxelChunk();