diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2023-06-13 16:56:21 +0200 |
|---|---|---|
| committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-06-15 14:35:45 +0200 |
| commit | 25b2f1780a9c7d7ae5579cc87c89b0c7e2baa14d (patch) | |
| tree | 40d2d50d34c175da3b7c5123e8918cc5816bd32b /modules/navigation | |
| parent | 773414606079fa745d1c37fce49324ab6a09e972 (diff) | |
| download | redot-engine-25b2f1780a9c7d7ae5579cc87c89b0c7e2baa14d.tar.gz | |
Style: Harmonize header includes in modules
This applies our existing style guide, and adds a new rule to that style
guide for modular components such as platform ports and modules:
Includes from the platform port or module ("local" includes) should be listed
first in their own block using relative paths, before Godot's "core" includes
which use "absolute" (project folder relative) paths, and finally thirdparty
includes.
Includes in `#ifdef`s come after their relevant section, i.e. the overall
structure is:
- Local includes
* Conditional local includes
- Core includes
* Conditional core includes
- Thirdparty includes
* Conditional thirdparty includes
Diffstat (limited to 'modules/navigation')
| -rw-r--r-- | modules/navigation/editor/navigation_mesh_editor_plugin.cpp | 1 | ||||
| -rw-r--r-- | modules/navigation/godot_navigation_server.cpp | 4 | ||||
| -rw-r--r-- | modules/navigation/godot_navigation_server.h | 10 | ||||
| -rw-r--r-- | modules/navigation/nav_agent.h | 5 | ||||
| -rw-r--r-- | modules/navigation/nav_base.h | 1 | ||||
| -rw-r--r-- | modules/navigation/nav_map.cpp | 5 | ||||
| -rw-r--r-- | modules/navigation/nav_map.h | 6 | ||||
| -rw-r--r-- | modules/navigation/nav_obstacle.h | 3 | ||||
| -rw-r--r-- | modules/navigation/nav_region.h | 4 | ||||
| -rw-r--r-- | modules/navigation/register_types.cpp | 6 |
10 files changed, 24 insertions, 21 deletions
diff --git a/modules/navigation/editor/navigation_mesh_editor_plugin.cpp b/modules/navigation/editor/navigation_mesh_editor_plugin.cpp index bf6a75cce8..634d70d3bd 100644 --- a/modules/navigation/editor/navigation_mesh_editor_plugin.cpp +++ b/modules/navigation/editor/navigation_mesh_editor_plugin.cpp @@ -33,6 +33,7 @@ #ifdef TOOLS_ENABLED #include "../navigation_mesh_generator.h" + #include "core/io/marshalls.h" #include "core/io/resource_saver.h" #include "editor/editor_node.h" diff --git a/modules/navigation/godot_navigation_server.cpp b/modules/navigation/godot_navigation_server.cpp index 3783c001f1..5ac0c333a8 100644 --- a/modules/navigation/godot_navigation_server.cpp +++ b/modules/navigation/godot_navigation_server.cpp @@ -30,12 +30,12 @@ #include "godot_navigation_server.h" -#include "core/os/mutex.h" - #ifndef _3D_DISABLED #include "navigation_mesh_generator.h" #endif +#include "core/os/mutex.h" + using namespace NavigationUtilities; /// Creates a struct for each function and a function that once called creates diff --git a/modules/navigation/godot_navigation_server.h b/modules/navigation/godot_navigation_server.h index 7bf5bab477..db5379a1f1 100644 --- a/modules/navigation/godot_navigation_server.h +++ b/modules/navigation/godot_navigation_server.h @@ -31,17 +31,17 @@ #ifndef GODOT_NAVIGATION_SERVER_H #define GODOT_NAVIGATION_SERVER_H -#include "core/templates/local_vector.h" -#include "core/templates/rid.h" -#include "core/templates/rid_owner.h" -#include "servers/navigation_server_3d.h" - #include "nav_agent.h" #include "nav_link.h" #include "nav_map.h" #include "nav_obstacle.h" #include "nav_region.h" +#include "core/templates/local_vector.h" +#include "core/templates/rid.h" +#include "core/templates/rid_owner.h" +#include "servers/navigation_server_3d.h" + /// The commands are functions executed during the `sync` phase. #define MERGE_INTERNAL(A, B) A##B diff --git a/modules/navigation/nav_agent.h b/modules/navigation/nav_agent.h index 497b239f84..a5f16591b9 100644 --- a/modules/navigation/nav_agent.h +++ b/modules/navigation/nav_agent.h @@ -31,11 +31,12 @@ #ifndef NAV_AGENT_H #define NAV_AGENT_H -#include "core/object/class_db.h" -#include "core/templates/local_vector.h" #include "nav_agent.h" #include "nav_rid.h" +#include "core/object/class_db.h" +#include "core/templates/local_vector.h" + #include <Agent2d.h> #include <Agent3d.h> diff --git a/modules/navigation/nav_base.h b/modules/navigation/nav_base.h index b5cdc117f2..c28392acf7 100644 --- a/modules/navigation/nav_base.h +++ b/modules/navigation/nav_base.h @@ -33,6 +33,7 @@ #include "nav_rid.h" #include "nav_utils.h" + #include "servers/navigation/navigation_utilities.h" class NavMap; diff --git a/modules/navigation/nav_map.cpp b/modules/navigation/nav_map.cpp index 7fd8f3c073..c8a1bb0e7a 100644 --- a/modules/navigation/nav_map.cpp +++ b/modules/navigation/nav_map.cpp @@ -30,13 +30,14 @@ #include "nav_map.h" -#include "core/config/project_settings.h" -#include "core/object/worker_thread_pool.h" #include "nav_agent.h" #include "nav_link.h" #include "nav_obstacle.h" #include "nav_region.h" +#include "core/config/project_settings.h" +#include "core/object/worker_thread_pool.h" + #include <Obstacle2d.h> #define THREE_POINTS_CROSS_PRODUCT(m_a, m_b, m_c) (((m_c) - (m_a)).cross((m_b) - (m_a))) diff --git a/modules/navigation/nav_map.h b/modules/navigation/nav_map.h index 8d529f464e..5d78c14627 100644 --- a/modules/navigation/nav_map.h +++ b/modules/navigation/nav_map.h @@ -32,16 +32,14 @@ #define NAV_MAP_H #include "nav_rid.h" +#include "nav_utils.h" #include "core/math/math_defs.h" #include "core/object/worker_thread_pool.h" -#include "core/templates/rb_map.h" -#include "nav_utils.h" #include <KdTree2d.h> -#include <RVOSimulator2d.h> - #include <KdTree3d.h> +#include <RVOSimulator2d.h> #include <RVOSimulator3d.h> class NavLink; diff --git a/modules/navigation/nav_obstacle.h b/modules/navigation/nav_obstacle.h index 93910898e9..2b1b9dcd04 100644 --- a/modules/navigation/nav_obstacle.h +++ b/modules/navigation/nav_obstacle.h @@ -31,9 +31,10 @@ #ifndef NAV_OBSTACLE_H #define NAV_OBSTACLE_H +#include "nav_rid.h" + #include "core/object/class_db.h" #include "core/templates/local_vector.h" -#include "nav_rid.h" class NavAgent; class NavMap; diff --git a/modules/navigation/nav_region.h b/modules/navigation/nav_region.h index 72299e8874..0c3c1b56b6 100644 --- a/modules/navigation/nav_region.h +++ b/modules/navigation/nav_region.h @@ -31,11 +31,11 @@ #ifndef NAV_REGION_H #define NAV_REGION_H -#include "scene/resources/navigation_mesh.h" - #include "nav_base.h" #include "nav_utils.h" +#include "scene/resources/navigation_mesh.h" + class NavRegion : public NavBase { NavMap *map = nullptr; Transform3D transform; diff --git a/modules/navigation/register_types.cpp b/modules/navigation/register_types.cpp index 6ba5e90c2e..1401833d0e 100644 --- a/modules/navigation/register_types.cpp +++ b/modules/navigation/register_types.cpp @@ -30,9 +30,6 @@ #include "register_types.h" -#include "core/config/engine.h" -#include "servers/navigation_server_3d.h" - #include "godot_navigation_server.h" #ifndef _3D_DISABLED @@ -43,6 +40,9 @@ #include "editor/navigation_mesh_editor_plugin.h" #endif +#include "core/config/engine.h" +#include "servers/navigation_server_3d.h" + #ifndef _3D_DISABLED NavigationMeshGenerator *_nav_mesh_generator = nullptr; #endif |
