summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2021-07-15 00:46:35 +0200
committerRémi Verschelde <rverschelde@gmail.com>2021-07-15 00:46:43 +0200
commit06568bbfdfbecb489d3263f6df1e7d298642cd61 (patch)
tree420fd4cf4a5b041f8af3b51b674dc0c3eab1bf6b /modules
parent499be1fb67bbadb11b54763cf6fe04ac1784877b (diff)
Misc cleanup of header includes
Was looking for misuse of module headers without checking that the module is actually enabled and got carried away...
Diffstat (limited to 'modules')
-rw-r--r--modules/fbx/data/fbx_material.cpp4
-rw-r--r--modules/fbx/data/import_state.h1
-rw-r--r--modules/fbx/editor_scene_importer_fbx.h1
-rw-r--r--modules/gdscript/editor/gdscript_translation_parser_plugin.h1
-rw-r--r--modules/gdscript/language_server/gdscript_language_protocol.h12
-rw-r--r--modules/gltf/editor_scene_importer_gltf.cpp22
-rw-r--r--modules/gltf/editor_scene_importer_gltf.h21
-rw-r--r--modules/gltf/gltf_document.cpp41
-rw-r--r--modules/gltf/gltf_document.h8
-rw-r--r--modules/gltf/gltf_state.h6
-rw-r--r--modules/mbedtls/tests/test_crypto_mbedtls.cpp2
-rw-r--r--modules/navigation/navigation_mesh_generator.cpp2
-rw-r--r--modules/text_server_adv/dynamic_font_adv.h1
-rw-r--r--modules/text_server_fb/dynamic_font_fb.h1
-rw-r--r--modules/webrtc/webrtc_data_channel_gdnative.cpp1
-rw-r--r--modules/websocket/editor_debugger_server_websocket.h9
-rw-r--r--modules/websocket/remote_debugger_peer_websocket.h6
17 files changed, 57 insertions, 82 deletions
diff --git a/modules/fbx/data/fbx_material.cpp b/modules/fbx/data/fbx_material.cpp
index cf5d70fa5b..fb6c67f7b9 100644
--- a/modules/fbx/data/fbx_material.cpp
+++ b/modules/fbx/data/fbx_material.cpp
@@ -29,6 +29,10 @@
/*************************************************************************/
#include "fbx_material.h"
+
+// FIXME: Shouldn't depend on core_bind.h! Use DirAccessRef like the rest of
+// the engine instead of _Directory.
+#include "core/core_bind.h"
#include "scene/resources/material.h"
#include "scene/resources/texture.h"
#include "tools/validation_tools.h"
diff --git a/modules/fbx/data/import_state.h b/modules/fbx/data/import_state.h
index 83bc43faff..9ba60eaacf 100644
--- a/modules/fbx/data/import_state.h
+++ b/modules/fbx/data/import_state.h
@@ -37,7 +37,6 @@
#include "pivot_transform.h"
-#include "core/core_bind.h"
#include "core/io/resource_importer.h"
#include "core/templates/vector.h"
#include "editor/import/resource_importer_scene.h"
diff --git a/modules/fbx/editor_scene_importer_fbx.h b/modules/fbx/editor_scene_importer_fbx.h
index 4bb2c9d21b..4a3b78480b 100644
--- a/modules/fbx/editor_scene_importer_fbx.h
+++ b/modules/fbx/editor_scene_importer_fbx.h
@@ -36,7 +36,6 @@
#include "data/import_state.h"
#include "tools/import_utils.h"
-#include "core/core_bind.h"
#include "core/io/resource_importer.h"
#include "core/string/ustring.h"
#include "core/templates/local_vector.h"
diff --git a/modules/gdscript/editor/gdscript_translation_parser_plugin.h b/modules/gdscript/editor/gdscript_translation_parser_plugin.h
index fcf438422a..caa80fc24c 100644
--- a/modules/gdscript/editor/gdscript_translation_parser_plugin.h
+++ b/modules/gdscript/editor/gdscript_translation_parser_plugin.h
@@ -34,7 +34,6 @@
#include "core/templates/set.h"
#include "editor/editor_translation_parser.h"
#include "modules/gdscript/gdscript_parser.h"
-#include "modules/regex/regex.h"
class GDScriptEditorTranslationParserPlugin : public EditorTranslationParserPlugin {
GDCLASS(GDScriptEditorTranslationParserPlugin, EditorTranslationParserPlugin);
diff --git a/modules/gdscript/language_server/gdscript_language_protocol.h b/modules/gdscript/language_server/gdscript_language_protocol.h
index 969c38eab6..5a2dd55c46 100644
--- a/modules/gdscript/language_server/gdscript_language_protocol.h
+++ b/modules/gdscript/language_server/gdscript_language_protocol.h
@@ -28,8 +28,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#ifndef GDSCRIPT_PROTOCAL_SERVER_H
-#define GDSCRIPT_PROTOCAL_SERVER_H
+#ifndef GDSCRIPT_LANGUAGE_PROTOCOL_H
+#define GDSCRIPT_LANGUAGE_PROTOCOL_H
#include "core/io/stream_peer.h"
#include "core/io/stream_peer_tcp.h"
@@ -37,7 +37,13 @@
#include "gdscript_text_document.h"
#include "gdscript_workspace.h"
#include "lsp.hpp"
+
+#include "modules/modules_enabled.gen.h"
+#ifdef MODULE_JSONRPC_ENABLED
#include "modules/jsonrpc/jsonrpc.h"
+#else
+#error "Can't build GDScript LSP without JSONRPC module."
+#endif
#define LSP_MAX_BUFFER_SIZE 4194304
#define LSP_MAX_CLIENTS 8
@@ -108,4 +114,4 @@ public:
GDScriptLanguageProtocol();
};
-#endif
+#endif // GDSCRIPT_LANGUAGE_PROTOCOL_H
diff --git a/modules/gltf/editor_scene_importer_gltf.cpp b/modules/gltf/editor_scene_importer_gltf.cpp
index cef5278f03..eca1c85bf3 100644
--- a/modules/gltf/editor_scene_importer_gltf.cpp
+++ b/modules/gltf/editor_scene_importer_gltf.cpp
@@ -28,22 +28,14 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "core/crypto/crypto_core.h"
-#include "core/io/file_access.h"
-#include "core/math/disjoint_set.h"
-#include "core/math/math_defs.h"
-#include "core/os/os.h"
-#include "editor/import/resource_importer_scene.h"
-#include "modules/gltf/gltf_state.h"
-#include "modules/regex/regex.h"
-#include "scene/3d/bone_attachment_3d.h"
-#include "scene/3d/camera_3d.h"
-#include "scene/3d/mesh_instance_3d.h"
-#include "scene/animation/animation_player.h"
-#include "scene/resources/packed_scene.h"
-#include "scene/resources/surface_tool.h"
+#include "editor_scene_importer_gltf.h"
+
+#include "gltf_document.h"
+#include "gltf_state.h"
-#include "modules/gltf/editor_scene_importer_gltf.h"
+#include "scene/3d/node_3d.h"
+#include "scene/animation/animation_player.h"
+#include "scene/resources/animation.h"
uint32_t EditorSceneImporterGLTF::get_import_flags() const {
return ImportFlags::IMPORT_SCENE | ImportFlags::IMPORT_ANIMATION;
diff --git a/modules/gltf/editor_scene_importer_gltf.h b/modules/gltf/editor_scene_importer_gltf.h
index 566d5cfd34..7bc5f594ed 100644
--- a/modules/gltf/editor_scene_importer_gltf.h
+++ b/modules/gltf/editor_scene_importer_gltf.h
@@ -31,28 +31,13 @@
#ifndef EDITOR_SCENE_IMPORTER_GLTF_H
#define EDITOR_SCENE_IMPORTER_GLTF_H
-#include "core/config/project_settings.h"
-#include "core/object/object.h"
-#include "core/templates/vector.h"
+#include "gltf_state.h"
+
#include "editor/import/resource_importer_scene.h"
-#include "modules/csg/csg_shape.h"
-#include "modules/gridmap/grid_map.h"
-#include "scene/3d/mesh_instance_3d.h"
-#include "scene/3d/multimesh_instance_3d.h"
-#include "scene/3d/node_3d.h"
-#include "scene/3d/skeleton_3d.h"
-#include "scene/animation/animation_player.h"
-#include "scene/gui/check_box.h"
#include "scene/main/node.h"
#include "scene/resources/packed_scene.h"
-#include "scene/resources/surface_tool.h"
-
-#include "gltf_document.h"
-#include "gltf_state.h"
-class AnimationPlayer;
-class BoneAttachment;
-class EditorSceneImporterMeshNode3D;
+class Animation;
#ifdef TOOLS_ENABLED
class EditorSceneImporterGLTF : public EditorSceneImporter {
diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp
index 660c2ab305..71a9b3667f 100644
--- a/modules/gltf/gltf_document.cpp
+++ b/modules/gltf/gltf_document.cpp
@@ -29,9 +29,7 @@
/*************************************************************************/
#include "gltf_document.h"
-#include "core/error/error_list.h"
-#include "core/error/error_macros.h"
-#include "core/variant/variant.h"
+
#include "gltf_accessor.h"
#include "gltf_animation.h"
#include "gltf_camera.h"
@@ -44,35 +42,33 @@
#include "gltf_state.h"
#include "gltf_texture.h"
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "core/core_bind.h"
#include "core/crypto/crypto_core.h"
+#include "core/io/dir_access.h"
#include "core/io/file_access.h"
#include "core/io/json.h"
#include "core/math/disjoint_set.h"
#include "core/variant/typed_array.h"
+#include "core/variant/variant.h"
#include "core/version.h"
#include "core/version_hash.gen.h"
#include "drivers/png/png_driver_common.h"
#include "editor/import/resource_importer_scene.h"
+#include "scene/2d/node_2d.h"
+#include "scene/3d/camera_3d.h"
+#include "scene/3d/multimesh_instance_3d.h"
+#include "scene/animation/animation_player.h"
+#include "scene/resources/surface_tool.h"
+
+#include "modules/modules_enabled.gen.h"
#ifdef MODULE_CSG_ENABLED
#include "modules/csg/csg_shape.h"
#endif // MODULE_CSG_ENABLED
#ifdef MODULE_GRIDMAP_ENABLED
#include "modules/gridmap/grid_map.h"
#endif // MODULE_GRIDMAP_ENABLED
-#include "scene/2d/node_2d.h"
-#include "scene/3d/bone_attachment_3d.h"
-#include "scene/3d/camera_3d.h"
-#include "scene/3d/mesh_instance_3d.h"
-#include "scene/3d/multimesh_instance_3d.h"
-#include "scene/3d/node_3d.h"
-#include "scene/3d/skeleton_3d.h"
-#include "scene/animation/animation_player.h"
-#include "scene/main/node.h"
-#include "scene/resources/surface_tool.h"
+
+#include <stdio.h>
+#include <stdlib.h>
#include <limits>
Error GLTFDocument::serialize(Ref<GLTFState> state, Node *p_root, const String &p_path) {
@@ -2873,16 +2869,13 @@ Error GLTFDocument::_serialize_images(Ref<GLTFState> state, const String &p_path
name = itos(i);
}
name = _gen_unique_name(state, name);
- name = name.pad_zeros(3);
- Ref<_Directory> dir;
- dir.instantiate();
+ name = name.pad_zeros(3) + ".png";
String texture_dir = "textures";
String new_texture_dir = p_path.get_base_dir() + "/" + texture_dir;
- dir->open(p_path.get_base_dir());
- if (!dir->dir_exists(new_texture_dir)) {
- dir->make_dir(new_texture_dir);
+ DirAccessRef da = DirAccess::open(p_path.get_base_dir());
+ if (!da->dir_exists(new_texture_dir)) {
+ da->make_dir(new_texture_dir);
}
- name = name + ".png";
image->save_png(new_texture_dir.plus_file(name));
d["uri"] = texture_dir.plus_file(name);
}
diff --git a/modules/gltf/gltf_document.h b/modules/gltf/gltf_document.h
index 514373c4f0..3e8ea19045 100644
--- a/modules/gltf/gltf_document.h
+++ b/modules/gltf/gltf_document.h
@@ -31,11 +31,9 @@
#ifndef GLTF_DOCUMENT_H
#define GLTF_DOCUMENT_H
-#include "editor/import/resource_importer_scene.h"
-#include "editor/import/scene_importer_mesh_node_3d.h"
#include "gltf_animation.h"
-#include "modules/modules_enabled.gen.h"
-#include "scene/2d/node_2d.h"
+
+#include "editor/import/scene_importer_mesh_node_3d.h"
#include "scene/3d/bone_attachment_3d.h"
#include "scene/3d/light_3d.h"
#include "scene/3d/mesh_instance_3d.h"
@@ -45,6 +43,8 @@
#include "scene/resources/material.h"
#include "scene/resources/texture.h"
+#include "modules/modules_enabled.gen.h"
+
class GLTFState;
class GLTFSkin;
class GLTFNode;
diff --git a/modules/gltf/gltf_state.h b/modules/gltf/gltf_state.h
index ba6bf8a533..d8209523c5 100644
--- a/modules/gltf/gltf_state.h
+++ b/modules/gltf/gltf_state.h
@@ -31,9 +31,6 @@
#ifndef GLTF_STATE_H
#define GLTF_STATE_H
-#include "core/io/resource.h"
-#include "core/templates/vector.h"
-#include "editor_scene_importer_gltf.h"
#include "gltf_accessor.h"
#include "gltf_animation.h"
#include "gltf_buffer_view.h"
@@ -45,6 +42,9 @@
#include "gltf_skeleton.h"
#include "gltf_skin.h"
#include "gltf_texture.h"
+
+#include "core/io/resource.h"
+#include "core/templates/vector.h"
#include "scene/animation/animation_player.h"
#include "scene/resources/texture.h"
diff --git a/modules/mbedtls/tests/test_crypto_mbedtls.cpp b/modules/mbedtls/tests/test_crypto_mbedtls.cpp
index 4217497082..8762838883 100644
--- a/modules/mbedtls/tests/test_crypto_mbedtls.cpp
+++ b/modules/mbedtls/tests/test_crypto_mbedtls.cpp
@@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "modules/mbedtls/tests/test_crypto_mbedtls.h"
+#include "test_crypto_mbedtls.h"
#include "modules/mbedtls/crypto_mbedtls.h"
#include "tests/test_macros.h"
diff --git a/modules/navigation/navigation_mesh_generator.cpp b/modules/navigation/navigation_mesh_generator.cpp
index 0d8330c1da..7aeb9e1858 100644
--- a/modules/navigation/navigation_mesh_generator.cpp
+++ b/modules/navigation/navigation_mesh_generator.cpp
@@ -47,12 +47,12 @@
#include "scene/resources/sphere_shape_3d.h"
#include "scene/resources/world_margin_shape_3d.h"
-#include "modules/modules_enabled.gen.h"
#ifdef TOOLS_ENABLED
#include "editor/editor_node.h"
#include "editor/editor_settings.h"
#endif
+#include "modules/modules_enabled.gen.h"
#ifdef MODULE_CSG_ENABLED
#include "modules/csg/csg_shape.h"
#endif
diff --git a/modules/text_server_adv/dynamic_font_adv.h b/modules/text_server_adv/dynamic_font_adv.h
index 1292966f0c..b3f97bb029 100644
--- a/modules/text_server_adv/dynamic_font_adv.h
+++ b/modules/text_server_adv/dynamic_font_adv.h
@@ -34,7 +34,6 @@
#include "font_adv.h"
#include "modules/modules_enabled.gen.h"
-
#ifdef MODULE_FREETYPE_ENABLED
#include <ft2build.h>
diff --git a/modules/text_server_fb/dynamic_font_fb.h b/modules/text_server_fb/dynamic_font_fb.h
index b34c8cbed5..82e59fa607 100644
--- a/modules/text_server_fb/dynamic_font_fb.h
+++ b/modules/text_server_fb/dynamic_font_fb.h
@@ -34,7 +34,6 @@
#include "font_fb.h"
#include "modules/modules_enabled.gen.h"
-
#ifdef MODULE_FREETYPE_ENABLED
#include <ft2build.h>
diff --git a/modules/webrtc/webrtc_data_channel_gdnative.cpp b/modules/webrtc/webrtc_data_channel_gdnative.cpp
index d4cf464c7c..f3009dde2f 100644
--- a/modules/webrtc/webrtc_data_channel_gdnative.cpp
+++ b/modules/webrtc/webrtc_data_channel_gdnative.cpp
@@ -31,6 +31,7 @@
#ifdef WEBRTC_GDNATIVE_ENABLED
#include "webrtc_data_channel_gdnative.h"
+
#include "core/io/resource_loader.h"
#include "modules/gdnative/nativescript/nativescript.h"
diff --git a/modules/websocket/editor_debugger_server_websocket.h b/modules/websocket/editor_debugger_server_websocket.h
index 2f73b98c3d..d9543bb647 100644
--- a/modules/websocket/editor_debugger_server_websocket.h
+++ b/modules/websocket/editor_debugger_server_websocket.h
@@ -28,12 +28,11 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#ifndef SCRIPT_EDITOR_DEBUGGER_WEBSOCKET_H
-#define SCRIPT_EDITOR_DEBUGGER_WEBSOCKET_H
-
-#include "modules/websocket/websocket_server.h"
+#ifndef EDITOR_DEBUGGER_SERVER_WEBSOCKET_H
+#define EDITOR_DEBUGGER_SERVER_WEBSOCKET_H
#include "editor/debugger/editor_debugger_server.h"
+#include "modules/websocket/websocket_server.h"
class EditorDebuggerServerWebSocket : public EditorDebuggerServer {
GDCLASS(EditorDebuggerServerWebSocket, EditorDebuggerServer);
@@ -59,4 +58,4 @@ public:
~EditorDebuggerServerWebSocket();
};
-#endif // SCRIPT_EDITOR_DEBUGGER_WEBSOCKET_H
+#endif // EDITOR_DEBUGGER_SERVER_WEBSOCKET_H
diff --git a/modules/websocket/remote_debugger_peer_websocket.h b/modules/websocket/remote_debugger_peer_websocket.h
index 03c60fb480..590d925dcc 100644
--- a/modules/websocket/remote_debugger_peer_websocket.h
+++ b/modules/websocket/remote_debugger_peer_websocket.h
@@ -28,8 +28,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#ifndef SCRIPT_DEBUGGER_WEBSOCKET_H
-#define SCRIPT_DEBUGGER_WEBSOCKET_H
+#ifndef REMOTE_DEBUGGER_PEER_WEBSOCKET_H
+#define REMOTE_DEBUGGER_PEER_WEBSOCKET_H
#ifdef JAVASCRIPT_ENABLED
#include "modules/websocket/emws_client.h"
@@ -62,4 +62,4 @@ public:
RemoteDebuggerPeerWebSocket(Ref<WebSocketPeer> p_peer = Ref<WebSocketPeer>());
};
-#endif // SCRIPT_DEBUGGER_WEBSOCKET_H
+#endif // REMOTE_DEBUGGER_PEER_WEBSOCKET_H