diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-05-31 08:48:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-31 08:48:41 +0200 |
commit | e823a366d02cdcd8ac48f635eeb6127962aeeb2a (patch) | |
tree | 8aefc21a2b836c5d1520d0a4c5f0c6b65ce6aff2 | |
parent | 10cab25f7257340217de5027e4e118ab42abaca4 (diff) | |
parent | 59c2c21b152aad4a9b925aab98ecdb85fee6867d (diff) |
Merge pull request #19270 from akien-mga/recast-buildsystem
Move NavigationMeshEditorPlugin to Recast module as should be
-rw-r--r-- | editor/editor_node.cpp | 2 | ||||
-rw-r--r-- | modules/recast/SCsub | 12 | ||||
-rw-r--r-- | modules/recast/navigation_mesh_editor_plugin.cpp (renamed from editor/plugins/navigation_mesh_editor_plugin.cpp) | 5 | ||||
-rw-r--r-- | modules/recast/navigation_mesh_editor_plugin.h (renamed from editor/plugins/navigation_mesh_editor_plugin.h) | 3 | ||||
-rw-r--r-- | modules/recast/navigation_mesh_generator.cpp (renamed from editor/plugins/navigation_mesh_generator.cpp) | 4 | ||||
-rw-r--r-- | modules/recast/navigation_mesh_generator.h (renamed from editor/plugins/navigation_mesh_generator.h) | 9 | ||||
-rw-r--r-- | modules/recast/register_types.cpp | 7 |
7 files changed, 13 insertions, 29 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 4b068f1000..7e3af2b755 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -88,7 +88,6 @@ #include "editor/plugins/mesh_editor_plugin.h" #include "editor/plugins/mesh_instance_editor_plugin.h" #include "editor/plugins/multimesh_editor_plugin.h" -#include "editor/plugins/navigation_mesh_editor_plugin.h" #include "editor/plugins/navigation_polygon_editor_plugin.h" #include "editor/plugins/particles_2d_editor_plugin.h" #include "editor/plugins/particles_editor_plugin.h" @@ -5365,7 +5364,6 @@ EditorNode::EditorNode() { add_editor_plugin(memnew(TextureEditorPlugin(this))); add_editor_plugin(memnew(AudioBusesEditorPlugin(audio_bus_editor))); add_editor_plugin(memnew(AudioBusesEditorPlugin(audio_bus_editor))); - add_editor_plugin(memnew(NavigationMeshEditorPlugin(this))); add_editor_plugin(memnew(SkeletonEditorPlugin(this))); add_editor_plugin(memnew(PhysicalBonePlugin(this))); diff --git a/modules/recast/SCsub b/modules/recast/SCsub index 530df9a37c..f56be72b24 100644 --- a/modules/recast/SCsub +++ b/modules/recast/SCsub @@ -1,8 +1,9 @@ #!/usr/bin/env python Import('env') +Import('env_modules') -# Not building in a separate env as core needs it +env_recast = env_modules.Clone() # Thirdparty source files if env['builtin_recast']: @@ -22,13 +23,10 @@ if env['builtin_recast']: ] thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] - env.Append(CPPPATH=[thirdparty_dir, thirdparty_dir + "/Include"]) - - lib = env.add_library("recast_builtin", thirdparty_sources) - env.Append(LIBS=[lib]) + env_recast.add_source_files(env.modules_sources, thirdparty_sources) + env_recast.Append(CPPPATH=[thirdparty_dir + "/Include"]) # Godot source files -env.add_source_files(env.modules_sources, "*.cpp") -env.Append(CCFLAGS=['-DRECAST_ENABLED']) +env_recast.add_source_files(env.modules_sources, "*.cpp") Export('env') diff --git a/editor/plugins/navigation_mesh_editor_plugin.cpp b/modules/recast/navigation_mesh_editor_plugin.cpp index da3c744324..8556b7aa0a 100644 --- a/editor/plugins/navigation_mesh_editor_plugin.cpp +++ b/modules/recast/navigation_mesh_editor_plugin.cpp @@ -29,13 +29,12 @@ /*************************************************************************/ #include "navigation_mesh_editor_plugin.h" + #include "io/marshalls.h" #include "io/resource_saver.h" #include "scene/3d/mesh_instance.h" #include "scene/gui/box_container.h" -#ifdef RECAST_ENABLED - void NavigationMeshEditor::_node_removed(Node *p_node) { if (p_node == node) { @@ -162,5 +161,3 @@ NavigationMeshEditorPlugin::NavigationMeshEditorPlugin(EditorNode *p_node) { NavigationMeshEditorPlugin::~NavigationMeshEditorPlugin() { } - -#endif // RECAST_ENABLED diff --git a/editor/plugins/navigation_mesh_editor_plugin.h b/modules/recast/navigation_mesh_editor_plugin.h index 9382467d85..4f3e222002 100644 --- a/editor/plugins/navigation_mesh_editor_plugin.h +++ b/modules/recast/navigation_mesh_editor_plugin.h @@ -31,8 +31,6 @@ #ifndef NAVIGATION_MESH_GENERATOR_PLUGIN_H #define NAVIGATION_MESH_GENERATOR_PLUGIN_H -#ifdef RECAST_ENABLED - #include "editor/editor_node.h" #include "editor/editor_plugin.h" #include "navigation_mesh_generator.h" @@ -83,5 +81,4 @@ public: ~NavigationMeshEditorPlugin(); }; -#endif // RECAST_ENABLED #endif // NAVIGATION_MESH_GENERATOR_PLUGIN_H diff --git a/editor/plugins/navigation_mesh_generator.cpp b/modules/recast/navigation_mesh_generator.cpp index 0537c5c31f..64c4b85269 100644 --- a/editor/plugins/navigation_mesh_generator.cpp +++ b/modules/recast/navigation_mesh_generator.cpp @@ -30,8 +30,6 @@ #include "navigation_mesh_generator.h" -#ifdef RECAST_ENABLED - void NavigationMeshGenerator::_add_vertex(const Vector3 &p_vec3, Vector<float> &p_verticies) { p_verticies.push_back(p_vec3.x); p_verticies.push_back(p_vec3.y); @@ -304,5 +302,3 @@ void NavigationMeshGenerator::clear(Ref<NavigationMesh> p_nav_mesh) { p_nav_mesh->set_vertices(PoolVector<Vector3>()); } } - -#endif //RECAST_ENABLED diff --git a/editor/plugins/navigation_mesh_generator.h b/modules/recast/navigation_mesh_generator.h index d26f541b8d..3588539ef1 100644 --- a/editor/plugins/navigation_mesh_generator.h +++ b/modules/recast/navigation_mesh_generator.h @@ -31,16 +31,11 @@ #ifndef NAVIGATION_MESH_GENERATOR_H #define NAVIGATION_MESH_GENERATOR_H -#ifdef RECAST_ENABLED - #include "editor/editor_node.h" #include "editor/editor_settings.h" - +#include "os/thread.h" #include "scene/3d/mesh_instance.h" - #include "scene/3d/navigation_mesh.h" - -#include "os/thread.h" #include "scene/resources/shape.h" #include <Recast.h> @@ -61,6 +56,4 @@ public: static void clear(Ref<NavigationMesh> p_nav_mesh); }; -#endif // RECAST_ENABLED - #endif // NAVIGATION_MESH_GENERATOR_H diff --git a/modules/recast/register_types.cpp b/modules/recast/register_types.cpp index 913857c591..f2f18fc86f 100644 --- a/modules/recast/register_types.cpp +++ b/modules/recast/register_types.cpp @@ -30,5 +30,10 @@ #include "register_types.h" -void register_recast_types() {} +#include "navigation_mesh_editor_plugin.h" + +void register_recast_types() { + EditorPlugins::add_by_type<NavigationMeshEditorPlugin>(); +} + void unregister_recast_types() {} |