Fix compile for 4.0.

This commit is contained in:
Relintai 2021-02-06 11:54:57 +01:00
parent bfb60df215
commit f4bc70c94e
13 changed files with 86 additions and 13 deletions

View File

@ -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

View File

@ -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"

View File

@ -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"

View File

@ -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);

View File

@ -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<PropData> PropInstance::get_prop_data() {
return _prop_data;

View File

@ -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"

View File

@ -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<PackedScene> PropSceneInstance::get_scene() {
return _scene;

View File

@ -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"

View File

@ -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"

View File

@ -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);

View File

@ -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"

View File

@ -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<Ref<PropDataEntry>> PropUtils::_processors;

View File

@ -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<Ref<PropDataEntry> > _processors;
static Vector<Ref<PropDataEntry>> _processors;
static PropUtils *_instance;
};