diff --git a/modules/entity_spell_system/data/species/species_model_data.cpp b/modules/entity_spell_system/data/species/species_model_data.cpp index 4e5a0bd48..65de26adf 100644 --- a/modules/entity_spell_system/data/species/species_model_data.cpp +++ b/modules/entity_spell_system/data/species/species_model_data.cpp @@ -136,11 +136,7 @@ Vector SpeciesModelData::get_customizable_slot_entries(const int slot_i ERR_FAIL_INDEX_V(slot_index, _customizable_slots.size(), r); for (int i = 0; i < _customizable_slots[slot_index].size(); i++) { -#if GODOT4 - r.push_back(_customizable_slots[slot_index][i]); -#else r.push_back(_customizable_slots[slot_index][i].get_ref_ptr()); -#endif } return r; } diff --git a/modules/texture_packer/layers/texture_layer_merger.cpp b/modules/texture_packer/layers/texture_layer_merger.cpp index 53d68b015..53f324494 100644 --- a/modules/texture_packer/layers/texture_layer_merger.cpp +++ b/modules/texture_packer/layers/texture_layer_merger.cpp @@ -22,8 +22,6 @@ SOFTWARE. #include "texture_layer_merger.h" -#include "core/version.h" - int TextureLayerMerger::get_width() const { return _width; } @@ -68,11 +66,7 @@ Ref TextureLayerMerger::get_result_as_texture() const { ERR_FAIL_COND_V(!_image.is_valid(), Ref()); Ref tex; -#if VERSION_MAJOR < 4 tex.instance(); -#else - tex.instantiate(); -#endif tex->create_from_image(_image); return tex; @@ -166,11 +160,7 @@ void TextureLayerMerger::set_rect(const int p_index, const Rect2 &p_rect) { void TextureLayerMerger::remove_texture(const int p_index) { ERR_FAIL_INDEX(p_index, _entries.size()); -#if VERSION_MAJOR < 4 return _entries.remove(p_index); -#else - return _entries.remove_at(p_index); -#endif } int TextureLayerMerger::get_texture_count() { @@ -185,11 +175,7 @@ void TextureLayerMerger::merge() { ERR_FAIL_COND(_width <= 0 || _height <= 0); if (!_image.is_valid()) { -#if VERSION_MAJOR < 4 _image.instance(); -#else - _image.instantiate(); -#endif } PoolVector data; @@ -224,11 +210,7 @@ void TextureLayerMerger::merge() { ERR_CONTINUE(!atlas.is_valid()); -#if VERSION_MAJOR < 4 input_image = atlas->get_data(); -#else - input_image = atlas->get_image(); -#endif Rect2 region = altas_texture->get_region(); @@ -244,11 +226,7 @@ void TextureLayerMerger::merge() { if (rh > atlas_h) rh = atlas_h; } else { -#if VERSION_MAJOR < 4 input_image = e.texture->get_data(); -#else - input_image = e.texture->get_image(); -#endif } ERR_CONTINUE(!input_image.is_valid()); @@ -334,11 +312,7 @@ void TextureLayerMerger::merge() { } } -#if VERSION_MAJOR < 4 _image->create(_width, _height, (_texture_flags & Texture::FLAG_MIPMAPS) != 0, Image::FORMAT_RGBA8, data); -#else - _image->create(_width, _height, true, Image::FORMAT_RGBA8, data); -#endif } void TextureLayerMerger::write_base_color_to_array(PoolVector &data) { diff --git a/modules/texture_packer/layers/texture_layer_merger.h b/modules/texture_packer/layers/texture_layer_merger.h index bbdf9b4b4..f1e231008 100644 --- a/modules/texture_packer/layers/texture_layer_merger.h +++ b/modules/texture_packer/layers/texture_layer_merger.h @@ -22,36 +22,14 @@ 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/io/image.h" -#else +#include "core/image.h" #include "core/reference.h" #include "core/vector.h" -#include "core/image.h" -#endif #include "core/math/rect2.h" #include "scene/resources/texture.h" -#include "core/version.h" - -#if VERSION_MAJOR >= 4 -#define PoolVector Vector -#define Texture Texture2D -#endif - class TextureLayerMerger : public Reference { - GDCLASS(TextureLayerMerger, Reference); public: diff --git a/modules/texture_packer/texture_merger.cpp b/modules/texture_packer/texture_merger.cpp index a5a2e73a2..3a065693a 100644 --- a/modules/texture_packer/texture_merger.cpp +++ b/modules/texture_packer/texture_merger.cpp @@ -87,11 +87,7 @@ void TextureMerger::set_packer(const Ref &packer) { Vector TextureMerger::get_textures() { Vector r; for (int i = 0; i < _textures.size(); i++) { -#if VERSION_MAJOR < 4 r.push_back(_textures[i].get_ref_ptr()); -#else - r.push_back(_textures[i]); -#endif } return r; } @@ -140,13 +136,9 @@ Ref TextureMerger::add_texture(const Ref &texture) { Ref tex = _packer->add_texture(texture); if (!contains) { -#if VERSION_MAJOR < 4 if (has_method("_texture_added")) { call("_texture_added", tex); } -#else - GDVIRTUAL_CALL(_texture_added, tex); -#endif emit_signal("texture_added", tex); @@ -174,13 +166,9 @@ Ref TextureMerger::get_texture_index(const int index) { bool TextureMerger::unref_texture_index(const int index) { if (_packer->unref_texture_index(index)) { -#if VERSION_MAJOR < 4 if (has_method("_texture_removed")) { call("_texture_removed"); } -#else - GDVIRTUAL_CALL(_texture_removed); -#endif emit_signal("texture_removed"); @@ -194,13 +182,9 @@ bool TextureMerger::unref_texture_index(const int index) { bool TextureMerger::unref_texture(const Ref &texture) { if (_packer->unref_texture(texture)) { -#if VERSION_MAJOR < 4 if (has_method("_texture_removed")) { call("_texture_removed"); } -#else - GDVIRTUAL_CALL(_texture_removed); -#endif emit_signal("texture_removed"); @@ -215,13 +199,9 @@ bool TextureMerger::unref_texture(const Ref &texture) { void TextureMerger::remove_texture_index(const int index) { _packer->remove_texture_index(index); -#if VERSION_MAJOR < 4 if (has_method("_texture_removed")) { call("_texture_removed"); } -#else - GDVIRTUAL_CALL(_texture_removed); -#endif emit_signal("texture_removed"); @@ -231,13 +211,9 @@ void TextureMerger::remove_texture_index(const int index) { void TextureMerger::remove_texture(const Ref &texture) { _packer->remove_texture(texture); -#if VERSION_MAJOR < 4 if (has_method("_texture_removed")) { call("_texture_removed"); } -#else - GDVIRTUAL_CALL(_texture_removed); -#endif emit_signal("texture_removed"); @@ -262,13 +238,9 @@ int TextureMerger::get_generated_texture_count() { void TextureMerger::merge() { _packer->merge(); -#if VERSION_MAJOR < 4 if (has_method("_texture_merged")) { call("_texture_merged"); } -#else - GDVIRTUAL_CALL(_texture_merged); -#endif emit_signal("texture_merged"); } @@ -276,11 +248,7 @@ void TextureMerger::merge() { TextureMerger::TextureMerger() { _automatic_merge = false; -#if VERSION_MAJOR < 4 _packer.instance(); -#else - _packer.instantiate(); -#endif _packer->set_keep_original_atlases(false); } @@ -313,15 +281,9 @@ void TextureMerger::_bind_methods() { ADD_SIGNAL(MethodInfo("texture_added", PropertyInfo(Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "AtlasTexture"))); ADD_SIGNAL(MethodInfo("texture_removed")); -#if VERSION_MAJOR < 4 BIND_VMETHOD(MethodInfo("_texture_merged")); BIND_VMETHOD(MethodInfo("_texture_added", PropertyInfo(Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "AtlasTexture"))); BIND_VMETHOD(MethodInfo("_texture_removed")); -#else - GDVIRTUAL_BIND(_texture_merged); - GDVIRTUAL_BIND(_texture_added, "texture"); - GDVIRTUAL_BIND(_texture_removed); -#endif ClassDB::bind_method(D_METHOD("get_dirty"), &TextureMerger::get_dirty); ClassDB::bind_method(D_METHOD("set_dirty", "value"), &TextureMerger::set_dirty); diff --git a/modules/texture_packer/texture_merger.h b/modules/texture_packer/texture_merger.h index 702888050..94aff5d5b 100644 --- a/modules/texture_packer/texture_merger.h +++ b/modules/texture_packer/texture_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/templates/vector.h" -#include "core/config/engine.h" -#else -#include "core/vector.h" #include "core/engine.h" -#endif +#include "core/vector.h" #include "scene/main/node.h" @@ -89,12 +79,6 @@ public: void merge(); -#if VERSION_MAJOR >= 4 - GDVIRTUAL0(_texture_merged); - GDVIRTUAL1(_texture_added, Ref); - GDVIRTUAL0(_texture_removed); -#endif - TextureMerger(); ~TextureMerger(); @@ -107,7 +91,7 @@ private: bool _dirty; Ref _packer; - Vector > _textures; + Vector> _textures; }; #endif diff --git a/modules/texture_packer/texture_packer.cpp b/modules/texture_packer/texture_packer.cpp index 9495defdb..6b5e79739 100644 --- a/modules/texture_packer/texture_packer.cpp +++ b/modules/texture_packer/texture_packer.cpp @@ -83,11 +83,7 @@ Ref TexturePacker::add_texture(const Ref &texture) { } Ref tex; -#if VERSION_MAJOR < 4 tex.instance(); -#else - tex.instantiate(); -#endif tex->set_atlas(atlas_text->get_atlas()); tex->set_region(atlas_text->get_region()); @@ -124,11 +120,7 @@ Ref TexturePacker::add_texture(const Ref &texture) { } Ref tex; -#if VERSION_MAJOR < 4 tex.instance(); -#else - tex.instantiate(); -#endif //Temp setup, so the texture is usable even while the atlases are generating. tex->set_atlas(texture); @@ -208,11 +200,7 @@ bool TexturePacker::unref_texture_index(const int index) { int rc = --(r->refcount); if (rc <= 0) { -#if VERSION_MAJOR < 4 _rects.remove(index); -#else - _rects.remove_at(index); -#endif r->original_texture.unref(); r->atlas_texture.unref(); @@ -241,11 +229,7 @@ bool TexturePacker::unref_texture(const Ref &texture) { int rc = --(r->refcount); if (rc <= 0) { -#if VERSION_MAJOR < 4 _rects.remove(i); -#else - _rects.remove_at(i); -#endif r->original_texture.unref(); r->atlas_texture.unref(); @@ -286,11 +270,7 @@ void TexturePacker::remove_texture(const Ref &texture) { t = r->original_texture; if (t == texture) { -#if VERSION_MAJOR < 4 _rects.remove(i); -#else - _rects.remove_at(i); -#endif r->original_texture.unref(); r->atlas_texture.unref(); @@ -382,11 +362,7 @@ void TexturePacker::merge() { ERR_CONTINUE(!otext.is_valid()); -#if VERSION_MAJOR < 4 Ref img = otext->get_data(); -#else - Ref img = otext->get_image(); -#endif ERR_CONTINUE(!img.is_valid()); @@ -413,25 +389,13 @@ void TexturePacker::merge() { } Ref image; -#if VERSION_MAJOR < 4 image.instance(); -#else - image.instantiate(); -#endif image->create(b.size.w, b.size.h, false, Image::FORMAT_RGBA8, data); Ref texture; -#if VERSION_MAJOR < 4 texture.instance(); -#else - texture.instantiate(); -#endif -#if VERSION_MAJOR < 4 texture->create_from_image(image, _texture_flags); -#else - texture->create_from_image(image); -#endif _generated_textures.set(i, texture); @@ -476,12 +440,10 @@ int TexturePacker::get_offset_for_format(const Image::Format format) { case Image::FORMAT_BPTC_RGBA: case Image::FORMAT_BPTC_RGBF: case Image::FORMAT_BPTC_RGBFU: -#if VERSION_MAJOR <= 3 case Image::FORMAT_PVRTC2: case Image::FORMAT_PVRTC2A: case Image::FORMAT_PVRTC4: case Image::FORMAT_PVRTC4A: -#endif case Image::FORMAT_ETC: case Image::FORMAT_ETC2_R11: case Image::FORMAT_ETC2_R11S: @@ -490,13 +452,7 @@ int TexturePacker::get_offset_for_format(const Image::Format format) { case Image::FORMAT_ETC2_RGB8: case Image::FORMAT_ETC2_RGBA8: case Image::FORMAT_ETC2_RGB8A1: -#if VERSION_MAJOR >= 4 - case Image::FORMAT_RGB565: - case Image::FORMAT_ETC2_RA_AS_RG: - case Image::FORMAT_DXT5_RA_AS_RG: -#else case Image::FORMAT_RGBA5551: -#endif case Image::FORMAT_MAX: return 0; } @@ -505,11 +461,7 @@ int TexturePacker::get_offset_for_format(const Image::Format format) { } TexturePacker::TexturePacker() { -#if VERSION_MAJOR < 4 _texture_flags = Texture::FLAG_MIPMAPS | Texture::FLAG_FILTER; -#else - _texture_flags = 0; -#endif _max_atlas_size = 1024; _keep_original_atlases = false; diff --git a/modules/texture_packer/texture_packer.h b/modules/texture_packer/texture_packer.h index e10dd5c54..870065b56 100644 --- a/modules/texture_packer/texture_packer.h +++ b/modules/texture_packer/texture_packer.h @@ -22,41 +22,17 @@ 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/image.h" -#include "core/object/ref_counted.h" -#ifndef Reference -#define Reference RefCounted -#endif -#include "core/templates/vector.h" -#include "core/string/ustring.h" -#include "core/math/color.h" -#else +#include "core/color.h" #include "core/image.h" #include "core/reference.h" -#include "core/vector.h" #include "core/ustring.h" -#include "core/color.h" -#endif +#include "core/vector.h" #include "scene/resources/texture.h" #include #include "rectpack2D/pack.h" -#if VERSION_MAJOR >= 4 -#define PoolVector Vector -#define Texture Texture2D -#define PoolByteArray PackedByteArray - -#define REAL FLOAT -#endif - class TexturePacker : public Reference { GDCLASS(TexturePacker, Reference); @@ -114,7 +90,7 @@ private: int _margin; Vector _rects; - Vector > _generated_textures; + Vector> _generated_textures; }; #endif diff --git a/modules/texture_packer/texture_resource/editor_plugin_packer_image_resource.cpp b/modules/texture_packer/texture_resource/editor_plugin_packer_image_resource.cpp index 51cef943f..f74502fca 100644 --- a/modules/texture_packer/texture_resource/editor_plugin_packer_image_resource.cpp +++ b/modules/texture_packer/texture_resource/editor_plugin_packer_image_resource.cpp @@ -27,11 +27,7 @@ SOFTWARE. void EditorPluginPackerImageResource::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: -#if VERSION_MAJOR < 4 _importer.instance(); -#else - _importer.instantiate(); -#endif add_import_plugin(_importer); break; diff --git a/modules/texture_packer/texture_resource/editor_plugin_packer_image_resource.h b/modules/texture_packer/texture_resource/editor_plugin_packer_image_resource.h index fddfd8e8a..2d6192b91 100644 --- a/modules/texture_packer/texture_resource/editor_plugin_packer_image_resource.h +++ b/modules/texture_packer/texture_resource/editor_plugin_packer_image_resource.h @@ -22,23 +22,13 @@ 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" -#else #include "core/ustring.h" -#endif #include "editor/editor_plugin.h" #include "packer_image_resource_importer.h" class EditorPluginPackerImageResource : public EditorPlugin { - GDCLASS(EditorPluginPackerImageResource, EditorPlugin); public: diff --git a/modules/texture_packer/texture_resource/packer_image_resource.cpp b/modules/texture_packer/texture_resource/packer_image_resource.cpp index 4fe70c851..31571436b 100644 --- a/modules/texture_packer/texture_resource/packer_image_resource.cpp +++ b/modules/texture_packer/texture_resource/packer_image_resource.cpp @@ -73,10 +73,8 @@ Ref PackerImageResource::get_data() const { void PackerImageResource::_bind_methods() { ClassDB::bind_method(D_METHOD("set_data", "image"), &PackerImageResource::set_data); -#if VERSION_MAJOR < 4 - //for some reason this crashes on 4.0. Not yet sure why + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "Image", PROPERTY_USAGE_DEFAULT), "set_data", "get_data"); -#endif } PackerImageResource::PackerImageResource() { diff --git a/modules/texture_packer/texture_resource/packer_image_resource.h b/modules/texture_packer/texture_resource/packer_image_resource.h index 940b328a6..9dcf89faa 100644 --- a/modules/texture_packer/texture_resource/packer_image_resource.h +++ b/modules/texture_packer/texture_resource/packer_image_resource.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/image.h" -#else #include "core/image.h" -#endif #include "scene/resources/texture.h" diff --git a/modules/texture_packer/texture_resource/packer_image_resource_importer.cpp b/modules/texture_packer/texture_resource/packer_image_resource_importer.cpp index 4d3fff7dd..c354bdb2d 100644 --- a/modules/texture_packer/texture_resource/packer_image_resource_importer.cpp +++ b/modules/texture_packer/texture_resource/packer_image_resource_importer.cpp @@ -22,12 +22,6 @@ SOFTWARE. #include "packer_image_resource_importer.h" -#include "core/version.h" - -#if VERSION_MAJOR >= 4 -#define REAL FLOAT -#endif - String PackerImageResourceImporter::get_importer_name() const { return "packer_image_resource"; } @@ -74,11 +68,7 @@ Error PackerImageResourceImporter::import(const String &p_source_file, const Str float scale = p_options["scale"]; Ref image; -#if VERSION_MAJOR < 4 image.instance(); -#else - image.instantiate(); -#endif Error err = ImageLoader::load_image(p_source_file, image, NULL, hdr_as_srgb, scale); if (err != OK) { @@ -86,11 +76,7 @@ Error PackerImageResourceImporter::import(const String &p_source_file, const Str } Ref res; -#if VERSION_MAJOR < 4 res.instance(); -#else - res.instantiate(); -#endif res->set_data(image); diff --git a/modules/texture_packer/texture_resource/packer_image_resource_importer.h b/modules/texture_packer/texture_resource/packer_image_resource_importer.h index 48a7a900b..b8a34b00f 100644 --- a/modules/texture_packer/texture_resource/packer_image_resource_importer.h +++ b/modules/texture_packer/texture_resource/packer_image_resource_importer.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/string/ustring.h" -#include "core/io/image.h" -#else -#include "core/ustring.h" #include "core/image.h" -#endif +#include "core/ustring.h" #include "core/io/resource_saver.h" #include "editor/import/editor_import_plugin.h" @@ -43,7 +33,6 @@ SOFTWARE. #include "packer_image_resource.h" class PackerImageResourceImporter : public EditorImportPlugin { - GDCLASS(PackerImageResourceImporter, EditorImportPlugin); public: diff --git a/modules/thread_pool/thread_pool.cpp b/modules/thread_pool/thread_pool.cpp index 04885fc92..c26dac7e9 100644 --- a/modules/thread_pool/thread_pool.cpp +++ b/modules/thread_pool/thread_pool.cpp @@ -24,30 +24,16 @@ SOFTWARE. */ -#include "core/version.h" - -#if VERSION_MAJOR > 3 -#include "core/config/engine.h" -#include "core/config/project_settings.h" -#else #include "core/engine.h" #include "core/project_settings.h" -#endif #include "core/os/os.h" #include "scene/main/scene_tree.h" #include "core/version.h" -#if VERSION_MAJOR >= 4 -#define CONNECT(sig, obj, target_method_class, method) connect(sig, callable_mp(obj, &target_method_class::method)) -#define DISCONNECT(sig, obj, target_method_class, method) disconnect(sig, callable_mp(obj, &target_method_class::method)) - -#define REAL FLOAT -#else #define CONNECT(sig, obj, target_method_class, method) connect(sig, obj, #method) #define DISCONNECT(sig, obj, target_method_class, method) disconnect(sig, obj, #method) -#endif ThreadPool *ThreadPool::_instance; diff --git a/modules/thread_pool/thread_pool.h b/modules/thread_pool/thread_pool.h index 4263b71db..e3005f195 100644 --- a/modules/thread_pool/thread_pool.h +++ b/modules/thread_pool/thread_pool.h @@ -25,15 +25,8 @@ SOFTWARE. */ -#include "core/version.h" - -#if VERSION_MAJOR > 3 -#include "core/object/object.h" -#include "core/templates/vector.h" -#else #include "core/object.h" #include "core/vector.h" -#endif #include "core/os/semaphore.h" #include "core/os/thread.h" diff --git a/modules/thread_pool/thread_pool_execute_job.cpp b/modules/thread_pool/thread_pool_execute_job.cpp index 5a3b803c9..cfc8d3d64 100644 --- a/modules/thread_pool/thread_pool_execute_job.cpp +++ b/modules/thread_pool/thread_pool_execute_job.cpp @@ -22,13 +22,7 @@ SOFTWARE. #include "thread_pool_execute_job.h" -#include "core/version.h" - -#if VERSION_MAJOR > 3 -#include "core/variant/variant.h" -#else #include "core/variant.h" -#endif #include "core/os/os.h" @@ -50,11 +44,7 @@ void ThreadPoolExecuteJob::_execute() { ERR_FAIL_COND(!_object); ERR_FAIL_COND(!_object->has_method(_method)); -#if VERSION_MAJOR < 4 Variant::CallError error; -#else - Callable::CallError error; -#endif _object->call(_method, const_cast(&_argptr), _argcount, error); } @@ -86,28 +76,16 @@ void ThreadPoolExecuteJob::setup(const Variant &obj, const StringName &p_method, } } -#if VERSION_MAJOR < 4 Variant ThreadPoolExecuteJob::_setup_bind(const Variant **p_args, int p_argcount, Variant::CallError &r_error) { -#else -Variant ThreadPoolExecuteJob::_setup_bind(const Variant **p_args, int p_argcount, Callable::CallError &r_error) { -#endif if (p_argcount < 2) { -#if VERSION_MAJOR < 4 r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; -#else - r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; -#endif r_error.argument = 1; return Variant(); } if (p_args[0]->get_type() != Variant::OBJECT) { -#if VERSION_MAJOR < 4 r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; -#else - r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; -#endif r_error.argument = 0; r_error.expected = Variant::OBJECT; @@ -115,11 +93,7 @@ Variant ThreadPoolExecuteJob::_setup_bind(const Variant **p_args, int p_argcount } if (p_args[1]->get_type() != Variant::STRING) { -#if VERSION_MAJOR < 4 r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; -#else - r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; -#endif r_error.argument = 1; r_error.expected = Variant::STRING; @@ -161,11 +135,7 @@ Variant ThreadPoolExecuteJob::_setup_bind(const Variant **p_args, int p_argcount set_complete(true); } -#if VERSION_MAJOR < 4 r_error.error = Variant::CallError::CALL_OK; -#else - r_error.error = Callable::CallError::CALL_OK; -#endif return Variant(); } diff --git a/modules/thread_pool/thread_pool_execute_job.h b/modules/thread_pool/thread_pool_execute_job.h index ac755ba50..e5268579e 100644 --- a/modules/thread_pool/thread_pool_execute_job.h +++ b/modules/thread_pool/thread_pool_execute_job.h @@ -22,9 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - #include "thread_pool_job.h" class ThreadPoolExecuteJob : public ThreadPoolJob { @@ -39,11 +36,7 @@ public: void _execute(); void setup(const Variant &obj, const StringName &p_method, VARIANT_ARG_LIST); -#if VERSION_MAJOR < 4 Variant _setup_bind(const Variant **p_args, int p_argcount, Variant::CallError &r_error); -#else - Variant _setup_bind(const Variant **p_args, int p_argcount, Callable::CallError &r_error); -#endif ThreadPoolExecuteJob(); ~ThreadPoolExecuteJob(); diff --git a/modules/thread_pool/thread_pool_job.cpp b/modules/thread_pool/thread_pool_job.cpp index d08ed5920..b67e14bef 100644 --- a/modules/thread_pool/thread_pool_job.cpp +++ b/modules/thread_pool/thread_pool_job.cpp @@ -22,13 +22,7 @@ SOFTWARE. #include "thread_pool_job.h" -#include "core/version.h" - -#if VERSION_MAJOR > 3 -#include "core/variant/variant.h" -#else #include "core/variant.h" -#endif #include "core/os/os.h" @@ -94,11 +88,7 @@ void ThreadPoolJob::set_method(const StringName &value) { } float ThreadPoolJob::get_current_execution_time() { -#if VERSION_MAJOR < 4 return (OS::get_singleton()->get_system_time_msecs() - _start_time) / 1000.0; -#else - return (OS::get_singleton()->get_ticks_msec() - _start_time) / 1000.0; -#endif } bool ThreadPoolJob::should_do(const bool just_check) { @@ -131,17 +121,9 @@ void ThreadPoolJob::execute() { _current_run_stage = 0; -#if VERSION_MAJOR < 4 _start_time = OS::get_singleton()->get_system_time_msecs(); -#else - _start_time = OS::get_singleton()->get_ticks_msec(); -#endif -#if VERSION_MAJOR < 4 call("_execute"); -#else - GDVIRTUAL_CALL(_execute); -#endif } ThreadPoolJob::ThreadPoolJob() { @@ -175,11 +157,7 @@ void ThreadPoolJob::_bind_methods() { ClassDB::bind_method(D_METHOD("get_max_allocated_time"), &ThreadPoolJob::get_max_allocated_time); ClassDB::bind_method(D_METHOD("set_max_allocated_time", "value"), &ThreadPoolJob::set_max_allocated_time); -#if VERSION_MAJOR < 4 ADD_PROPERTY(PropertyInfo(Variant::REAL, "max_allocated_time"), "set_max_allocated_time", "get_max_allocated_time"); -#else - ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "max_allocated_time"), "set_max_allocated_time", "get_max_allocated_time"); -#endif ClassDB::bind_method(D_METHOD("get_start_time"), &ThreadPoolJob::get_start_time); ClassDB::bind_method(D_METHOD("set_start_time", "value"), &ThreadPoolJob::set_start_time); @@ -200,11 +178,7 @@ void ThreadPoolJob::_bind_methods() { ClassDB::bind_method(D_METHOD("should_do", "just_check"), &ThreadPoolJob::should_do, DEFVAL(false)); ClassDB::bind_method(D_METHOD("should_return"), &ThreadPoolJob::should_return); -#if VERSION_MAJOR < 4 BIND_VMETHOD(MethodInfo("_execute")); -#else - GDVIRTUAL_BIND(_execute); -#endif ClassDB::bind_method(D_METHOD("execute"), &ThreadPoolJob::execute); diff --git a/modules/thread_pool/thread_pool_job.h b/modules/thread_pool/thread_pool_job.h index c1320892a..8b96e7dba 100644 --- a/modules/thread_pool/thread_pool_job.h +++ b/modules/thread_pool/thread_pool_job.h @@ -22,21 +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 -#include "core/object/gdvirtual.gen.inc" -#include "core/object/script_language.h" -#else #include "core/reference.h" -#endif class ThreadPoolJob : public Reference { GDCLASS(ThreadPoolJob, Reference); @@ -78,10 +64,6 @@ public: void execute(); -#if VERSION_MAJOR >= 4 - GDVIRTUAL0(_execute); -#endif - ThreadPoolJob(); ~ThreadPoolJob(); diff --git a/modules/voxelman/world/block_voxel_structure.h b/modules/voxelman/world/block_voxel_structure.h index be460d690..3f27d7be4 100644 --- a/modules/voxelman/world/block_voxel_structure.h +++ b/modules/voxelman/world/block_voxel_structure.h @@ -22,16 +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/templates/vector.h" -#else #include "core/vector.h" -#endif #include "voxel_structure.h"