From d3f5ed6511cc1f28b5073cdca7c0db9c29911683 Mon Sep 17 00:00:00 2001 From: Relintai Date: Fri, 18 Mar 2022 03:22:03 +0100 Subject: [PATCH] Cleaned up the props module aswell. --- modules/props/clutter/ground_clutter.cpp | 1 - modules/props/clutter/ground_clutter.h | 7 ---- .../props/clutter/ground_clutter_foliage.h | 9 +--- modules/props/editor/prop_editor_plugin.cpp | 15 ------- modules/props/editor/prop_editor_plugin.h | 4 -- modules/props/jobs/prop_mesher_job_step.h | 41 ++++++++----------- modules/props/jobs/prop_texture_job.h | 10 ----- modules/props/lights/prop_light.cpp | 2 +- modules/props/lights/prop_light.h | 11 +---- .../material_cache/prop_material_cache.cpp | 13 ------ .../material_cache/prop_material_cache.h | 11 +---- .../material_cache/prop_material_cache_pcm.h | 9 ---- modules/props/prop_ess_entity.h | 11 ----- modules/props/prop_instance.cpp | 8 ---- modules/props/prop_instance.h | 11 ----- modules/props/prop_instance_job.h | 12 ------ modules/props/prop_instance_merger.cpp | 21 +--------- modules/props/prop_instance_merger.h | 11 ----- modules/props/prop_instance_prop_job.cpp | 6 --- modules/props/prop_instance_prop_job.h | 3 -- modules/props/props/prop_data.cpp | 10 ----- modules/props/props/prop_data.h | 14 +------ modules/props/props/prop_data_entry.cpp | 7 ---- modules/props/props/prop_data_entry.h | 14 +------ modules/props/props/prop_data_light.cpp | 6 --- modules/props/props/prop_data_light.h | 9 ---- modules/props/props/prop_data_portal.h | 3 -- modules/props/props/prop_data_prop.h | 3 -- modules/props/props/prop_data_scene.h | 3 -- modules/props/props/prop_data_tiled_wall.h | 3 -- modules/props/singleton/prop_cache.cpp | 26 ------------ modules/props/singleton/prop_cache.h | 12 ------ modules/props/singleton/prop_utils.cpp | 18 ++------ modules/props/singleton/prop_utils.h | 16 -------- modules/props/tiled_wall/tiled_wall.cpp | 16 +------- modules/props/tiled_wall/tiled_wall.h | 11 ----- modules/props/tiled_wall/tiled_wall_data.cpp | 27 ------------ modules/props/tiled_wall/tiled_wall_data.h | 10 ----- 38 files changed, 28 insertions(+), 396 deletions(-) diff --git a/modules/props/clutter/ground_clutter.cpp b/modules/props/clutter/ground_clutter.cpp index ef7e5902e..ed3551e47 100644 --- a/modules/props/clutter/ground_clutter.cpp +++ b/modules/props/clutter/ground_clutter.cpp @@ -52,7 +52,6 @@ GroundClutter::~GroundClutter() { } void GroundClutter::_bind_methods() { - #ifdef TEXTURE_PACKER_PRESENT BIND_VMETHOD(MethodInfo("_add_textures_to", PropertyInfo(Variant::OBJECT, "packer", PROPERTY_HINT_RESOURCE_TYPE, "TexturePacker"))); diff --git a/modules/props/clutter/ground_clutter.h b/modules/props/clutter/ground_clutter.h index a5341f0ea..33c16e59f 100644 --- a/modules/props/clutter/ground_clutter.h +++ b/modules/props/clutter/ground_clutter.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/io/resource.h" -#else #include "core/resource.h" -#endif #ifdef TEXTURE_PACKER_PRESENT #include "../../texture_packer/texture_packer.h" diff --git a/modules/props/clutter/ground_clutter_foliage.h b/modules/props/clutter/ground_clutter_foliage.h index c4e561d9c..23b10a7e2 100644 --- a/modules/props/clutter/ground_clutter_foliage.h +++ b/modules/props/clutter/ground_clutter_foliage.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 "ground_clutter.h" @@ -53,7 +46,7 @@ private: static void _bind_methods(); private: - Vector > _textures; + Vector> _textures; }; #endif diff --git a/modules/props/editor/prop_editor_plugin.cpp b/modules/props/editor/prop_editor_plugin.cpp index 21519d982..0485305cc 100644 --- a/modules/props/editor/prop_editor_plugin.cpp +++ b/modules/props/editor/prop_editor_plugin.cpp @@ -26,21 +26,11 @@ SOFTWARE. #include "../singleton/prop_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 PropEditorPlugin::convert_active_scene_to_prop_data() { SceneTree *st = SceneTree::get_singleton(); @@ -109,14 +99,9 @@ void PropEditorPlugin::_convert_selected_scene_to_prop_data(Variant param) { PropEditorPlugin::PropEditorPlugin(EditorNode *p_node) { editor = p_node; -#if VERSION_MAJOR < 4 editor->add_tool_menu_item("Convert active scene to PropData", this, "convert_active_scene_to_prop_data"); editor->add_tool_menu_item("Convert selected scene(s) to PropData", this, "convert_selected_scene_to_prop_data"); -#if VERSION_MINOR >= 4 editor->add_tool_menu_item("(Prop) Find room points.", this, "find_room_points"); -#endif -#else -#endif HBoxContainer *container = memnew(HBoxContainer); diff --git a/modules/props/editor/prop_editor_plugin.h b/modules/props/editor/prop_editor_plugin.h index 2e7f7ec9d..64cd39a49 100644 --- a/modules/props/editor/prop_editor_plugin.h +++ b/modules/props/editor/prop_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 PropEditorPlugin : public EditorPlugin { - GDCLASS(PropEditorPlugin, EditorPlugin); EditorNode *editor; diff --git a/modules/props/jobs/prop_mesher_job_step.h b/modules/props/jobs/prop_mesher_job_step.h index c211acb28..06b30b56f 100644 --- a/modules/props/jobs/prop_mesher_job_step.h +++ b/modules/props/jobs/prop_mesher_job_step.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/reference.h" -#else #include "core/reference.h" -#endif #ifdef MESH_UTILS_PRESENT #include "../../mesh_utils/fast_quadratic_mesh_simplifier.h" @@ -63,19 +54,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 PropMesherJobStep(); ~PropMesherJobStep(); @@ -86,12 +77,12 @@ protected: PropMesherJobStepType _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(PropMesherJobStep::PropMesherJobStepType); diff --git a/modules/props/jobs/prop_texture_job.h b/modules/props/jobs/prop_texture_job.h index e24df19ea..ff3e77c69 100644 --- a/modules/props/jobs/prop_texture_job.h +++ b/modules/props/jobs/prop_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/lights/prop_light.cpp b/modules/props/lights/prop_light.cpp index 8957798a2..b16b361fc 100644 --- a/modules/props/lights/prop_light.cpp +++ b/modules/props/lights/prop_light.cpp @@ -25,7 +25,7 @@ SOFTWARE. Vector3 PropLight::get_position() { return _position; } -void PropLight::set_position(const Vector3 &pos) { +void PropLight::set_position(const Vector3 &pos) { _position = pos; } diff --git a/modules/props/lights/prop_light.h b/modules/props/lights/prop_light.h index 2b1c1e9c6..405824879 100644 --- a/modules/props/lights/prop_light.h +++ b/modules/props/lights/prop_light.h @@ -22,20 +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/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 PropLight : public Reference { GDCLASS(PropLight, Reference); diff --git a/modules/props/material_cache/prop_material_cache.cpp b/modules/props/material_cache/prop_material_cache.cpp index c5a7f9409..23c4aa619 100644 --- a/modules/props/material_cache/prop_material_cache.cpp +++ b/modules/props/material_cache/prop_material_cache.cpp @@ -34,17 +34,6 @@ SOFTWARE. #undef PROPS_PRESENT #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++) { \ @@ -52,8 +41,6 @@ SOFTWARE. } \ return r; -#endif - bool PropMaterialCache::get_initialized() { return _initialized; } diff --git a/modules/props/material_cache/prop_material_cache.h b/modules/props/material_cache/prop_material_cache.h index d5f13d013..e1d0a13f7 100644 --- a/modules/props/material_cache/prop_material_cache.h +++ b/modules/props/material_cache/prop_material_cache.h @@ -22,24 +22,15 @@ 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 PropData; diff --git a/modules/props/material_cache/prop_material_cache_pcm.h b/modules/props/material_cache/prop_material_cache_pcm.h index 621d9bcd9..8d7b64bfb 100644 --- a/modules/props/material_cache/prop_material_cache_pcm.h +++ b/modules/props/material_cache/prop_material_cache_pcm.h @@ -22,22 +22,13 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - #include "prop_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/prop_ess_entity.h b/modules/props/prop_ess_entity.h index e000ef507..5f82a5c55 100644 --- a/modules/props/prop_ess_entity.h +++ b/modules/props/prop_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/prop_instance.cpp b/modules/props/prop_instance.cpp index 29ef7493e..cb4812f80 100644 --- a/modules/props/prop_instance.cpp +++ b/modules/props/prop_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/prop_instance.h b/modules/props/prop_instance.h index 885d01909..bd273b218 100644 --- a/modules/props/prop_instance.h +++ b/modules/props/prop_instance.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 "scene/resources/material.h" diff --git a/modules/props/prop_instance_job.h b/modules/props/prop_instance_job.h index 33394aa25..0a9b65a9d 100644 --- a/modules/props/prop_instance_job.h +++ b/modules/props/prop_instance_job.h @@ -22,26 +22,14 @@ 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 - class PropData; class PropInstance; diff --git a/modules/props/prop_instance_merger.cpp b/modules/props/prop_instance_merger.cpp index 833334443..527eee162 100644 --- a/modules/props/prop_instance_merger.cpp +++ b/modules/props/prop_instance_merger.cpp @@ -4,26 +4,9 @@ //#include "../thread_pool/thread_pool.h" -#include "core/version.h" -#include "servers/visual_server.h" #include "scene/resources/world.h" +#include "servers/visual_server.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; - -#define GET_WORLD get_world_3d - -#else #include "core/engine.h" #define VARIANT_ARRAY_GET(arr) \ @@ -37,8 +20,6 @@ typedef class RenderingServer VS; #define GET_WORLD get_world -#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/prop_instance_merger.h b/modules/props/prop_instance_merger.h index c14f89d7b..9bbbefd44 100644 --- a/modules/props/prop_instance_merger.h +++ b/modules/props/prop_instance_merger.h @@ -22,20 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - #include "prop_instance.h" -#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/prop_instance_prop_job.cpp b/modules/props/prop_instance_prop_job.cpp index a9d53b047..61f2f8d04 100644 --- a/modules/props/prop_instance_prop_job.cpp +++ b/modules/props/prop_instance_prop_job.cpp @@ -22,13 +22,7 @@ SOFTWARE. #include "prop_instance_prop_job.h" -#include "core/version.h" - -#if VERSION_MAYOR > 3 -#define GET_WORLD get_world_3d -#else #define GET_WORLD get_world -#endif #include "jobs/prop_mesher_job_step.h" #include "lights/prop_light.h" diff --git a/modules/props/prop_instance_prop_job.h b/modules/props/prop_instance_prop_job.h index 5852569da..8e94ac6e2 100644 --- a/modules/props/prop_instance_prop_job.h +++ b/modules/props/prop_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_instance_job.h" class PropMesher; diff --git a/modules/props/props/prop_data.cpp b/modules/props/props/prop_data.cpp index 7015e1101..f878fed89 100644 --- a/modules/props/props/prop_data.cpp +++ b/modules/props/props/prop_data.cpp @@ -26,13 +26,7 @@ SOFTWARE. #include "prop_data_light.h" #include "prop_data_prop.h" -#if VERSION_MAJOR < 4 #include "servers/physics_server.h" -#else -#include "servers/physics_server_3d.h" - -#define Shape Shape3D -#endif int PropData::get_id() const { return _id; @@ -81,11 +75,7 @@ int PropData::get_prop_count() const { Vector PropData::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/props/prop_data.h b/modules/props/props/prop_data.h index a96d4c3a9..466d73828 100644 --- a/modules/props/props/prop_data.h +++ b/modules/props/props/prop_data.h @@ -22,23 +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/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/props/prop_data_entry.cpp b/modules/props/props/prop_data_entry.cpp index 3843361d7..a7c29126c 100644 --- a/modules/props/props/prop_data_entry.cpp +++ b/modules/props/props/prop_data_entry.cpp @@ -26,18 +26,12 @@ 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 #if TEXTURE_PACKER_PRESENT #include "../../texture_packer/texture_packer.h" #endif - #include "../prop_mesher.h" Transform PropDataEntry::get_transform() const { @@ -115,5 +109,4 @@ void PropDataEntry::_bind_methods() { ClassDB::bind_method(D_METHOD("_processor_process", "prop_data", "node", "transform"), &PropDataEntry::_processor_process); ClassDB::bind_method(D_METHOD("_processor_get_node_for", "transform"), &PropDataEntry::_processor_get_node_for); ClassDB::bind_method(D_METHOD("_processor_evaluate_children"), &PropDataEntry::_processor_evaluate_children); - } diff --git a/modules/props/props/prop_data_entry.h b/modules/props/props/prop_data_entry.h index c1df55cc1..654ad83ac 100644 --- a/modules/props/props/prop_data_entry.h +++ b/modules/props/props/prop_data_entry.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/io/resource.h" -#include "core/math/transform_3d.h" - -#ifndef Transform -#define Transform Transform3D -#endif -#else -#include "core/resource.h" #include "core/math/transform.h" -#endif +#include "core/resource.h" class PropData; class PropMesher; diff --git a/modules/props/props/prop_data_light.cpp b/modules/props/props/prop_data_light.cpp index e2b61e7ea..ebe0a33a1 100644 --- a/modules/props/props/prop_data_light.cpp +++ b/modules/props/props/prop_data_light.cpp @@ -24,13 +24,7 @@ SOFTWARE. #include "prop_data.h" -#if VERSION_MAJOR < 4 #include "scene/3d/light.h" -#else -#include "scene/3d/light_3d.h" -#define OmniLight OmniLight3D -#define Light Light3D -#endif Color PropDataLight::get_light_color() const { return _light_color; diff --git a/modules/props/props/prop_data_light.h b/modules/props/props/prop_data_light.h index 697027e9a..6b3c5ecd3 100644 --- a/modules/props/props/prop_data_light.h +++ b/modules/props/props/prop_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_data_entry.h" diff --git a/modules/props/props/prop_data_portal.h b/modules/props/props/prop_data_portal.h index 522459341..1ce85f3d4 100644 --- a/modules/props/props/prop_data_portal.h +++ b/modules/props/props/prop_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_data_entry.h" diff --git a/modules/props/props/prop_data_prop.h b/modules/props/props/prop_data_prop.h index 9ca0bbb46..e4c016ebb 100644 --- a/modules/props/props/prop_data_prop.h +++ b/modules/props/props/prop_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_data_entry.h" diff --git a/modules/props/props/prop_data_scene.h b/modules/props/props/prop_data_scene.h index 4c1298e3f..5b6a65147 100644 --- a/modules/props/props/prop_data_scene.h +++ b/modules/props/props/prop_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_data_entry.h" diff --git a/modules/props/props/prop_data_tiled_wall.h b/modules/props/props/prop_data_tiled_wall.h index d41916018..e6a41985e 100644 --- a/modules/props/props/prop_data_tiled_wall.h +++ b/modules/props/props/prop_data_tiled_wall.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_data_entry.h" diff --git a/modules/props/singleton/prop_cache.cpp b/modules/props/singleton/prop_cache.cpp index 49d38e8b7..516a54e37 100644 --- a/modules/props/singleton/prop_cache.cpp +++ b/modules/props/singleton/prop_cache.cpp @@ -27,13 +27,8 @@ 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 "../jobs/prop_texture_job.h" @@ -46,17 +41,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 +48,6 @@ SOFTWARE. } \ return r; -#endif - PropCache *PropCache::_instance; PropCache *PropCache::get_singleton() { @@ -352,7 +334,6 @@ void PropCache::material_cache_custom_key_unref(const uint64_t key) { Ref PropCache::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()); @@ -360,9 +341,6 @@ Ref PropCache::load_resource(const String &path, const String &type_hi resl->wait(); return resl->get_resource(); -#else - return rl->load(path, type_hint); -#endif } PropCache::PropCache() { @@ -375,11 +353,7 @@ PropCache::PropCache() { #endif #ifdef TEXTURE_PACKER_PRESENT -#if VERSION_MAJOR < 4 _texture_flags = GLOBAL_DEF("props/texture_flags", Texture::FLAG_MIPMAPS | Texture::FLAG_FILTER); -#else - _texture_flags = GLOBAL_DEF("props/texture_flags", 0); -#endif _max_atlas_size = GLOBAL_DEF("props/max_atlas_size", 1024); _keep_original_atlases = GLOBAL_DEF("props/keep_original_atlases", false); diff --git a/modules/props/singleton/prop_cache.h b/modules/props/singleton/prop_cache.h index 5de43c58d..f02a5e3c2 100644 --- a/modules/props/singleton/prop_cache.h +++ b/modules/props/singleton/prop_cache.h @@ -22,26 +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/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/singleton/prop_utils.cpp b/modules/props/singleton/prop_utils.cpp index 26f5c811f..549e4fc4a 100644 --- a/modules/props/singleton/prop_utils.cpp +++ b/modules/props/singleton/prop_utils.cpp @@ -25,14 +25,10 @@ SOFTWARE. #include "../props/prop_data.h" #include "../props/prop_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,23 +36,17 @@ 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 PropUtils *PropUtils::_instance; -Vector > PropUtils::_processors; +Vector> PropUtils::_processors; PropUtils *PropUtils::get_singleton() { return _instance; } Ref PropUtils::convert_tree(Node *root) { -#if VERSION_MAJOR < 4 ERR_FAIL_COND_V(!ObjectDB::instance_validate(root), Ref()); -#endif Ref data; data.instance(); @@ -68,9 +58,7 @@ Ref PropUtils::convert_tree(Node *root) { } void PropUtils::_convert_tree(Ref prop_data, Node *node, const Transform &transform) { -#if VERSION_MAJOR < 4 ERR_FAIL_COND(!ObjectDB::instance_validate(node)); -#endif for (int i = 0; i < PropUtils::_processors.size(); ++i) { Ref proc = PropUtils::_processors.get(i); @@ -161,7 +149,7 @@ bool PropUtils::generate_room_points_node(Node *node) { void PropUtils::generate_room_points(Room *room) { ERR_FAIL_COND(!ObjectDB::instance_validate(room)); - Vector > mesh_arrays; + Vector> mesh_arrays; get_mesh_arrays(room, &mesh_arrays); @@ -306,7 +294,7 @@ bool PropUtils::is_plane_unique(const PoolVector &planes, const Plane &p) return true; } -void PropUtils::get_mesh_arrays(Node *node, Vector > *arrs) { +void PropUtils::get_mesh_arrays(Node *node, Vector> *arrs) { ERR_FAIL_COND(!ObjectDB::instance_validate(node)); for (int i = 0; i < node->get_child_count(); ++i) { diff --git a/modules/props/singleton/prop_utils.h b/modules/props/singleton/prop_utils.h index d71160f1d..e2e78404c 100644 --- a/modules/props/singleton/prop_utils.h +++ b/modules/props/singleton/prop_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 PropData; class PropDataEntry; -#if VERSION_MINOR >= 4 class Room; -#endif class PropUtils : public Object { GDCLASS(PropUtils, Object); @@ -57,12 +43,10 @@ public: Ref convert_tree(Node *root); void _convert_tree(Ref prop_data, Node *node, const Transform &transform); -#if VERSION_MINOR >= 4 bool generate_room_points_node(Node *node); void generate_room_points(Room *room); void get_mesh_arrays(Node *node, Vector> *arrs); bool is_plane_unique(const PoolVector &planes, const Plane &p); -#endif static int add_processor(const Ref &processor); static Ref get_processor(const int index); diff --git a/modules/props/tiled_wall/tiled_wall.cpp b/modules/props/tiled_wall/tiled_wall.cpp index b3bc5cd7b..db0e92dae 100644 --- a/modules/props/tiled_wall/tiled_wall.cpp +++ b/modules/props/tiled_wall/tiled_wall.cpp @@ -1,18 +1,10 @@ #include "tiled_wall.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" @@ -23,9 +15,9 @@ #include "../singleton/prop_cache.h" #include "core/core_string_names.h" -#include "tiled_wall_data.h" -#include "servers/physics_server.h" #include "scene/resources/world.h" +#include "servers/physics_server.h" +#include "tiled_wall_data.h" int TiledWall::get_width() const { return _width; @@ -243,11 +235,7 @@ void TiledWall::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/tiled_wall/tiled_wall.h b/modules/props/tiled_wall/tiled_wall.h index 69f6b7995..7ab5408c8 100644 --- a/modules/props/tiled_wall/tiled_wall.h +++ b/modules/props/tiled_wall/tiled_wall.h @@ -22,21 +22,10 @@ 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 #include "scene/3d/visual_instance.h" -#else -#include "scene/3d/node_3d.h" - -#define SpatialMaterial StandardMaterial3D -#define Spatial Node3D -#define Texture Texture2D -#endif #include "core/math/vector3.h" diff --git a/modules/props/tiled_wall/tiled_wall_data.cpp b/modules/props/tiled_wall/tiled_wall_data.cpp index 31a7be614..5cfe70521 100644 --- a/modules/props/tiled_wall/tiled_wall_data.cpp +++ b/modules/props/tiled_wall/tiled_wall_data.cpp @@ -22,15 +22,7 @@ SOFTWARE. #include "tiled_wall_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 TiledWallData::get_texture_count() const { Vector TiledWallData::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 TiledWallData::get_flavour_texture_count() const { Vector TiledWallData::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/tiled_wall/tiled_wall_data.h b/modules/props/tiled_wall/tiled_wall_data.h index 05df4abb8..ec8a7649c 100644 --- a/modules/props/tiled_wall/tiled_wall_data.h +++ b/modules/props/tiled_wall/tiled_wall_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"