diff --git a/modules/props_2d/clutter/ground_clutter_2d.h b/modules/props_2d/clutter/ground_clutter_2d.h index 2296f2857..c7c6d9f50 100644 --- a/modules/props_2d/clutter/ground_clutter_2d.h +++ b/modules/props_2d/clutter/ground_clutter_2d.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 #ifdef TEXTURE_PACKER_PRESENT #include "../../texture_packer/texture_packer.h" diff --git a/modules/props_2d/clutter/ground_clutter_2d_foliage.h b/modules/props_2d/clutter/ground_clutter_2d_foliage.h index 4ceacbe4d..997fea877 100644 --- a/modules/props_2d/clutter/ground_clutter_2d_foliage.h +++ b/modules/props_2d/clutter/ground_clutter_2d_foliage.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/templates/vector.h" -#else #include "core/vector.h" -#endif #include "ground_clutter_2d.h" @@ -53,7 +44,7 @@ private: static void _bind_methods(); private: - Vector > _textures; + Vector> _textures; }; #endif diff --git a/modules/props_2d/editor/prop_2d_editor_plugin.cpp b/modules/props_2d/editor/prop_2d_editor_plugin.cpp index a1c7b260d..0c54768be 100644 --- a/modules/props_2d/editor/prop_2d_editor_plugin.cpp +++ b/modules/props_2d/editor/prop_2d_editor_plugin.cpp @@ -26,21 +26,11 @@ SOFTWARE. #include "../singleton/prop_2d_utils.h" #include "core/os/keyboard.h" -#include "core/version.h" - -#if VERSION_MAJOR < 4 #include "core/os/input.h" #define CONNECT(sig, obj, target_method_class, method) connect(sig, obj, #method) #define DISCONNECT(sig, obj, target_method_class, method) disconnect(sig, obj, #method) -#else -#include "core/input/input.h" - -#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)) -#endif - void Prop2DEditorPlugin::convert_active_scene_to_prop_data() { SceneTree *st = SceneTree::get_singleton(); @@ -109,14 +99,9 @@ void Prop2DEditorPlugin::_convert_selected_scene_to_prop_data(Variant param) { Prop2DEditorPlugin::Prop2DEditorPlugin(EditorNode *p_node) { editor = p_node; -#if VERSION_MAJOR < 4 editor->add_tool_menu_item("Convert active scene to Prop2DData", this, "convert_active_scene_to_prop_data"); editor->add_tool_menu_item("Convert selected scene(s) to Prop2DData", this, "convert_selected_scene_to_prop_data"); -#if VERSION_MINOR >= 4 editor->add_tool_menu_item("(Prop2D) Find room points.", this, "find_room_points"); -#endif -#else -#endif Button *b = memnew(Button); diff --git a/modules/props_2d/editor/prop_2d_editor_plugin.h b/modules/props_2d/editor/prop_2d_editor_plugin.h index 52094d36f..1694fef61 100644 --- a/modules/props_2d/editor/prop_2d_editor_plugin.h +++ b/modules/props_2d/editor/prop_2d_editor_plugin.h @@ -22,16 +22,12 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - #include "editor/editor_node.h" #include "editor/editor_plugin.h" #include "core/version.h" class Prop2DEditorPlugin : public EditorPlugin { - GDCLASS(Prop2DEditorPlugin, EditorPlugin); EditorNode *editor; diff --git a/modules/props_2d/jobs/prop_2d_texture_job.h b/modules/props_2d/jobs/prop_2d_texture_job.h index b419fd32e..fab3486f7 100644 --- a/modules/props_2d/jobs/prop_2d_texture_job.h +++ b/modules/props_2d/jobs/prop_2d_texture_job.h @@ -22,23 +22,13 @@ 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" #endif -#include "core/version.h" - -#if VERSION_MAJOR > 3 -#include "core/object/reference.h" -#define Texture Texture2D -#else #include "core/reference.h" -#endif #if TEXTURE_PACKER_PRESENT class TexturePacker; diff --git a/modules/props_2d/lights/prop_2d_light.h b/modules/props_2d/lights/prop_2d_light.h index 2d151fea9..18bc5fda3 100644 --- a/modules/props_2d/lights/prop_2d_light.h +++ b/modules/props_2d/lights/prop_2d_light.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/reference.h" -#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 Prop2DLight : public Reference { GDCLASS(Prop2DLight, Reference); diff --git a/modules/props_2d/material_cache/prop_2d_material_cache.cpp b/modules/props_2d/material_cache/prop_2d_material_cache.cpp index ff21a6d1e..c8b4bab55 100644 --- a/modules/props_2d/material_cache/prop_2d_material_cache.cpp +++ b/modules/props_2d/material_cache/prop_2d_material_cache.cpp @@ -35,17 +35,6 @@ SOFTWARE. #include "../../mesh_data_resource/props_2d/prop_2d_data_mesh_data.h" #endif -#if VERSION_MAJOR > 3 - -#define VARIANT_ARRAY_GET(arr) \ - Vector r; \ - for (int i = 0; i < arr.size(); i++) { \ - r.push_back(arr[i]); \ - } \ - return r; - -#else - #define VARIANT_ARRAY_GET(arr) \ Vector r; \ for (int i = 0; i < arr.size(); i++) { \ @@ -53,8 +42,6 @@ SOFTWARE. } \ return r; -#endif - bool Prop2DMaterialCache::get_initialized() { return _initialized; } diff --git a/modules/props_2d/material_cache/prop_2d_material_cache.h b/modules/props_2d/material_cache/prop_2d_material_cache.h index 39780808e..8d1b4f6a1 100644 --- a/modules/props_2d/material_cache/prop_2d_material_cache.h +++ b/modules/props_2d/material_cache/prop_2d_material_cache.h @@ -22,24 +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/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" #include "core/os/mutex.h" +#include "scene/resources/material.h" class Prop2DData; diff --git a/modules/props_2d/material_cache/prop_2d_material_cache_pcm.cpp b/modules/props_2d/material_cache/prop_2d_material_cache_pcm.cpp index 4388bc003..9ea3485b8 100644 --- a/modules/props_2d/material_cache/prop_2d_material_cache_pcm.cpp +++ b/modules/props_2d/material_cache/prop_2d_material_cache_pcm.cpp @@ -158,11 +158,7 @@ void Prop2DMaterialCachePCM::_setup_material_albedo(Ref texture) { Prop2DMaterialCachePCM::Prop2DMaterialCachePCM() { _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); diff --git a/modules/props_2d/material_cache/prop_2d_material_cache_pcm.h b/modules/props_2d/material_cache/prop_2d_material_cache_pcm.h index 4420c84de..5748df19c 100644 --- a/modules/props_2d/material_cache/prop_2d_material_cache_pcm.h +++ b/modules/props_2d/material_cache/prop_2d_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 "prop_2d_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/props_2d/prop_2d_ess_entity.h b/modules/props_2d/prop_2d_ess_entity.h index d19fc58ea..079d85bd2 100644 --- a/modules/props_2d/prop_2d_ess_entity.h +++ b/modules/props_2d/prop_2d_ess_entity.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 < 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/props_2d/prop_2d_instance.cpp b/modules/props_2d/prop_2d_instance.cpp index 9a9de799b..78e6fdf18 100644 --- a/modules/props_2d/prop_2d_instance.cpp +++ b/modules/props_2d/prop_2d_instance.cpp @@ -2,15 +2,7 @@ #include "../mesh_data_resource/nodes/mesh_data_instance.h" -#include "core/version.h" - -#if VERSION_MAJOR < 4 #include "scene/3d/light.h" -#else -#include "scene/3d/light_3d.h" -#define OmniLight OmniLight3D -#define Light Light3D -#endif #if MESH_DATA_RESOURCE_PRESENT //define PROPS_PRESENT, so things compile. That module's scsub will define this too while compiling, diff --git a/modules/props_2d/prop_2d_instance.h b/modules/props_2d/prop_2d_instance.h index 5a02a4cb2..7409c197d 100644 --- a/modules/props_2d/prop_2d_instance.h +++ b/modules/props_2d/prop_2d_instance.h @@ -22,9 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - #include "core/version.h" #include "scene/2d/node_2d.h" diff --git a/modules/props_2d/prop_2d_instance_job.h b/modules/props_2d/prop_2d_instance_job.h index e6c995ccc..f07d1deec 100644 --- a/modules/props_2d/prop_2d_instance_job.h +++ b/modules/props_2d/prop_2d_instance_job.h @@ -22,23 +22,13 @@ 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/reference.h" -#define Texture Texture2D -#else #include "core/reference.h" -#endif #endif diff --git a/modules/props_2d/prop_2d_instance_merger.cpp b/modules/props_2d/prop_2d_instance_merger.cpp index 5d2d8655b..13433e03e 100644 --- a/modules/props_2d/prop_2d_instance_merger.cpp +++ b/modules/props_2d/prop_2d_instance_merger.cpp @@ -5,22 +5,7 @@ //#include "../thread_pool/thread_pool.h" #include "servers/physics_server.h" #include "scene/resources/world_2d.h" -#include "core/version.h" -#if VERSION_MAJOR > 3 -#include "core/config/engine.h" - -#define VARIANT_ARRAY_GET(arr) \ - Vector r; \ - for (int i = 0; i < arr.size(); i++) { \ - r.push_back(arr[i]); \ - } \ - return r; - -#include "servers/rendering_server.h" -typedef class RenderingServer VS; - -#else #include "core/engine.h" #define VARIANT_ARRAY_GET(arr) \ @@ -32,8 +17,6 @@ typedef class RenderingServer VS; #include "servers/visual_server.h" -#endif - #if MESH_DATA_RESOURCE_PRESENT //define PROPS_PRESENT, so things compile. That module's scsub will define this too while compiling, //but not when included from here. diff --git a/modules/props_2d/prop_2d_instance_merger.h b/modules/props_2d/prop_2d_instance_merger.h index 59fd5caaf..2264af93d 100644 --- a/modules/props_2d/prop_2d_instance_merger.h +++ b/modules/props_2d/prop_2d_instance_merger.h @@ -22,13 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - #include "prop_2d_instance.h" -#include "core/version.h" - #include "scene/2d/node_2d.h" #include "scene/resources/shape_2d.h" diff --git a/modules/props_2d/prop_2d_instance_prop_job.cpp b/modules/props_2d/prop_2d_instance_prop_job.cpp index c3f776aa1..ac7a1421a 100644 --- a/modules/props_2d/prop_2d_instance_prop_job.cpp +++ b/modules/props_2d/prop_2d_instance_prop_job.cpp @@ -22,8 +22,6 @@ SOFTWARE. #include "prop_2d_instance_prop_job.h" -#include "core/version.h" - #include "lights/prop_2d_light.h" #include "material_cache/prop_2d_material_cache.h" #include "prop_2d_instance.h" @@ -188,35 +186,35 @@ void Prop2DInstanceProp2DJob::phase_physics_process() { _prop_instace->free_colliders(); _prop_instace->colliders_clear(); -/* - for (int i = 0; i < _collision_shapes.size(); ++i) { - CollisionShapeEntry &e = _collision_shapes.write[i]; + /* + for (int i = 0; i < _collision_shapes.size(); ++i) { + CollisionShapeEntry &e = _collision_shapes.write[i]; - if (!e.shape.is_valid()) { - continue; - } - - RID body = PhysicsServer::get_singleton()->body_create(PhysicsServer::BODY_MODE_STATIC); - - PhysicsServer::get_singleton()->body_add_shape(body, e.shape->get_rid()); - - //TODO store the layer mask somewhere - PhysicsServer::get_singleton()->body_set_collision_layer(body, _prop_instace->get_collision_layer()); - PhysicsServer::get_singleton()->body_set_collision_mask(body, _prop_instace->get_collision_mask()); - - if (_prop_instace->is_inside_tree() && _prop_instace->is_inside_world()) { - Ref world = _prop_instace->get_world_2d(); - - if (world.is_valid() && world->get_space() != RID()) { - PhysicsServer::get_singleton()->body_set_space(body, world->get_space()); + if (!e.shape.is_valid()) { + continue; } + + RID body = PhysicsServer::get_singleton()->body_create(PhysicsServer::BODY_MODE_STATIC); + + PhysicsServer::get_singleton()->body_add_shape(body, e.shape->get_rid()); + + //TODO store the layer mask somewhere + PhysicsServer::get_singleton()->body_set_collision_layer(body, _prop_instace->get_collision_layer()); + PhysicsServer::get_singleton()->body_set_collision_mask(body, _prop_instace->get_collision_mask()); + + if (_prop_instace->is_inside_tree() && _prop_instace->is_inside_world()) { + Ref world = _prop_instace->get_world_2d(); + + if (world.is_valid() && world->get_space() != RID()) { + PhysicsServer::get_singleton()->body_set_space(body, world->get_space()); + } + } + + //PhysicsServer::get_singleton()->body_set_state(body, PhysicsServer::BODY_STATE_TRANSFORM, e.transform); + + _prop_instace->collider_add(e.transform, e.shape, e.shape->get_rid(), body, e.owns_shape); } - - //PhysicsServer::get_singleton()->body_set_state(body, PhysicsServer::BODY_STATE_TRANSFORM, e.transform); - - _prop_instace->collider_add(e.transform, e.shape, e.shape->get_rid(), body, e.owns_shape); - } -*/ + */ #if TOOLS_ENABLED /* @@ -355,11 +353,7 @@ void Prop2DInstanceProp2DJob::phase_steps() { RID mesh_rid = _prop_instace->mesh_get(i); if (VS::get_singleton()->mesh_get_surface_count(mesh_rid) > 0) -#if !GODOT4 VS::get_singleton()->mesh_remove_surface(mesh_rid, 0); -#else - VS::get_singleton()->mesh_clear(mesh_rid); -#endif } } } @@ -468,9 +462,7 @@ Array Prop2DInstanceProp2DJob::bake_mesh_array_uv(Array arr, Ref tex, c 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]; @@ -484,9 +476,7 @@ Array Prop2DInstanceProp2DJob::bake_mesh_array_uv(Array arr, Ref tex, c colors.set(i, colors[i] * c * mul_color); } -#if !GODOT4 img->unlock(); -#endif arr[VisualServer::ARRAY_COLOR] = colors; @@ -506,11 +496,7 @@ void Prop2DInstanceProp2DJob::reset_meshes() { RID mesh_rid = _prop_instace->mesh_get(i); if (VS::get_singleton()->mesh_get_surface_count(mesh_rid) > 0) -#if !GODOT4 VS::get_singleton()->mesh_remove_surface(mesh_rid, 0); -#else - VS::get_singleton()->mesh_clear(mesh_rid); -#endif } } } diff --git a/modules/props_2d/prop_2d_instance_prop_job.h b/modules/props_2d/prop_2d_instance_prop_job.h index f1541725e..882342b5e 100644 --- a/modules/props_2d/prop_2d_instance_prop_job.h +++ b/modules/props_2d/prop_2d_instance_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 "prop_2d_instance_job.h" #include "scene/resources/shape_2d.h" diff --git a/modules/props_2d/prop_2d_mesher.cpp b/modules/props_2d/prop_2d_mesher.cpp index e27ee85c3..7ef149af2 100644 --- a/modules/props_2d/prop_2d_mesher.cpp +++ b/modules/props_2d/prop_2d_mesher.cpp @@ -147,21 +147,13 @@ Array Prop2DMesher::build_mesh() { { PoolVector array; array.resize(_vertices.size()); -#if !GODOT4 PoolVector::Write w = array.write(); -#endif for (int i = 0; i < _vertices.size(); ++i) { -#if !GODOT4 w[i] = _vertices[i].vertex; -#else - array.set(i, _vertices[i].vertex); -#endif } -#if !GODOT4 w.release(); -#endif a[VisualServer::ARRAY_VERTEX] = array; } @@ -169,42 +161,26 @@ Array Prop2DMesher::build_mesh() { if ((_format & VisualServer::ARRAY_FORMAT_COLOR) != 0) { PoolVector array; array.resize(_vertices.size()); -#if !GODOT4 PoolVector::Write w = array.write(); -#endif for (int i = 0; i < _vertices.size(); ++i) { -#if !GODOT4 w[i] = _vertices[i].color; -#else - array.set(i, _vertices[i].color); -#endif } -#if !GODOT4 w.release(); -#endif a[VisualServer::ARRAY_COLOR] = array; } if ((_format & VisualServer::ARRAY_FORMAT_TEX_UV) != 0) { PoolVector array; array.resize(_vertices.size()); -#if !GODOT4 PoolVector::Write w = array.write(); -#endif for (int i = 0; i < _vertices.size(); ++i) { -#if !GODOT4 w[i] = _vertices[i].uv; -#else - array.set(i, _vertices[i].uv); -#endif } -#if !GODOT4 w.release(); -#endif a[VisualServer::ARRAY_TEX_UV] = array; } @@ -212,21 +188,13 @@ Array Prop2DMesher::build_mesh() { if (_indices.size() > 0) { PoolVector array; array.resize(_indices.size()); -#if !GODOT4 PoolVector::Write w = array.write(); -#endif for (int i = 0; i < _indices.size(); ++i) { -#if !GODOT4 w[i] = _indices[i]; -#else - array.set(i, _indices[i]); -#endif } -#if !GODOT4 w.release(); -#endif a[VisualServer::ARRAY_INDEX] = array; } diff --git a/modules/props_2d/prop_2d_mesher.h b/modules/props_2d/prop_2d_mesher.h index 5f263c939..93a8b9942 100644 --- a/modules/props_2d/prop_2d_mesher.h +++ b/modules/props_2d/prop_2d_mesher.h @@ -22,30 +22,11 @@ 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" -#include "core/object/reference.h" -#include "core/templates/vector.h" - -template -class Vector; -template -using PoolVector = Vector; - -#include "scene/3d/mesh_instance_3d.h" - -#else #include "core/color.h" #include "core/pool_vector.h" #include "core/reference.h" #include "core/vector.h" #include "scene/3d/mesh_instance.h" -#endif #include "core/math/rect2.h" #include "core/math/vector2.h" diff --git a/modules/props_2d/prop_2d_scene_instance.cpp b/modules/props_2d/prop_2d_scene_instance.cpp index 33c3369ec..70439a01b 100644 --- a/modules/props_2d/prop_2d_scene_instance.cpp +++ b/modules/props_2d/prop_2d_scene_instance.cpp @@ -1,12 +1,6 @@ #include "prop_2d_scene_instance.h" -#include "core/version.h" - -#if VERSION_MAJOR > 3 -#include "core/config/engine.h" -#else #include "core/engine.h" -#endif Ref Prop2DSceneInstance::get_scene() { return _scene; diff --git a/modules/props_2d/prop_2d_scene_instance.h b/modules/props_2d/prop_2d_scene_instance.h index e1cb95d1a..6879d531f 100644 --- a/modules/props_2d/prop_2d_scene_instance.h +++ b/modules/props_2d/prop_2d_scene_instance.h @@ -22,11 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - -#include "core/version.h" - #include "scene/2d/node_2d.h" #include "props/prop_2d_data.h" diff --git a/modules/props_2d/props/prop_2d_data.cpp b/modules/props_2d/props/prop_2d_data.cpp index 7437ca5e8..84e4524cd 100644 --- a/modules/props_2d/props/prop_2d_data.cpp +++ b/modules/props_2d/props/prop_2d_data.cpp @@ -26,13 +26,7 @@ SOFTWARE. #include "prop_2d_data_light.h" #include "prop_2d_data_prop.h" -#if VERSION_MAJOR < 4 #include "servers/physics_server.h" -#else -#include "servers/physics_server_3d.h" - -#define Shape Shape3D -#endif int Prop2DData::get_id() const { return _id; @@ -41,7 +35,6 @@ void Prop2DData::set_id(const int value) { _id = value; } - Ref Prop2DData::get_prop(const int index) const { ERR_FAIL_INDEX_V(index, _props.size(), Ref()); @@ -68,11 +61,7 @@ int Prop2DData::get_prop_count() const { Vector Prop2DData::get_props() { Vector r; for (int i = 0; i < _props.size(); i++) { -#if VERSION_MAJOR < 4 r.push_back(_props[i].get_ref_ptr()); -#else - r.push_back(_props[i]); -#endif } return r; } diff --git a/modules/props_2d/props/prop_2d_data.h b/modules/props_2d/props/prop_2d_data.h index f43c6163d..1a18b7200 100644 --- a/modules/props_2d/props/prop_2d_data.h +++ b/modules/props_2d/props/prop_2d_data.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/math/transform_3d.h" -#include "core/templates/vector.h" -#else +#include "core/math/transform.h" #include "core/reference.h" #include "core/vector.h" -#include "core/math/transform.h" -#endif #include "core/math/rect2.h" #include "core/math/vector2.h" diff --git a/modules/props_2d/props/prop_2d_data_entry.h b/modules/props_2d/props/prop_2d_data_entry.h index 47209c526..66409f6ca 100644 --- a/modules/props_2d/props/prop_2d_data_entry.h +++ b/modules/props_2d/props/prop_2d_data_entry.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/io/resource.h" -#include "core/math/transform_3d.h" - -#ifndef Transform -#define Transform Transform3D -#endif -#else #include "core/math/transform.h" #include "core/math/transform_2d.h" #include "core/resource.h" -#endif #include "scene/resources/material.h" diff --git a/modules/props_2d/props/prop_2d_data_light.h b/modules/props_2d/props/prop_2d_data_light.h index 3e92ded97..219a15374 100644 --- a/modules/props_2d/props/prop_2d_data_light.h +++ b/modules/props_2d/props/prop_2d_data_light.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 "prop_2d_data_entry.h" diff --git a/modules/props_2d/props/prop_2d_data_portal.h b/modules/props_2d/props/prop_2d_data_portal.h index 3abd9d74c..bb53f2efe 100644 --- a/modules/props_2d/props/prop_2d_data_portal.h +++ b/modules/props_2d/props/prop_2d_data_portal.h @@ -22,9 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - #include "core/version.h" #include "prop_2d_data_entry.h" diff --git a/modules/props_2d/props/prop_2d_data_prop.h b/modules/props_2d/props/prop_2d_data_prop.h index 69aa7dc01..ba154808a 100644 --- a/modules/props_2d/props/prop_2d_data_prop.h +++ b/modules/props_2d/props/prop_2d_data_prop.h @@ -22,9 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - #include "core/math/vector3.h" #include "prop_2d_data_entry.h" diff --git a/modules/props_2d/props/prop_2d_data_scene.cpp b/modules/props_2d/props/prop_2d_data_scene.cpp index a1fc0853f..a8f517a19 100644 --- a/modules/props_2d/props/prop_2d_data_scene.cpp +++ b/modules/props_2d/props/prop_2d_data_scene.cpp @@ -65,7 +65,6 @@ Node *Prop2DDataScene::_processor_get_node_for(const Transform2D &transform, Nod i = Object::cast_to(node); } - i->set_scene(get_scene()); return Prop2DDataEntry::_processor_get_node_for(transform, i); diff --git a/modules/props_2d/props/prop_2d_data_scene.h b/modules/props_2d/props/prop_2d_data_scene.h index 19bb1abf6..becb97d26 100644 --- a/modules/props_2d/props/prop_2d_data_scene.h +++ b/modules/props_2d/props/prop_2d_data_scene.h @@ -22,9 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - #include "core/math/vector3.h" #include "prop_2d_data_entry.h" diff --git a/modules/props_2d/props/prop_2d_data_sprite.h b/modules/props_2d/props/prop_2d_data_sprite.h index 0851bfefd..2cdc17784 100644 --- a/modules/props_2d/props/prop_2d_data_sprite.h +++ b/modules/props_2d/props/prop_2d_data_sprite.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 "scene/resources/texture.h" diff --git a/modules/props_2d/register_types.cpp b/modules/props_2d/register_types.cpp index 14faebe9e..0f0c7fb3f 100644 --- a/modules/props_2d/register_types.cpp +++ b/modules/props_2d/register_types.cpp @@ -22,13 +22,7 @@ SOFTWARE. #include "register_types.h" -#include "core/version.h" - -#if VERSION_MAJOR > 3 -#include "core/config/engine.h" -#else #include "core/engine.h" -#endif #include "tiled_wall/tiled_wall_2d.h" #include "tiled_wall/tiled_wall_2d_data.h" @@ -41,9 +35,7 @@ SOFTWARE. #include "props/prop_2d_data_sprite.h" #include "props/prop_2d_data_tiled_wall_2d.h" -#if VERSION_MINOR >= 4 #include "props/prop_2d_data_portal.h" -#endif #include "clutter/ground_clutter_2d.h" #include "clutter/ground_clutter_2d_foliage.h" @@ -91,9 +83,7 @@ void register_props_2d_types() { ClassDB::register_class(); ClassDB::register_class(); -#if VERSION_MINOR >= 4 ClassDB::register_class(); -#endif ClassDB::register_class(); ClassDB::register_class(); @@ -135,10 +125,8 @@ void register_props_2d_types() { Ref scene_processor = Ref(memnew(Prop2DDataScene)); Prop2DUtils::add_processor(scene_processor); -#if VERSION_MINOR >= 4 Ref portal_processor = Ref(memnew(Prop2DDataPortal)); Prop2DUtils::add_processor(portal_processor); -#endif Ref tiled_wall_processor = Ref(memnew(Prop2DDataTiledWall2D)); Prop2DUtils::add_processor(tiled_wall_processor); diff --git a/modules/props_2d/register_types.h b/modules/props_2d/register_types.h index 263d8790e..ef26d3ef5 100644 --- a/modules/props_2d/register_types.h +++ b/modules/props_2d/register_types.h @@ -22,9 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - void register_props_2d_types(); void unregister_props_2d_types(); diff --git a/modules/props_2d/singleton/prop_2d_cache.cpp b/modules/props_2d/singleton/prop_2d_cache.cpp index 5f4387990..28b39a2ad 100644 --- a/modules/props_2d/singleton/prop_2d_cache.cpp +++ b/modules/props_2d/singleton/prop_2d_cache.cpp @@ -25,15 +25,8 @@ SOFTWARE. #include "../props/prop_2d_data.h" #include "../props/prop_2d_data_entry.h" -#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 "../jobs/prop_2d_texture_job.h" @@ -46,17 +39,6 @@ SOFTWARE. #include "core/hashfuncs.h" -#if VERSION_MAJOR > 3 - -#define VARIANT_ARRAY_GET(arr) \ - Vector r; \ - for (int i = 0; i < arr.size(); i++) { \ - r.push_back(arr[i]); \ - } \ - return r; - -#else - #define VARIANT_ARRAY_GET(arr) \ Vector r; \ for (int i = 0; i < arr.size(); i++) { \ @@ -64,8 +46,6 @@ SOFTWARE. } \ return r; -#endif - Prop2DCache *Prop2DCache::_instance; Prop2DCache *Prop2DCache::get_singleton() { @@ -323,7 +303,6 @@ void Prop2DCache::material_cache_custom_key_unref(const uint64_t key) { Ref Prop2DCache::load_resource(const String &path, const String &type_hint) { _ResourceLoader *rl = _ResourceLoader::get_singleton(); -#if VERSION_MAJOR < 4 Ref resl = rl->load_interactive(path, type_hint); ERR_FAIL_COND_V(!resl.is_valid(), Ref()); @@ -331,9 +310,6 @@ Ref Prop2DCache::load_resource(const String &path, const String &type_ resl->wait(); return resl->get_resource(); -#else - return rl->load(path, type_hint); -#endif } Prop2DCache::Prop2DCache() { @@ -348,11 +324,7 @@ Prop2DCache::Prop2DCache() { #endif #ifdef TEXTURE_PACKER_PRESENT -#if VERSION_MAJOR < 4 _texture_flags = GLOBAL_DEF("props_2d/texture_flags", Texture::FLAG_MIPMAPS | Texture::FLAG_FILTER); -#else - _texture_flags = GLOBAL_DEF("props_2d/texture_flags", 0); -#endif _max_atlas_size = GLOBAL_DEF("props_2d/max_atlas_size", 1024); _keep_original_atlases = GLOBAL_DEF("props_2d/keep_original_atlases", false); diff --git a/modules/props_2d/singleton/prop_2d_cache.h b/modules/props_2d/singleton/prop_2d_cache.h index 17f3b468f..a10f3ecde 100644 --- a/modules/props_2d/singleton/prop_2d_cache.h +++ b/modules/props_2d/singleton/prop_2d_cache.h @@ -22,26 +22,12 @@ 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/core_bind.h" -#include "core/math/color.h" -#include "core/object/object.h" -#include "core/object/reference.h" -#include "core/templates/hash_map.h" -#include "core/templates/vector.h" -#else #include "core/bind/core_bind.h" #include "core/color.h" #include "core/hash_map.h" #include "core/object.h" #include "core/reference.h" #include "core/vector.h" -#endif #include "scene/resources/material.h" diff --git a/modules/props_2d/singleton/prop_2d_utils.cpp b/modules/props_2d/singleton/prop_2d_utils.cpp index 2440a84ae..cc4982e02 100644 --- a/modules/props_2d/singleton/prop_2d_utils.cpp +++ b/modules/props_2d/singleton/prop_2d_utils.cpp @@ -25,14 +25,10 @@ SOFTWARE. #include "../props/prop_2d_data.h" #include "../props/prop_2d_data_entry.h" -#include "core/version.h" - -#if VERSION_MINOR >= 4 #include "core/math/quick_hull.h" #include "scene/3d/portal.h" #include "scene/3d/room.h" #include "scene/3d/room_manager.h" -#endif #include "scene/3d/mesh_instance.h" @@ -40,25 +36,19 @@ SOFTWARE. #include "../../mesh_data_resource/nodes/mesh_data_instance.h" #endif -#if VERSION_MAJOR > 3 -#include "core/config/engine.h" -#else #include "core/engine.h" -#endif #include "scene/2d/node_2d.h" Prop2DUtils *Prop2DUtils::_instance; -Vector > Prop2DUtils::_processors; +Vector> Prop2DUtils::_processors; Prop2DUtils *Prop2DUtils::get_singleton() { return _instance; } Ref Prop2DUtils::convert_tree(Node *root) { -#if VERSION_MAJOR < 4 ERR_FAIL_COND_V(!ObjectDB::instance_validate(root), Ref()); -#endif Ref data; data.instance(); @@ -70,9 +60,7 @@ Ref Prop2DUtils::convert_tree(Node *root) { } void Prop2DUtils::_convert_tree(Ref prop_data, Node *node, const Transform2D &transform) { -#if VERSION_MAJOR < 4 ERR_FAIL_COND(!ObjectDB::instance_validate(node)); -#endif for (int i = 0; i < Prop2DUtils::_processors.size(); ++i) { Ref proc = Prop2DUtils::_processors.get(i); @@ -109,7 +97,6 @@ void Prop2DUtils::_convert_tree(Ref prop_data, Node *node, const Tra } } } else { - for (int i = 0; i < node->get_child_count(); ++i) { Node *child = node->get_child(i); diff --git a/modules/props_2d/singleton/prop_2d_utils.h b/modules/props_2d/singleton/prop_2d_utils.h index 34217669c..f537f5469 100644 --- a/modules/props_2d/singleton/prop_2d_utils.h +++ b/modules/props_2d/singleton/prop_2d_utils.h @@ -22,31 +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/object/object.h" -#include "core/object/reference.h" -#include "core/templates/vector.h" -#include "scene/3d/node_3d.h" -#else #include "core/object.h" #include "core/reference.h" #include "core/vector.h" #include "scene/3d/spatial.h" -#endif #include "scene/main/node.h" class Prop2DData; class Prop2DDataEntry; -#if VERSION_MINOR >= 4 class Room; -#endif class Prop2DUtils : public Object { GDCLASS(Prop2DUtils, Object); diff --git a/modules/props_2d/tiled_wall/tiled_wall_2d.cpp b/modules/props_2d/tiled_wall/tiled_wall_2d.cpp index 4eafd051f..57025a338 100644 --- a/modules/props_2d/tiled_wall/tiled_wall_2d.cpp +++ b/modules/props_2d/tiled_wall/tiled_wall_2d.cpp @@ -1,18 +1,10 @@ #include "tiled_wall_2d.h" -#include "core/version.h" - #include "scene/resources/texture.h" -#if VERSION_MAJOR < 4 #include "core/image.h" #define GET_WORLD get_world -#else -#include "core/io/image.h" - -#define GET_WORLD get_world_3d -#endif #if TEXTURE_PACKER_PRESENT #include "../../texture_packer/texture_resource/packer_image_resource.h" @@ -240,11 +232,7 @@ void TiledWall2D::clear_mesh() { if (_mesh_rid != RID()) { if (VS::get_singleton()->mesh_get_surface_count(_mesh_rid) > 0) -#if VERSION_MAJOR < 4 VS::get_singleton()->mesh_remove_surface(_mesh_rid, 0); -#else - VS::get_singleton()->mesh_clear(_mesh_rid); -#endif } } diff --git a/modules/props_2d/tiled_wall/tiled_wall_2d.h b/modules/props_2d/tiled_wall/tiled_wall_2d.h index 72944df3f..500165478 100644 --- a/modules/props_2d/tiled_wall/tiled_wall_2d.h +++ b/modules/props_2d/tiled_wall/tiled_wall_2d.h @@ -22,16 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - -#include "core/version.h" #include "scene/resources/texture.h" -#if VERSION_MAJOR >= 4 -#define Texture Texture2D -#endif - #include "scene/2d/node_2d.h" #include "core/math/vector3.h" diff --git a/modules/props_2d/tiled_wall/tiled_wall_2d_data.cpp b/modules/props_2d/tiled_wall/tiled_wall_2d_data.cpp index 3be4a2f65..022dbdad1 100644 --- a/modules/props_2d/tiled_wall/tiled_wall_2d_data.cpp +++ b/modules/props_2d/tiled_wall/tiled_wall_2d_data.cpp @@ -22,15 +22,7 @@ SOFTWARE. #include "tiled_wall_2d_data.h" -#if VERSION_MAJOR < 4 #include "servers/physics_server.h" -#else -#include "servers/physics_server_3d.h" - -#define Shape Shape3D -#endif - -#if VERSION_MAJOR <= 3 #define VARIANT_ARRAY_GET(arr) \ Vector r; \ @@ -39,17 +31,6 @@ SOFTWARE. } \ return r; -#else - -#define VARIANT_ARRAY_GET(arr) \ - Vector r; \ - for (int i = 0; i < arr.size(); i++) { \ - r.push_back(arr[i].get_ref_ptr()); \ - } \ - return r; - -#endif - #define VARIANT_ARRAY_SET(arr, arr_into, type) \ arr_into.clear(); \ for (int i = 0; i < arr.size(); i++) { \ @@ -100,11 +81,7 @@ int TiledWall2DData::get_texture_count() const { Vector TiledWall2DData::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; } @@ -148,11 +125,7 @@ int TiledWall2DData::get_flavour_texture_count() const { Vector TiledWall2DData::get_flavour_textures() { Vector r; for (int i = 0; i < _flavour_textures.size(); i++) { -#if VERSION_MAJOR < 4 r.push_back(_flavour_textures[i].get_ref_ptr()); -#else - r.push_back(_flavour_textures[i]); -#endif } return r; } diff --git a/modules/props_2d/tiled_wall/tiled_wall_2d_data.h b/modules/props_2d/tiled_wall/tiled_wall_2d_data.h index 7ce7f7023..9cfe3eb7a 100644 --- a/modules/props_2d/tiled_wall/tiled_wall_2d_data.h +++ b/modules/props_2d/tiled_wall/tiled_wall_2d_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/object/reference.h" -#include "core/templates/vector.h" -#else #include "core/reference.h" #include "core/vector.h" -#endif #include "core/math/rect2.h" #include "core/math/transform.h"