diff --git a/README.md b/README.md index 9d88766..1d12070 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This is a c++ engine module for the Godot Engine. It gives you props, and editor utilities to convert scenes to props. -It supports both godot 3.2 and 4.0 (master). Note that since 4.0 is still in very early stages I only +It supports both godot 3.2 and 4.0 (master [last tested commit](https://github.com/godotengine/godot/commit/b7e10141197fdd9b0dbc4cfa7890329510d36540)). Note that since 4.0 is still in very early stages I only check whether it works from time to time. # Pre-built binaries diff --git a/clutter/ground_clutter.h b/clutter/ground_clutter.h index 4f97610..da92ee3 100644 --- a/clutter/ground_clutter.h +++ b/clutter/ground_clutter.h @@ -23,7 +23,13 @@ SOFTWARE. #ifndef GROUND_CLUTTER_H #define GROUND_CLUTTER_H +#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/clutter/ground_clutter_foliage.h b/clutter/ground_clutter_foliage.h index 10ee575..62632f0 100644 --- a/clutter/ground_clutter_foliage.h +++ b/clutter/ground_clutter_foliage.h @@ -23,9 +23,15 @@ SOFTWARE. #ifndef GROUND_CLUTTER_FOLIAGE_H #define GROUND_CLUTTER_FOLIAGE_H -#include "ground_clutter.h" +#include "core/version.h" +#if VERSION_MAJOR > 3 +#include "core/templates/vector.h" +#else #include "core/vector.h" +#endif + +#include "ground_clutter.h" #include "scene/resources/texture.h" diff --git a/editor/prop_editor_plugin.cpp b/editor/prop_editor_plugin.cpp index 22d7da6..7f5871b 100644 --- a/editor/prop_editor_plugin.cpp +++ b/editor/prop_editor_plugin.cpp @@ -90,8 +90,11 @@ 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"); +#else +#endif HBoxContainer *container = memnew(HBoxContainer); diff --git a/prop_instance.cpp b/prop_instance.cpp index 2565021..5da5337 100644 --- a/prop_instance.cpp +++ b/prop_instance.cpp @@ -4,7 +4,13 @@ //#include "../thread_pool/thread_pool.h" +#include "core/version.h" + +#if VERSION_MAJOR > 3 +#include "core/config/engine.h" +#else #include "core/engine.h" +#endif Ref PropInstance::get_prop_data() { return _prop_data; diff --git a/prop_instance_job.h b/prop_instance_job.h index 9ef5545..9aa7fdf 100644 --- a/prop_instance_job.h +++ b/prop_instance_job.h @@ -23,8 +23,15 @@ SOFTWARE. #ifndef PROP_INSTANCE_JOB_H #define PROP_INSTANCE_JOB_H -#include "core/math/vector3.h" +#include "core/version.h" + +#if VERSION_MAJOR > 3 +#include "core/templates/vector.h" +#else #include "core/vector.h" +#endif + +#include "core/math/vector3.h" #include "../thread_pool/thread_pool_job.h" diff --git a/prop_scene_instance.cpp b/prop_scene_instance.cpp index a3487df..8609a0c 100644 --- a/prop_scene_instance.cpp +++ b/prop_scene_instance.cpp @@ -1,6 +1,12 @@ #include "prop_scene_instance.h" +#include "core/version.h" + +#if VERSION_MAJOR > 3 +#include "core/config/engine.h" +#else #include "core/engine.h" +#endif Ref PropSceneInstance::get_scene() { return _scene; diff --git a/props/prop_data.h b/props/prop_data.h index 799ea3f..64a1514 100644 --- a/props/prop_data.h +++ b/props/prop_data.h @@ -23,12 +23,20 @@ SOFTWARE. #ifndef PROP_DATA_H #define PROP_DATA_H +#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" #include "core/math/vector2.h" #include "core/math/vector3.h" -#include "core/reference.h" -#include "core/vector.h" #include "core/version.h" diff --git a/props/prop_data_entry.h b/props/prop_data_entry.h index b9dc1b7..bde304a 100644 --- a/props/prop_data_entry.h +++ b/props/prop_data_entry.h @@ -23,8 +23,15 @@ SOFTWARE. #ifndef PROP_DATA_DATA_H #define PROP_DATA_DATA_H -#include "core/math/transform.h" +#include "core/version.h" + +#if VERSION_MAJOR > 3 +#include "core/io/resource.h" +#else #include "core/resource.h" +#endif + +#include "core/math/transform.h" #if TEXTURE_PACKER_PRESENT #include "../../texture_packer/texture_packer.h" diff --git a/props/prop_data_light.h b/props/prop_data_light.h index fa8cdd3..381a4b9 100644 --- a/props/prop_data_light.h +++ b/props/prop_data_light.h @@ -23,9 +23,15 @@ SOFTWARE. #ifndef PROP_DATA_LIGHT_H #define PROP_DATA_LIGHT_H -#include "prop_data_entry.h" +#include "core/version.h" +#if VERSION_MAJOR > 3 +#include "core/math/color.h" +#else #include "core/color.h" +#endif + +#include "prop_data_entry.h" class PropDataLight : public PropDataEntry { GDCLASS(PropDataLight, PropDataEntry); diff --git a/register_types.cpp b/register_types.cpp index 092ba8b..d450c86 100644 --- a/register_types.cpp +++ b/register_types.cpp @@ -22,6 +22,14 @@ 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 "props/prop_data.h" #include "props/prop_data_entry.h" #include "props/prop_data_light.h" @@ -38,7 +46,6 @@ SOFTWARE. #include "prop_scene_instance.h" -#include "core/engine.h" #include "singleton/prop_utils.h" #include "./editor/prop_editor_plugin.h" diff --git a/singleton/prop_utils.cpp b/singleton/prop_utils.cpp index b4f19f7..31eb4ec 100644 --- a/singleton/prop_utils.cpp +++ b/singleton/prop_utils.cpp @@ -24,10 +24,15 @@ SOFTWARE. #include "../props/prop_data.h" #include "../props/prop_data_entry.h" -#include "core/engine.h" #include "core/version.h" +#if VERSION_MAJOR > 3 +#include "core/config/engine.h" +#else +#include "core/engine.h" +#endif + PropUtils *PropUtils::_instance; Vector> PropUtils::_processors; diff --git a/singleton/prop_utils.h b/singleton/prop_utils.h index 19206dc..438c0eb 100644 --- a/singleton/prop_utils.h +++ b/singleton/prop_utils.h @@ -23,11 +23,17 @@ SOFTWARE. #ifndef PROP_UTILS_H #define PROP_UTILS_H +#include "core/version.h" + +#if VERSION_MAJOR > 3 +#include "core/object/object.h" +#include "core/object/reference.h" +#include "core/templates/vector.h" +#else #include "core/object.h" - -#include "core/vector.h" - #include "core/reference.h" +#include "core/vector.h" +#endif class PropData; class PropDataEntry; @@ -60,7 +66,7 @@ private: void _remove_processor_bind(const int index); int _get_processor_count_bind(); - static Vector > _processors; + static Vector> _processors; static PropUtils *_instance; };