From 9e4315bb502659e73b01eb5b40ce1cac10bea2c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 8 Jun 2023 14:51:32 +0200 Subject: [PATCH] Style: Harmonize header includes in platform ports 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 should be included with relative paths (relative to the root folder of the modular component, e.g. `platform/linuxbsd/`), in their own section before Godot's "core" includes. The `api` and `export` subfolders also need to be handled as self-contained (and thus use relative paths for their "local" includes) as they are all compiled for each editor platform, without necessarily having the api/export matching platform folder in the include path. E.g. the Linux editor build will compile `platform/android/{api,export}/*.cpp` and those need to use relative includes for it to work. --- drivers/coreaudio/audio_driver_coreaudio.cpp | 4 +-- drivers/coremidi/midi_driver_coremidi.cpp | 4 +-- platform/android/SCsub | 2 +- platform/android/android_keys_utils.h | 3 +- platform/android/api/api.cpp | 3 +- platform/android/api/jni_singleton.h | 3 +- platform/android/dir_access_jandroid.cpp | 3 +- platform/android/dir_access_jandroid.h | 4 ++- platform/android/display_server_android.cpp | 8 +++-- platform/android/export/export.cpp | 3 +- platform/android/export/export_plugin.cpp | 4 +-- .../android/export/godot_plugin_config.cpp | 1 + platform/android/file_access_android.h | 1 + .../file_access_filesystem_jandroid.cpp | 3 +- .../android/file_access_filesystem_jandroid.h | 3 +- platform/android/java_godot_io_wrapper.h | 7 ++-- platform/android/java_godot_lib_jni.cpp | 23 +++++++------ platform/android/java_godot_view_wrapper.h | 5 +-- platform/android/java_godot_wrapper.h | 9 ++--- platform/android/jni_utils.h | 6 ++-- platform/android/os_android.cpp | 17 +++++----- platform/android/os_android.h | 1 + platform/android/plugin/godot_plugin_jni.cpp | 13 ++++---- platform/android/string_android.h | 4 ++- platform/android/thread_jandroid.cpp | 4 +-- .../{vulkan => }/vulkan_context_android.cpp | 4 +-- .../{vulkan => }/vulkan_context_android.h | 0 platform/ios/api/api.cpp | 2 +- platform/ios/app_delegate.mm | 9 ++--- platform/ios/display_layer.mm | 5 +-- platform/ios/display_server_ios.h | 6 ++-- platform/ios/display_server_ios.mm | 13 ++++---- platform/ios/export/export.cpp | 3 +- platform/ios/export/export_plugin.cpp | 3 +- platform/ios/export/export_plugin.h | 6 ++-- platform/ios/godot_ios.mm | 3 +- platform/ios/godot_view.mm | 7 ++-- platform/ios/godot_view_renderer.mm | 5 +-- platform/ios/ios.h | 1 + platform/ios/ios.mm | 2 +- platform/ios/joypad_ios.mm | 9 +++-- platform/ios/key_mapping_ios.mm | 2 +- platform/ios/keyboard_input_view.mm | 5 +-- platform/ios/os_ios.h | 10 +++--- platform/ios/os_ios.mm | 12 ++++--- platform/ios/tts_ios.h | 12 +++---- platform/ios/tts_ios.mm | 2 +- platform/ios/view_controller.mm | 8 +++-- platform/ios/vulkan_context_ios.mm | 3 +- platform/linuxbsd/export/export.cpp | 3 +- platform/linuxbsd/export/export_plugin.cpp | 5 +-- .../linuxbsd/freedesktop_portal_desktop.cpp | 3 +- platform/linuxbsd/godot_linuxbsd.cpp | 7 ++-- platform/linuxbsd/joypad_linux.h | 1 + platform/linuxbsd/os_linuxbsd.cpp | 14 ++++---- platform/linuxbsd/os_linuxbsd.h | 5 +-- platform/linuxbsd/x11/detect_prime_x11.cpp | 14 +++----- platform/linuxbsd/x11/display_server_x11.cpp | 11 ++++--- platform/linuxbsd/x11/display_server_x11.h | 33 ++++++++++--------- platform/linuxbsd/x11/gl_manager_x11.cpp | 10 +++--- platform/linuxbsd/x11/gl_manager_x11.h | 10 ++---- platform/linuxbsd/x11/key_mapping_x11.h | 7 ++-- platform/linuxbsd/x11/vulkan_context_x11.h | 1 + platform/macos/display_server_macos.h | 7 ++-- platform/macos/display_server_macos.mm | 15 ++++----- platform/macos/export/codesign.h | 4 +-- platform/macos/export/export_plugin.cpp | 4 +-- platform/macos/export/lipo.h | 4 +-- platform/macos/gl_manager_macos_legacy.h | 6 ++-- platform/macos/gl_manager_macos_legacy.mm | 12 +++---- platform/macos/godot_content_view.mm | 1 + platform/macos/godot_main_macos.mm | 4 +-- platform/macos/joypad_macos.h | 4 +-- platform/macos/key_mapping_macos.mm | 6 ++-- platform/macos/os_macos.h | 9 ++--- platform/macos/os_macos.mm | 8 ++--- platform/macos/vulkan_context_macos.h | 1 + platform/macos/vulkan_context_macos.mm | 4 ++- platform/uwp/app_uwp.cpp | 5 --- platform/uwp/app_uwp.h | 9 +++-- platform/uwp/context_egl_uwp.cpp | 2 +- platform/uwp/context_egl_uwp.h | 7 ++-- platform/uwp/export/export.cpp | 3 +- platform/uwp/export/export_plugin.cpp | 3 +- platform/uwp/export/export_plugin.h | 4 +-- platform/uwp/os_uwp.h | 3 +- platform/web/api/api.cpp | 12 ++++++- platform/web/api/web_tools_editor_plugin.cpp | 6 ++-- platform/web/api/web_tools_editor_plugin.h | 6 +++- platform/web/audio_driver_web.h | 4 +-- platform/web/display_server_web.cpp | 11 ++++--- platform/web/export/export.cpp | 3 +- platform/web/export/export_plugin.cpp | 5 +-- platform/web/export/export_plugin.h | 3 +- platform/web/godot_audio.h | 3 +- platform/web/godot_js.h | 2 +- platform/web/godot_webgl2.h | 4 +-- platform/web/http_client_web.h | 2 +- platform/web/javascript_bridge_singleton.cpp | 4 ++- platform/web/os_web.cpp | 8 ++--- platform/web/os_web.h | 1 + platform/web/web_main.cpp | 8 ++--- platform/windows/display_server_windows.cpp | 14 ++++---- platform/windows/display_server_windows.h | 13 ++++---- platform/windows/export/export.cpp | 3 +- platform/windows/export/export_plugin.cpp | 5 +-- platform/windows/gl_manager_windows.cpp | 11 +++---- platform/windows/gl_manager_windows.h | 2 +- platform/windows/godot_windows.cpp | 3 +- platform/windows/joypad_windows.h | 2 +- platform/windows/lang_table.h | 2 -- platform/windows/os_windows.cpp | 9 ++--- platform/windows/os_windows.h | 8 +++-- platform/windows/vulkan_context_win.cpp | 3 +- platform/windows/windows_terminal_logger.cpp | 3 +- platform/windows/windows_terminal_logger.h | 2 +- 116 files changed, 372 insertions(+), 309 deletions(-) rename platform/android/{vulkan => }/vulkan_context_android.cpp (100%) rename platform/android/{vulkan => }/vulkan_context_android.h (100%) diff --git a/drivers/coreaudio/audio_driver_coreaudio.cpp b/drivers/coreaudio/audio_driver_coreaudio.cpp index 40117274335..7074cc7187c 100644 --- a/drivers/coreaudio/audio_driver_coreaudio.cpp +++ b/drivers/coreaudio/audio_driver_coreaudio.cpp @@ -28,10 +28,10 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ -#ifdef COREAUDIO_ENABLED - #include "audio_driver_coreaudio.h" +#ifdef COREAUDIO_ENABLED + #include "core/config/project_settings.h" #include "core/os/os.h" diff --git a/drivers/coremidi/midi_driver_coremidi.cpp b/drivers/coremidi/midi_driver_coremidi.cpp index 7a1b2785622..ed991b3d9d9 100644 --- a/drivers/coremidi/midi_driver_coremidi.cpp +++ b/drivers/coremidi/midi_driver_coremidi.cpp @@ -28,10 +28,10 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ -#ifdef COREMIDI_ENABLED - #include "midi_driver_coremidi.h" +#ifdef COREMIDI_ENABLED + #include "core/string/print_string.h" #import diff --git a/platform/android/SCsub b/platform/android/SCsub index 1f3bbc2350f..dfc921cc54a 100644 --- a/platform/android/SCsub +++ b/platform/android/SCsub @@ -21,7 +21,7 @@ android_files = [ "android_keys_utils.cpp", "display_server_android.cpp", "plugin/godot_plugin_jni.cpp", - "vulkan/vulkan_context_android.cpp", + "vulkan_context_android.cpp", ] env_android = env.Clone() diff --git a/platform/android/android_keys_utils.h b/platform/android/android_keys_utils.h index bdfaaa32153..5cf5628a8b9 100644 --- a/platform/android/android_keys_utils.h +++ b/platform/android/android_keys_utils.h @@ -31,8 +31,9 @@ #ifndef ANDROID_KEYS_UTILS_H #define ANDROID_KEYS_UTILS_H +#include "core/os/keyboard.h" + #include -#include #define AKEYCODE_MAX 0xFFFF diff --git a/platform/android/api/api.cpp b/platform/android/api/api.cpp index 757ca315a76..60c369951c9 100644 --- a/platform/android/api/api.cpp +++ b/platform/android/api/api.cpp @@ -30,10 +30,11 @@ #include "api.h" -#include "core/config/engine.h" #include "java_class_wrapper.h" #include "jni_singleton.h" +#include "core/config/engine.h" + #if !defined(ANDROID_ENABLED) static JavaClassWrapper *java_class_wrapper = nullptr; #endif diff --git a/platform/android/api/jni_singleton.h b/platform/android/api/jni_singleton.h index 455ed259ec2..a2d1c081680 100644 --- a/platform/android/api/jni_singleton.h +++ b/platform/android/api/jni_singleton.h @@ -33,8 +33,9 @@ #include "core/config/engine.h" #include "core/variant/variant.h" + #ifdef ANDROID_ENABLED -#include "platform/android/jni_utils.h" +#include "jni_utils.h" #endif class JNISingleton : public Object { diff --git a/platform/android/dir_access_jandroid.cpp b/platform/android/dir_access_jandroid.cpp index 7b41ad87bda..6bd09fe00ae 100644 --- a/platform/android/dir_access_jandroid.cpp +++ b/platform/android/dir_access_jandroid.cpp @@ -30,10 +30,11 @@ #include "dir_access_jandroid.h" -#include "core/string/print_string.h" #include "string_android.h" #include "thread_jandroid.h" +#include "core/string/print_string.h" + jobject DirAccessJAndroid::dir_access_handler = nullptr; jclass DirAccessJAndroid::cls = nullptr; jmethodID DirAccessJAndroid::_dir_open = nullptr; diff --git a/platform/android/dir_access_jandroid.h b/platform/android/dir_access_jandroid.h index 05b7d479577..5ee4c856599 100644 --- a/platform/android/dir_access_jandroid.h +++ b/platform/android/dir_access_jandroid.h @@ -31,9 +31,11 @@ #ifndef DIR_ACCESS_JANDROID_H #define DIR_ACCESS_JANDROID_H +#include "java_godot_lib_jni.h" + #include "core/io/dir_access.h" #include "drivers/unix/dir_access_unix.h" -#include "java_godot_lib_jni.h" + #include /// Android implementation of the DirAccess interface used to provide access to diff --git a/platform/android/display_server_android.cpp b/platform/android/display_server_android.cpp index e07e0e11497..4d9a49c35cd 100644 --- a/platform/android/display_server_android.cpp +++ b/platform/android/display_server_android.cpp @@ -30,19 +30,23 @@ #include "display_server_android.h" -#include "core/config/project_settings.h" #include "java_godot_io_wrapper.h" #include "java_godot_wrapper.h" #include "os_android.h" #include "tts_android.h" +#include "core/config/project_settings.h" + #if defined(VULKAN_ENABLED) +#include "vulkan_context_android.h" + #include "drivers/vulkan/rendering_device_vulkan.h" -#include "platform/android/vulkan/vulkan_context_android.h" #include "servers/rendering/renderer_rd/renderer_compositor_rd.h" #endif + #ifdef GLES3_ENABLED #include "drivers/gles3/rasterizer_gles3.h" + #include #endif diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index 1e048100d17..32b46271fd0 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -30,10 +30,11 @@ #include "export.h" +#include "export_plugin.h" + #include "core/os/os.h" #include "editor/editor_settings.h" #include "editor/export/editor_export.h" -#include "export_plugin.h" void register_android_exporter_types() { GDREGISTER_VIRTUAL_CLASS(EditorExportPlatformAndroid); diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp index 71b8a2b09b5..60302396958 100644 --- a/platform/android/export/export_plugin.cpp +++ b/platform/android/export/export_plugin.cpp @@ -30,6 +30,8 @@ #include "export_plugin.h" +#include "../logo_svg.gen.h" +#include "../run_icon_svg.gen.h" #include "gradle_export_util.h" #include "core/config/project_settings.h" @@ -46,8 +48,6 @@ #include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "main/splash.gen.h" -#include "platform/android/logo_svg.gen.h" -#include "platform/android/run_icon_svg.gen.h" #include "modules/modules_enabled.gen.h" // For svg. #ifdef MODULE_SVG_ENABLED diff --git a/platform/android/export/godot_plugin_config.cpp b/platform/android/export/godot_plugin_config.cpp index 56431c25de5..b64cca3254a 100644 --- a/platform/android/export/godot_plugin_config.cpp +++ b/platform/android/export/godot_plugin_config.cpp @@ -29,6 +29,7 @@ /**************************************************************************/ #include "godot_plugin_config.h" + /* * Set of prebuilt plugins. * Currently unused, this is just for future reference: diff --git a/platform/android/file_access_android.h b/platform/android/file_access_android.h index b8f45628e57..7ff5c4d1173 100644 --- a/platform/android/file_access_android.h +++ b/platform/android/file_access_android.h @@ -32,6 +32,7 @@ #define FILE_ACCESS_ANDROID_H #include "core/io/file_access.h" + #include #include #include diff --git a/platform/android/file_access_filesystem_jandroid.cpp b/platform/android/file_access_filesystem_jandroid.cpp index ea8459d1edc..a1865fb1d43 100644 --- a/platform/android/file_access_filesystem_jandroid.cpp +++ b/platform/android/file_access_filesystem_jandroid.cpp @@ -30,9 +30,10 @@ #include "file_access_filesystem_jandroid.h" +#include "thread_jandroid.h" + #include "core/os/os.h" #include "core/templates/local_vector.h" -#include "thread_jandroid.h" #include diff --git a/platform/android/file_access_filesystem_jandroid.h b/platform/android/file_access_filesystem_jandroid.h index 5e74d9de246..739c8a09250 100644 --- a/platform/android/file_access_filesystem_jandroid.h +++ b/platform/android/file_access_filesystem_jandroid.h @@ -31,9 +31,10 @@ #ifndef FILE_ACCESS_FILESYSTEM_JANDROID_H #define FILE_ACCESS_FILESYSTEM_JANDROID_H -#include "core/io/file_access.h" #include "java_godot_lib_jni.h" +#include "core/io/file_access.h" + class FileAccessFilesystemJAndroid : public FileAccess { static jobject file_access_handler; static jclass cls; diff --git a/platform/android/java_godot_io_wrapper.h b/platform/android/java_godot_io_wrapper.h index 99e29bb53da..c113a13040d 100644 --- a/platform/android/java_godot_io_wrapper.h +++ b/platform/android/java_godot_io_wrapper.h @@ -31,12 +31,13 @@ #ifndef JAVA_GODOT_IO_WRAPPER_H #define JAVA_GODOT_IO_WRAPPER_H -#include -#include +#include "string_android.h" #include "core/math/rect2i.h" #include "core/variant/typed_array.h" -#include "string_android.h" + +#include +#include // Class that makes functions in java/src/org/godotengine/godot/GodotIO.java callable from C++ class GodotIOJavaWrapper { diff --git a/platform/android/java_godot_lib_jni.cpp b/platform/android/java_godot_lib_jni.cpp index 63435853e99..7c1b6023c77 100644 --- a/platform/android/java_godot_lib_jni.cpp +++ b/platform/android/java_godot_lib_jni.cpp @@ -30,37 +30,36 @@ #include "java_godot_lib_jni.h" -#include "java_godot_io_wrapper.h" -#include "java_godot_wrapper.h" - -#include "android/asset_manager_jni.h" #include "android_input_handler.h" #include "api/java_class_wrapper.h" #include "api/jni_singleton.h" -#include "core/config/engine.h" -#include "core/config/project_settings.h" -#include "core/input/input.h" #include "dir_access_jandroid.h" #include "display_server_android.h" #include "file_access_android.h" #include "file_access_filesystem_jandroid.h" +#include "java_godot_io_wrapper.h" +#include "java_godot_wrapper.h" #include "jni_utils.h" -#include "main/main.h" #include "net_socket_android.h" #include "os_android.h" #include "string_android.h" #include "thread_jandroid.h" #include "tts_android.h" -#include -#include - -#include +#include "core/config/engine.h" +#include "core/config/project_settings.h" +#include "core/input/input.h" +#include "main/main.h" #ifdef TOOLS_ENABLED #include "editor/editor_settings.h" #endif +#include +#include +#include +#include + static JavaClassWrapper *java_class_wrapper = nullptr; static OS_Android *os_android = nullptr; static AndroidInputHandler *input_handler = nullptr; diff --git a/platform/android/java_godot_view_wrapper.h b/platform/android/java_godot_view_wrapper.h index 07742d6bb0a..e5b04e4866a 100644 --- a/platform/android/java_godot_view_wrapper.h +++ b/platform/android/java_godot_view_wrapper.h @@ -31,12 +31,13 @@ #ifndef JAVA_GODOT_VIEW_WRAPPER_H #define JAVA_GODOT_VIEW_WRAPPER_H +#include "string_android.h" + #include "core/math/vector2.h" + #include #include -#include "string_android.h" - // Class that makes functions in java/src/org/godotengine/godot/GodotView.java callable from C++ class GodotJavaViewWrapper { private: diff --git a/platform/android/java_godot_wrapper.h b/platform/android/java_godot_wrapper.h index 245ab33dcf5..1efdffd71bf 100644 --- a/platform/android/java_godot_wrapper.h +++ b/platform/android/java_godot_wrapper.h @@ -31,13 +31,14 @@ #ifndef JAVA_GODOT_WRAPPER_H #define JAVA_GODOT_WRAPPER_H -#include -#include - -#include "core/templates/list.h" #include "java_godot_view_wrapper.h" #include "string_android.h" +#include "core/templates/list.h" + +#include +#include + // Class that makes functions in java/src/org/godotengine/godot/Godot.java callable from C++ class GodotJavaWrapper { private: diff --git a/platform/android/jni_utils.h b/platform/android/jni_utils.h index d1a4082ae5c..c608f9ebaa2 100644 --- a/platform/android/jni_utils.h +++ b/platform/android/jni_utils.h @@ -32,8 +32,10 @@ #define JNI_UTILS_H #include "string_android.h" -#include -#include + +#include "core/config/engine.h" +#include "core/variant/variant.h" + #include struct jvalret { diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp index a96dcca3b33..c3a7d700341 100644 --- a/platform/android/os_android.cpp +++ b/platform/android/os_android.cpp @@ -30,25 +30,24 @@ #include "os_android.h" +#include "dir_access_jandroid.h" +#include "display_server_android.h" +#include "file_access_android.h" +#include "file_access_filesystem_jandroid.h" +#include "java_godot_io_wrapper.h" +#include "java_godot_wrapper.h" +#include "net_socket_android.h" + #include "core/config/project_settings.h" #include "drivers/unix/dir_access_unix.h" #include "drivers/unix/file_access_unix.h" #include "main/main.h" -#include "platform/android/display_server_android.h" #include "scene/main/scene_tree.h" #include "servers/rendering_server.h" -#include "dir_access_jandroid.h" -#include "file_access_android.h" -#include "file_access_filesystem_jandroid.h" -#include "net_socket_android.h" - #include #include -#include "java_godot_io_wrapper.h" -#include "java_godot_wrapper.h" - const char *OS_Android::ANDROID_EXEC_PATH = "apk"; String _remove_symlink(const String &dir) { diff --git a/platform/android/os_android.h b/platform/android/os_android.h index 99fe501975f..abcc412588a 100644 --- a/platform/android/os_android.h +++ b/platform/android/os_android.h @@ -32,6 +32,7 @@ #define OS_ANDROID_H #include "audio_driver_opensl.h" + #include "core/os/main_loop.h" #include "drivers/unix/os_unix.h" #include "servers/audio_server.h" diff --git a/platform/android/plugin/godot_plugin_jni.cpp b/platform/android/plugin/godot_plugin_jni.cpp index 843c015d49b..5d48c4e2488 100644 --- a/platform/android/plugin/godot_plugin_jni.cpp +++ b/platform/android/plugin/godot_plugin_jni.cpp @@ -30,12 +30,13 @@ #include "godot_plugin_jni.h" -#include -#include -#include -#include -#include -#include +#include "api/jni_singleton.h" +#include "jni_utils.h" +#include "string_android.h" + +#include "core/config/engine.h" +#include "core/config/project_settings.h" +#include "core/error/error_macros.h" static HashMap jni_singletons; diff --git a/platform/android/string_android.h b/platform/android/string_android.h index fe2f2e20a7f..3f30b8ec3de 100644 --- a/platform/android/string_android.h +++ b/platform/android/string_android.h @@ -31,8 +31,10 @@ #ifndef STRING_ANDROID_H #define STRING_ANDROID_H -#include "core/string/ustring.h" #include "thread_jandroid.h" + +#include "core/string/ustring.h" + #include /** diff --git a/platform/android/thread_jandroid.cpp b/platform/android/thread_jandroid.cpp index 5051c179ed6..9f4140f70fb 100644 --- a/platform/android/thread_jandroid.cpp +++ b/platform/android/thread_jandroid.cpp @@ -30,10 +30,10 @@ #include "thread_jandroid.h" -#include - #include "core/os/thread.h" +#include + static JavaVM *java_vm = nullptr; static thread_local JNIEnv *env = nullptr; diff --git a/platform/android/vulkan/vulkan_context_android.cpp b/platform/android/vulkan_context_android.cpp similarity index 100% rename from platform/android/vulkan/vulkan_context_android.cpp rename to platform/android/vulkan_context_android.cpp index ce4b1b79679..01e6d144381 100644 --- a/platform/android/vulkan/vulkan_context_android.cpp +++ b/platform/android/vulkan_context_android.cpp @@ -28,10 +28,10 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ -#ifdef VULKAN_ENABLED - #include "vulkan_context_android.h" +#ifdef VULKAN_ENABLED + #ifdef USE_VOLK #include #else diff --git a/platform/android/vulkan/vulkan_context_android.h b/platform/android/vulkan_context_android.h similarity index 100% rename from platform/android/vulkan/vulkan_context_android.h rename to platform/android/vulkan_context_android.h diff --git a/platform/ios/api/api.cpp b/platform/ios/api/api.cpp index 51afe05310f..b8c9e7e9aab 100644 --- a/platform/ios/api/api.cpp +++ b/platform/ios/api/api.cpp @@ -45,4 +45,4 @@ void unregister_ios_api() { void register_ios_api() {} void unregister_ios_api() {} -#endif +#endif // IOS_ENABLED diff --git a/platform/ios/app_delegate.mm b/platform/ios/app_delegate.mm index 45f74e6b7b0..38846e75080 100644 --- a/platform/ios/app_delegate.mm +++ b/platform/ios/app_delegate.mm @@ -30,13 +30,14 @@ #import "app_delegate.h" -#include "core/config/project_settings.h" -#include "drivers/coreaudio/audio_driver_coreaudio.h" #import "godot_view.h" -#include "main/main.h" -#include "os_ios.h" +#import "os_ios.h" #import "view_controller.h" +#include "core/config/project_settings.h" +#import "drivers/coreaudio/audio_driver_coreaudio.h" +#include "main/main.h" + #import #import diff --git a/platform/ios/display_layer.mm b/platform/ios/display_layer.mm index 3129ebb2767..27cde1c6c22 100644 --- a/platform/ios/display_layer.mm +++ b/platform/ios/display_layer.mm @@ -30,11 +30,12 @@ #import "display_layer.h" +#import "display_server_ios.h" +#import "os_ios.h" + #include "core/config/project_settings.h" #include "core/os/keyboard.h" -#include "display_server_ios.h" #include "main/main.h" -#include "os_ios.h" #include "servers/audio_server.h" #import diff --git a/platform/ios/display_server_ios.h b/platform/ios/display_server_ios.h index 57f601a8584..b29bdeec621 100644 --- a/platform/ios/display_server_ios.h +++ b/platform/ios/display_server_ios.h @@ -35,17 +35,17 @@ #include "servers/display_server.h" #if defined(VULKAN_ENABLED) +#import "vulkan_context_ios.h" + #include "drivers/vulkan/rendering_device_vulkan.h" #include "servers/rendering/renderer_rd/renderer_compositor_rd.h" -#include "vulkan_context_ios.h" - #ifdef USE_VOLK #include #else #include #endif -#endif +#endif // VULKAN_ENABLED #if defined(GLES3_ENABLED) #include "drivers/gles3/rasterizer_gles3.h" diff --git a/platform/ios/display_server_ios.mm b/platform/ios/display_server_ios.mm index a52d2b185d0..5637931e73b 100644 --- a/platform/ios/display_server_ios.mm +++ b/platform/ios/display_server_ios.mm @@ -28,20 +28,21 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ -#include "display_server_ios.h" +#import "display_server_ios.h" #import "app_delegate.h" -#include "core/config/project_settings.h" -#include "core/io/file_access_pack.h" #import "device_metrics.h" #import "godot_view.h" -#include "ios.h" +#import "ios.h" #import "key_mapping_ios.h" #import "keyboard_input_view.h" -#include "os_ios.h" -#include "tts_ios.h" +#import "os_ios.h" +#import "tts_ios.h" #import "view_controller.h" +#include "core/config/project_settings.h" +#include "core/io/file_access_pack.h" + #import static const float kDisplayServerIOSAcceleration = 1.f; diff --git a/platform/ios/export/export.cpp b/platform/ios/export/export.cpp index f4b90d8883c..e07a1358611 100644 --- a/platform/ios/export/export.cpp +++ b/platform/ios/export/export.cpp @@ -30,9 +30,10 @@ #include "export.h" -#include "editor/export/editor_export.h" #include "export_plugin.h" +#include "editor/export/editor_export.h" + void register_ios_exporter_types() { GDREGISTER_VIRTUAL_CLASS(EditorExportPlatformIOS); } diff --git a/platform/ios/export/export_plugin.cpp b/platform/ios/export/export_plugin.cpp index 06741a12e4d..ae0d1205132 100644 --- a/platform/ios/export/export_plugin.cpp +++ b/platform/ios/export/export_plugin.cpp @@ -30,11 +30,12 @@ #include "export_plugin.h" +#include "../logo_svg.gen.h" + #include "core/string/translation.h" #include "editor/editor_node.h" #include "editor/editor_scale.h" #include "editor/export/editor_export.h" -#include "platform/ios/logo_svg.gen.h" #include "modules/modules_enabled.gen.h" // For svg. #ifdef MODULE_SVG_ENABLED diff --git a/platform/ios/export/export_plugin.h b/platform/ios/export/export_plugin.h index 9afefef121b..2e461c8ed65 100644 --- a/platform/ios/export/export_plugin.h +++ b/platform/ios/export/export_plugin.h @@ -31,6 +31,8 @@ #ifndef IOS_EXPORT_PLUGIN_H #define IOS_EXPORT_PLUGIN_H +#include "godot_plugin_config.h" + #include "core/config/project_settings.h" #include "core/io/file_access.h" #include "core/io/image_loader.h" @@ -43,10 +45,8 @@ #include "editor/editor_settings.h" #include "editor/export/editor_export_platform.h" #include "main/splash.gen.h" -#include "string.h" - -#include "godot_plugin_config.h" +#include #include // Optional environment variables for defining confidential information. If any diff --git a/platform/ios/godot_ios.mm b/platform/ios/godot_ios.mm index b01e339211f..5e66c8b47bb 100644 --- a/platform/ios/godot_ios.mm +++ b/platform/ios/godot_ios.mm @@ -28,9 +28,10 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ +#import "os_ios.h" + #include "core/string/ustring.h" #include "main/main.h" -#include "os_ios.h" #include #include diff --git a/platform/ios/godot_view.mm b/platform/ios/godot_view.mm index ff04ea98385..4c9a75fdc0b 100644 --- a/platform/ios/godot_view.mm +++ b/platform/ios/godot_view.mm @@ -30,12 +30,13 @@ #import "godot_view.h" +#import "display_layer.h" +#import "display_server_ios.h" +#import "godot_view_renderer.h" + #include "core/config/project_settings.h" #include "core/os/keyboard.h" #include "core/string/ustring.h" -#import "display_layer.h" -#include "display_server_ios.h" -#import "godot_view_renderer.h" #import diff --git a/platform/ios/godot_view_renderer.mm b/platform/ios/godot_view_renderer.mm index 714952943bf..9c56ca342fb 100644 --- a/platform/ios/godot_view_renderer.mm +++ b/platform/ios/godot_view_renderer.mm @@ -30,11 +30,12 @@ #import "godot_view_renderer.h" +#import "display_server_ios.h" +#import "os_ios.h" + #include "core/config/project_settings.h" #include "core/os/keyboard.h" -#import "display_server_ios.h" #include "main/main.h" -#include "os_ios.h" #include "servers/audio_server.h" #import diff --git a/platform/ios/ios.h b/platform/ios/ios.h index ec2dbd5bf2a..d488cde257b 100644 --- a/platform/ios/ios.h +++ b/platform/ios/ios.h @@ -32,6 +32,7 @@ #define IOS_H #include "core/object/class_db.h" + #import class iOS : public Object { diff --git a/platform/ios/ios.mm b/platform/ios/ios.mm index c911a512a5d..0a2e1fd5cd4 100644 --- a/platform/ios/ios.mm +++ b/platform/ios/ios.mm @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ -#include "ios.h" +#import "ios.h" #import "app_delegate.h" #import "view_controller.h" diff --git a/platform/ios/joypad_ios.mm b/platform/ios/joypad_ios.mm index 421c82dfc4c..38d3ce728aa 100644 --- a/platform/ios/joypad_ios.mm +++ b/platform/ios/joypad_ios.mm @@ -30,13 +30,12 @@ #import "joypad_ios.h" -#include "core/config/project_settings.h" -#include "drivers/coreaudio/audio_driver_coreaudio.h" -#include "main/main.h" - #import "godot_view.h" +#import "os_ios.h" -#include "os_ios.h" +#include "core/config/project_settings.h" +#import "drivers/coreaudio/audio_driver_coreaudio.h" +#include "main/main.h" JoypadIOS::JoypadIOS() { observer = [[JoypadIOSObserver alloc] init]; diff --git a/platform/ios/key_mapping_ios.mm b/platform/ios/key_mapping_ios.mm index c378186778c..d2c84884d19 100644 --- a/platform/ios/key_mapping_ios.mm +++ b/platform/ios/key_mapping_ios.mm @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ -#include "key_mapping_ios.h" +#import "key_mapping_ios.h" #include "core/templates/hash_map.h" diff --git a/platform/ios/keyboard_input_view.mm b/platform/ios/keyboard_input_view.mm index 2764403d683..bc6eb63ed5b 100644 --- a/platform/ios/keyboard_input_view.mm +++ b/platform/ios/keyboard_input_view.mm @@ -30,9 +30,10 @@ #import "keyboard_input_view.h" +#import "display_server_ios.h" +#import "os_ios.h" + #include "core/os/keyboard.h" -#include "display_server_ios.h" -#include "os_ios.h" @interface GodotKeyboardInputView () diff --git a/platform/ios/os_ios.h b/platform/ios/os_ios.h index cc95e4cdde6..9dc5e114976 100644 --- a/platform/ios/os_ios.h +++ b/platform/ios/os_ios.h @@ -33,16 +33,18 @@ #ifdef IOS_ENABLED -#include "drivers/coreaudio/audio_driver_coreaudio.h" +#import "ios.h" +#import "joypad_ios.h" + +#import "drivers/coreaudio/audio_driver_coreaudio.h" #include "drivers/unix/os_unix.h" -#include "ios.h" -#include "joypad_ios.h" #include "servers/audio_server.h" #include "servers/rendering/renderer_compositor.h" #if defined(VULKAN_ENABLED) +#import "vulkan_context_ios.h" + #include "drivers/vulkan/rendering_device_vulkan.h" -#include "platform/ios/vulkan_context_ios.h" #endif class OS_IOS : public OS_Unix { diff --git a/platform/ios/os_ios.mm b/platform/ios/os_ios.mm index 739db419a3c..461c226070d 100644 --- a/platform/ios/os_ios.mm +++ b/platform/ios/os_ios.mm @@ -28,20 +28,21 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ +#import "os_ios.h" + #ifdef IOS_ENABLED -#include "os_ios.h" - #import "app_delegate.h" +#import "display_server_ios.h" +#import "godot_view.h" +#import "view_controller.h" + #include "core/config/project_settings.h" #include "core/io/dir_access.h" #include "core/io/file_access.h" #include "core/io/file_access_pack.h" -#include "display_server_ios.h" #include "drivers/unix/syslog_logger.h" -#import "godot_view.h" #include "main/main.h" -#import "view_controller.h" #import #import @@ -51,6 +52,7 @@ #if defined(VULKAN_ENABLED) #include "servers/rendering/renderer_rd/renderer_compositor_rd.h" + #import #ifdef USE_VOLK #include diff --git a/platform/ios/tts_ios.h b/platform/ios/tts_ios.h index 7f9d30b22b5..217f55da662 100644 --- a/platform/ios/tts_ios.h +++ b/platform/ios/tts_ios.h @@ -31,18 +31,18 @@ #ifndef TTS_IOS_H #define TTS_IOS_H -#if __has_include() -#import -#else -#import -#endif - #include "core/string/ustring.h" #include "core/templates/hash_map.h" #include "core/templates/list.h" #include "core/variant/array.h" #include "servers/display_server.h" +#if __has_include() +#import +#else +#import +#endif + @interface TTS_IOS : NSObject { bool speaking; HashMap ids; diff --git a/platform/ios/tts_ios.mm b/platform/ios/tts_ios.mm index ee0d6e85912..33b30b17c90 100644 --- a/platform/ios/tts_ios.mm +++ b/platform/ios/tts_ios.mm @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ -#include "tts_ios.h" +#import "tts_ios.h" @implementation TTS_IOS diff --git a/platform/ios/view_controller.mm b/platform/ios/view_controller.mm index 8709252623e..0ef61da6465 100644 --- a/platform/ios/view_controller.mm +++ b/platform/ios/view_controller.mm @@ -29,13 +29,15 @@ /**************************************************************************/ #import "view_controller.h" -#include "core/config/project_settings.h" -#include "display_server_ios.h" + +#import "display_server_ios.h" #import "godot_view.h" #import "godot_view_renderer.h" #import "key_mapping_ios.h" #import "keyboard_input_view.h" -#include "os_ios.h" +#import "os_ios.h" + +#include "core/config/project_settings.h" #import #import diff --git a/platform/ios/vulkan_context_ios.mm b/platform/ios/vulkan_context_ios.mm index c48ff841f25..56f1894e06d 100644 --- a/platform/ios/vulkan_context_ios.mm +++ b/platform/ios/vulkan_context_ios.mm @@ -28,9 +28,10 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ +#import "vulkan_context_ios.h" + #ifdef VULKAN_ENABLED -#include "vulkan_context_ios.h" #ifdef USE_VOLK #include #else diff --git a/platform/linuxbsd/export/export.cpp b/platform/linuxbsd/export/export.cpp index 09f354246d8..f72c079d1d6 100644 --- a/platform/linuxbsd/export/export.cpp +++ b/platform/linuxbsd/export/export.cpp @@ -30,9 +30,10 @@ #include "export.h" -#include "editor/export/editor_export.h" #include "export_plugin.h" +#include "editor/export/editor_export.h" + void register_linuxbsd_exporter_types() { GDREGISTER_VIRTUAL_CLASS(EditorExportPlatformLinuxBSD); } diff --git a/platform/linuxbsd/export/export_plugin.cpp b/platform/linuxbsd/export/export_plugin.cpp index 9544cc761df..daa2664b095 100644 --- a/platform/linuxbsd/export/export_plugin.cpp +++ b/platform/linuxbsd/export/export_plugin.cpp @@ -30,13 +30,14 @@ #include "export_plugin.h" +#include "../logo_svg.gen.h" +#include "../run_icon_svg.gen.h" + #include "core/config/project_settings.h" #include "editor/editor_node.h" #include "editor/editor_paths.h" #include "editor/editor_scale.h" #include "editor/export/editor_export.h" -#include "platform/linuxbsd/logo_svg.gen.h" -#include "platform/linuxbsd/run_icon_svg.gen.h" #include "modules/modules_enabled.gen.h" // For svg. #ifdef MODULE_SVG_ENABLED diff --git a/platform/linuxbsd/freedesktop_portal_desktop.cpp b/platform/linuxbsd/freedesktop_portal_desktop.cpp index 6dfa8ed93c3..c3cb0f411d4 100644 --- a/platform/linuxbsd/freedesktop_portal_desktop.cpp +++ b/platform/linuxbsd/freedesktop_portal_desktop.cpp @@ -35,6 +35,7 @@ #include "core/error/error_macros.h" #include "core/os/os.h" #include "core/string/ustring.h" +#include "core/variant/variant.h" #ifdef SOWRAP_ENABLED #include "dbus-so_wrap.h" @@ -42,8 +43,6 @@ #include #endif -#include "core/variant/variant.h" - #define BUS_OBJECT_NAME "org.freedesktop.portal.Desktop" #define BUS_OBJECT_PATH "/org/freedesktop/portal/desktop" diff --git a/platform/linuxbsd/godot_linuxbsd.cpp b/platform/linuxbsd/godot_linuxbsd.cpp index 76d579dd539..d059d60b725 100644 --- a/platform/linuxbsd/godot_linuxbsd.cpp +++ b/platform/linuxbsd/godot_linuxbsd.cpp @@ -28,6 +28,10 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ +#include "os_linuxbsd.h" + +#include "main/main.h" + #include #include #include @@ -37,9 +41,6 @@ #include #endif -#include "main/main.h" -#include "os_linuxbsd.h" - int main(int argc, char *argv[]) { #if defined(SANITIZERS_ENABLED) // Note: Set stack size to be at least 30 MB (vs 8 MB default) to avoid overflow, address sanitizer can increase stack usage up to 3 times. diff --git a/platform/linuxbsd/joypad_linux.h b/platform/linuxbsd/joypad_linux.h index 6661abdb376..26a9908d4e9 100644 --- a/platform/linuxbsd/joypad_linux.h +++ b/platform/linuxbsd/joypad_linux.h @@ -32,6 +32,7 @@ #define JOYPAD_LINUX_H #ifdef JOYDEV_ENABLED + #include "core/input/input.h" #include "core/os/mutex.h" #include "core/os/thread.h" diff --git a/platform/linuxbsd/os_linuxbsd.cpp b/platform/linuxbsd/os_linuxbsd.cpp index b843becfe00..ebdbd061d10 100644 --- a/platform/linuxbsd/os_linuxbsd.cpp +++ b/platform/linuxbsd/os_linuxbsd.cpp @@ -35,17 +35,13 @@ #include "main/main.h" #include "servers/display_server.h" -#include "modules/modules_enabled.gen.h" // For regex. -#ifdef MODULE_REGEX_ENABLED -#include "modules/regex/regex.h" -#endif - #ifdef X11_ENABLED #include "x11/display_server_x11.h" #endif -#ifdef HAVE_MNTENT -#include +#include "modules/modules_enabled.gen.h" // For regex. +#ifdef MODULE_REGEX_ENABLED +#include "modules/regex/regex.h" #endif #include @@ -57,6 +53,10 @@ #include #include +#ifdef HAVE_MNTENT +#include +#endif + void OS_LinuxBSD::alert(const String &p_alert, const String &p_title) { const char *message_programs[] = { "zenity", "kdialog", "Xdialog", "xmessage" }; diff --git a/platform/linuxbsd/os_linuxbsd.h b/platform/linuxbsd/os_linuxbsd.h index c1e735b0d47..007b90b82b3 100644 --- a/platform/linuxbsd/os_linuxbsd.h +++ b/platform/linuxbsd/os_linuxbsd.h @@ -31,13 +31,14 @@ #ifndef OS_LINUXBSD_H #define OS_LINUXBSD_H -#include "core/input/input.h" #include "crash_handler_linuxbsd.h" +#include "joypad_linux.h" + +#include "core/input/input.h" #include "drivers/alsa/audio_driver_alsa.h" #include "drivers/alsamidi/midi_driver_alsamidi.h" #include "drivers/pulseaudio/audio_driver_pulseaudio.h" #include "drivers/unix/os_unix.h" -#include "joypad_linux.h" #include "servers/audio_server.h" #ifdef FONTCONFIG_ENABLED diff --git a/platform/linuxbsd/x11/detect_prime_x11.cpp b/platform/linuxbsd/x11/detect_prime_x11.cpp index 78778a8b568..2b5776ce548 100644 --- a/platform/linuxbsd/x11/detect_prime_x11.cpp +++ b/platform/linuxbsd/x11/detect_prime_x11.cpp @@ -28,29 +28,26 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ -#ifdef X11_ENABLED -#if defined(GLES3_ENABLED) +#if defined(X11_ENABLED) && defined(GLES3_ENABLED) #include "detect_prime_x11.h" #include "core/string/print_string.h" #include "core/string/ustring.h" -#include - #include "thirdparty/glad/glad/gl.h" #include "thirdparty/glad/glad/glx.h" #ifdef SOWRAP_ENABLED -#include "dynwrappers/xlib-so_wrap.h" +#include "x11/dynwrappers/xlib-so_wrap.h" #else #include #include #include #endif -#include - +#include +#include #include #include #include @@ -265,5 +262,4 @@ int detect_prime() { return preferred; } -#endif -#endif +#endif // X11_ENABLED && GLES3_ENABLED diff --git a/platform/linuxbsd/x11/display_server_x11.cpp b/platform/linuxbsd/x11/display_server_x11.cpp index eada0bf29e8..83b6fb76284 100644 --- a/platform/linuxbsd/x11/display_server_x11.cpp +++ b/platform/linuxbsd/x11/display_server_x11.cpp @@ -32,12 +32,13 @@ #ifdef X11_ENABLED +#include "x11/detect_prime_x11.h" +#include "x11/key_mapping_x11.h" + #include "core/config/project_settings.h" #include "core/math/math_funcs.h" #include "core/string/print_string.h" #include "core/string/ustring.h" -#include "detect_prime_x11.h" -#include "key_mapping_x11.h" #include "main/main.h" #include "scene/resources/texture.h" @@ -58,6 +59,9 @@ #include #include +#undef CursorShape +#include + // ICCCM #define WM_NormalState 1L // window normal state #define WM_IconicState 3L // window minimized @@ -65,9 +69,6 @@ #define _NET_WM_STATE_REMOVE 0L // remove/unset property #define _NET_WM_STATE_ADD 1L // add/set property -#undef CursorShape -#include - // 2.2 is the first release with multitouch #define XINPUT_CLIENT_VERSION_MAJOR 2 #define XINPUT_CLIENT_VERSION_MINOR 2 diff --git a/platform/linuxbsd/x11/display_server_x11.h b/platform/linuxbsd/x11/display_server_x11.h index fd3a5dccfaa..176a1ffb9ab 100644 --- a/platform/linuxbsd/x11/display_server_x11.h +++ b/platform/linuxbsd/x11/display_server_x11.h @@ -33,7 +33,7 @@ #ifdef X11_ENABLED -#include "servers/display_server.h" +#include "joypad_linux.h" #include "core/input/input.h" #include "core/os/mutex.h" @@ -43,27 +43,28 @@ #include "drivers/alsamidi/midi_driver_alsamidi.h" #include "drivers/pulseaudio/audio_driver_pulseaudio.h" #include "drivers/unix/os_unix.h" -#include "joypad_linux.h" #include "servers/audio_server.h" +#include "servers/display_server.h" #include "servers/rendering/renderer_compositor.h" #include "servers/rendering_server.h" #if defined(SPEECHD_ENABLED) -#include "../tts_linux.h" +#include "tts_linux.h" #endif #if defined(GLES3_ENABLED) -#include "gl_manager_x11.h" +#include "x11/gl_manager_x11.h" #endif #if defined(VULKAN_ENABLED) +#include "x11/vulkan_context_x11.h" + #include "drivers/vulkan/rendering_device_vulkan.h" -#include "vulkan_context_x11.h" #endif #if defined(DBUS_ENABLED) -#include "../freedesktop_portal_desktop.h" -#include "../freedesktop_screensaver.h" +#include "freedesktop_portal_desktop.h" +#include "freedesktop_screensaver.h" #endif #include @@ -72,16 +73,16 @@ #include #ifdef SOWRAP_ENABLED -#include "dynwrappers/xlib-so_wrap.h" +#include "x11/dynwrappers/xlib-so_wrap.h" -#include "dynwrappers/xcursor-so_wrap.h" -#include "dynwrappers/xext-so_wrap.h" -#include "dynwrappers/xinerama-so_wrap.h" -#include "dynwrappers/xinput2-so_wrap.h" -#include "dynwrappers/xrandr-so_wrap.h" -#include "dynwrappers/xrender-so_wrap.h" +#include "x11/dynwrappers/xcursor-so_wrap.h" +#include "x11/dynwrappers/xext-so_wrap.h" +#include "x11/dynwrappers/xinerama-so_wrap.h" +#include "x11/dynwrappers/xinput2-so_wrap.h" +#include "x11/dynwrappers/xrandr-so_wrap.h" +#include "x11/dynwrappers/xrender-so_wrap.h" -#include "../xkbcommon-so_wrap.h" +#include "xkbcommon-so_wrap.h" #else #include #include @@ -521,6 +522,6 @@ public: ~DisplayServerX11(); }; -#endif // X11 enabled +#endif // X11_ENABLED #endif // DISPLAY_SERVER_X11_H diff --git a/platform/linuxbsd/x11/gl_manager_x11.cpp b/platform/linuxbsd/x11/gl_manager_x11.cpp index 1e579c9f014..f24bac5e191 100644 --- a/platform/linuxbsd/x11/gl_manager_x11.cpp +++ b/platform/linuxbsd/x11/gl_manager_x11.cpp @@ -30,15 +30,14 @@ #include "gl_manager_x11.h" -#ifdef X11_ENABLED -#if defined(GLES3_ENABLED) +#if defined(X11_ENABLED) && defined(GLES3_ENABLED) + +#include "thirdparty/glad/glad/glx.h" #include #include #include -#include "thirdparty/glad/glad/glx.h" - #define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 #define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 @@ -403,5 +402,4 @@ GLManager_X11::~GLManager_X11() { release_current(); } -#endif -#endif +#endif // X11_ENABLED && GLES3_ENABLED diff --git a/platform/linuxbsd/x11/gl_manager_x11.h b/platform/linuxbsd/x11/gl_manager_x11.h index 0203dff679e..59e20fec45b 100644 --- a/platform/linuxbsd/x11/gl_manager_x11.h +++ b/platform/linuxbsd/x11/gl_manager_x11.h @@ -31,12 +31,11 @@ #ifndef GL_MANAGER_X11_H #define GL_MANAGER_X11_H -#ifdef X11_ENABLED - -#ifdef GLES3_ENABLED +#if defined(X11_ENABLED) && defined(GLES3_ENABLED) #include "core/os/os.h" #include "core/templates/local_vector.h" +#include "servers/display_server.h" #ifdef SOWRAP_ENABLED #include "dynwrappers/xlib-so_wrap.h" @@ -53,8 +52,6 @@ #include #endif -#include "servers/display_server.h" - struct GLManager_X11_Private; class GLManager_X11 { @@ -136,7 +133,6 @@ public: ~GLManager_X11(); }; -#endif // GLES3_ENABLED -#endif // X11_ENABLED +#endif // X11_ENABLED && GLES3_ENABLED #endif // GL_MANAGER_X11_H diff --git a/platform/linuxbsd/x11/key_mapping_x11.h b/platform/linuxbsd/x11/key_mapping_x11.h index 48beefff4cd..ae8fd67f277 100644 --- a/platform/linuxbsd/x11/key_mapping_x11.h +++ b/platform/linuxbsd/x11/key_mapping_x11.h @@ -31,16 +31,17 @@ #ifndef KEY_MAPPING_X11_H #define KEY_MAPPING_X11_H +#include "core/os/keyboard.h" +#include "core/templates/hash_map.h" + #include #include + #define XK_MISCELLANY #define XK_LATIN1 #define XK_XKB_KEYS #include -#include "core/os/keyboard.h" -#include "core/templates/hash_map.h" - class KeyMappingX11 { struct HashMapHasherKeys { static _FORCE_INLINE_ uint32_t hash(const Key p_key) { return hash_fmix32(static_cast(p_key)); } diff --git a/platform/linuxbsd/x11/vulkan_context_x11.h b/platform/linuxbsd/x11/vulkan_context_x11.h index d093bca8530..294fdc710e2 100644 --- a/platform/linuxbsd/x11/vulkan_context_x11.h +++ b/platform/linuxbsd/x11/vulkan_context_x11.h @@ -34,6 +34,7 @@ #ifdef VULKAN_ENABLED #include "drivers/vulkan/vulkan_context.h" + #include class VulkanContextX11 : public VulkanContext { diff --git a/platform/macos/display_server_macos.h b/platform/macos/display_server_macos.h index 495dc43c55d..5944cc8abd8 100644 --- a/platform/macos/display_server_macos.h +++ b/platform/macos/display_server_macos.h @@ -31,8 +31,6 @@ #ifndef DISPLAY_SERVER_MACOS_H #define DISPLAY_SERVER_MACOS_H -#define BitMap _QDBitMap // Suppress deprecated QuickDraw definition. - #include "core/input/input.h" #include "servers/display_server.h" @@ -41,10 +39,13 @@ #endif // GLES3_ENABLED #if defined(VULKAN_ENABLED) +#include "vulkan_context_macos.h" + #include "drivers/vulkan/rendering_device_vulkan.h" -#include "platform/macos/vulkan_context_macos.h" #endif // VULKAN_ENABLED +#define BitMap _QDBitMap // Suppress deprecated QuickDraw definition. + #import #import #import diff --git a/platform/macos/display_server_macos.mm b/platform/macos/display_server_macos.mm index c24115d7058..99e3b4dbff3 100644 --- a/platform/macos/display_server_macos.mm +++ b/platform/macos/display_server_macos.mm @@ -38,7 +38,6 @@ #include "godot_window_delegate.h" #include "key_mapping_macos.h" #include "os_macos.h" - #include "tts_macos.h" #include "core/config/project_settings.h" @@ -48,13 +47,6 @@ #include "main/main.h" #include "scene/resources/texture.h" -#import -#import -#import -#import -#import -#import - #if defined(GLES3_ENABLED) #include "drivers/gles3/rasterizer_gles3.h" #endif @@ -63,6 +55,13 @@ #include "servers/rendering/renderer_rd/renderer_compositor_rd.h" #endif +#import +#import +#import +#import +#import +#import + const NSMenu *DisplayServerMacOS::_get_menu_root(const String &p_menu_root) const { const NSMenu *menu = nullptr; if (p_menu_root == "" || p_menu_root.to_lower() == "_main") { diff --git a/platform/macos/export/codesign.h b/platform/macos/export/codesign.h index 3be15b4ac09..3e61751a960 100644 --- a/platform/macos/export/codesign.h +++ b/platform/macos/export/codesign.h @@ -41,6 +41,8 @@ // - Requirements code generator is not implemented (only hard-coded requirements for the ad-hoc signing is supported). // - RFC5652/CMS blob generation is not implemented, supports ad-hoc signing only. +#include "plist.h" + #include "core/crypto/crypto_core.h" #include "core/io/dir_access.h" #include "core/io/file_access.h" @@ -51,8 +53,6 @@ #include "modules/regex/regex.h" #endif -#include "plist.h" - #ifdef MODULE_REGEX_ENABLED /*************************************************************************/ diff --git a/platform/macos/export/export_plugin.cpp b/platform/macos/export/export_plugin.cpp index f0fa5f2d366..628927e5f82 100644 --- a/platform/macos/export/export_plugin.cpp +++ b/platform/macos/export/export_plugin.cpp @@ -30,6 +30,8 @@ #include "export_plugin.h" +#include "../logo_svg.gen.h" +#include "../run_icon_svg.gen.h" #include "codesign.h" #include "lipo.h" #include "macho.h" @@ -39,8 +41,6 @@ #include "editor/editor_node.h" #include "editor/editor_paths.h" #include "editor/editor_scale.h" -#include "platform/macos/logo_svg.gen.h" -#include "platform/macos/run_icon_svg.gen.h" #include "modules/modules_enabled.gen.h" // For svg and regex. #ifdef MODULE_SVG_ENABLED diff --git a/platform/macos/export/lipo.h b/platform/macos/export/lipo.h index 6a54e47026c..e375fc5a66c 100644 --- a/platform/macos/export/lipo.h +++ b/platform/macos/export/lipo.h @@ -33,11 +33,11 @@ // Universal / Universal 2 fat binary file creator and extractor. +#include "macho.h" + #include "core/io/file_access.h" #include "core/object/ref_counted.h" -#include "macho.h" - class LipO : public RefCounted { struct FatArch { uint32_t cputype; diff --git a/platform/macos/gl_manager_macos_legacy.h b/platform/macos/gl_manager_macos_legacy.h index c33b803d816..94d966f4ed8 100644 --- a/platform/macos/gl_manager_macos_legacy.h +++ b/platform/macos/gl_manager_macos_legacy.h @@ -33,9 +33,6 @@ #if defined(MACOS_ENABLED) && defined(GLES3_ENABLED) -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" // OpenGL is deprecated in macOS 10.14 - #include "core/error/error_list.h" #include "core/os/os.h" #include "core/templates/local_vector.h" @@ -45,6 +42,9 @@ #import #import +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" // OpenGL is deprecated in macOS 10.14 + class GLManager_MacOS { public: enum ContextType { diff --git a/platform/macos/gl_manager_macos_legacy.mm b/platform/macos/gl_manager_macos_legacy.mm index 65e978bfe62..550e2d5c59d 100644 --- a/platform/macos/gl_manager_macos_legacy.mm +++ b/platform/macos/gl_manager_macos_legacy.mm @@ -30,15 +30,14 @@ #include "gl_manager_macos_legacy.h" -#ifdef MACOS_ENABLED -#ifdef GLES3_ENABLED - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" // OpenGL is deprecated in macOS 10.14 +#if defined(MACOS_ENABLED) && defined(GLES3_ENABLED) #include #include +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" // OpenGL is deprecated in macOS 10.14 + Error GLManager_MacOS::create_context(GLWindow &win) { NSOpenGLPixelFormatAttribute attributes[] = { NSOpenGLPFADoubleBuffer, @@ -237,5 +236,4 @@ GLManager_MacOS::~GLManager_MacOS() { #pragma clang diagnostic pop -#endif // GLES3_ENABLED -#endif // MACOS_ENABLED +#endif // MACOS_ENABLED && GLES3_ENABLED diff --git a/platform/macos/godot_content_view.mm b/platform/macos/godot_content_view.mm index 9f5bb2ef5c3..aec2ed413a8 100644 --- a/platform/macos/godot_content_view.mm +++ b/platform/macos/godot_content_view.mm @@ -32,6 +32,7 @@ #include "display_server_macos.h" #include "key_mapping_macos.h" + #include "main/main.h" @implementation GodotContentLayerDelegate diff --git a/platform/macos/godot_main_macos.mm b/platform/macos/godot_main_macos.mm index e98ab081277..58263471b09 100644 --- a/platform/macos/godot_main_macos.mm +++ b/platform/macos/godot_main_macos.mm @@ -28,10 +28,10 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ -#include "main/main.h" - #include "os_macos.h" +#include "main/main.h" + #include #include diff --git a/platform/macos/joypad_macos.h b/platform/macos/joypad_macos.h index d266af7b0da..6a2af11b518 100644 --- a/platform/macos/joypad_macos.h +++ b/platform/macos/joypad_macos.h @@ -31,13 +31,13 @@ #ifndef JOYPAD_MACOS_H #define JOYPAD_MACOS_H +#include "core/input/input.h" + #import #import #import #import -#include "core/input/input.h" - struct rec_element { IOHIDElementRef ref; IOHIDElementCookie cookie; diff --git a/platform/macos/key_mapping_macos.mm b/platform/macos/key_mapping_macos.mm index 7f64ebb734f..db3fa4e02dc 100644 --- a/platform/macos/key_mapping_macos.mm +++ b/platform/macos/key_mapping_macos.mm @@ -30,12 +30,12 @@ #include "key_mapping_macos.h" -#import -#import - #include "core/templates/hash_map.h" #include "core/templates/hash_set.h" +#import +#import + struct HashMapHasherKeys { static _FORCE_INLINE_ uint32_t hash(const Key p_key) { return hash_fmix32(static_cast(p_key)); } static _FORCE_INLINE_ uint32_t hash(const char32_t p_uchar) { return hash_fmix32(p_uchar); } diff --git a/platform/macos/os_macos.h b/platform/macos/os_macos.h index 07bae479be3..69aab800f3b 100644 --- a/platform/macos/os_macos.h +++ b/platform/macos/os_macos.h @@ -31,12 +31,13 @@ #ifndef OS_MACOS_H #define OS_MACOS_H -#include "core/input/input.h" #include "crash_handler_macos.h" -#include "drivers/coreaudio/audio_driver_coreaudio.h" -#include "drivers/coremidi/midi_driver_coremidi.h" -#include "drivers/unix/os_unix.h" #include "joypad_macos.h" + +#include "core/input/input.h" +#import "drivers/coreaudio/audio_driver_coreaudio.h" +#import "drivers/coremidi/midi_driver_coremidi.h" +#include "drivers/unix/os_unix.h" #include "servers/audio_server.h" class OS_MacOS : public OS_Unix { diff --git a/platform/macos/os_macos.mm b/platform/macos/os_macos.mm index 838ae742fd6..5c6cef65c0f 100644 --- a/platform/macos/os_macos.mm +++ b/platform/macos/os_macos.mm @@ -30,16 +30,16 @@ #include "os_macos.h" -#include "core/crypto/crypto_core.h" -#include "core/version_generated.gen.h" -#include "main/main.h" - #include "dir_access_macos.h" #include "display_server_macos.h" #include "godot_application.h" #include "godot_application_delegate.h" #include "macos_terminal_logger.h" +#include "core/crypto/crypto_core.h" +#include "core/version_generated.gen.h" +#include "main/main.h" + #include #include #include diff --git a/platform/macos/vulkan_context_macos.h b/platform/macos/vulkan_context_macos.h index ab10912e702..ab019384e2e 100644 --- a/platform/macos/vulkan_context_macos.h +++ b/platform/macos/vulkan_context_macos.h @@ -34,6 +34,7 @@ #ifdef VULKAN_ENABLED #include "drivers/vulkan/vulkan_context.h" + #import class VulkanContextMacOS : public VulkanContext { diff --git a/platform/macos/vulkan_context_macos.mm b/platform/macos/vulkan_context_macos.mm index 454fb84859d..46a2d9f86ac 100644 --- a/platform/macos/vulkan_context_macos.mm +++ b/platform/macos/vulkan_context_macos.mm @@ -28,8 +28,10 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ -#ifdef VULKAN_ENABLED #include "vulkan_context_macos.h" + +#ifdef VULKAN_ENABLED + #ifdef USE_VOLK #include #else diff --git a/platform/uwp/app_uwp.cpp b/platform/uwp/app_uwp.cpp index ddefa19708e..789adb5e5b7 100644 --- a/platform/uwp/app_uwp.cpp +++ b/platform/uwp/app_uwp.cpp @@ -28,17 +28,12 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ -// -// This file demonstrates how to initialize EGL in a Windows Store app, using ICoreWindow. -// - #include "app_uwp.h" #include "core/io/dir_access.h" #include "core/io/file_access.h" #include "core/os/keyboard.h" #include "main/main.h" - #include "platform/windows/key_mapping_windows.h" #include diff --git a/platform/uwp/app_uwp.h b/platform/uwp/app_uwp.h index 9fd4967c218..87c66bd679d 100644 --- a/platform/uwp/app_uwp.h +++ b/platform/uwp/app_uwp.h @@ -31,13 +31,12 @@ #ifndef APP_UWP_H #define APP_UWP_H -#include - -#include - -#include "GLES2/gl2.h" #include "os_uwp.h" +#include +#include +#include + /** clang-format does not play nice with this C++/CX hybrid, needs investigation. */ /* clang-format off */ diff --git a/platform/uwp/context_egl_uwp.cpp b/platform/uwp/context_egl_uwp.cpp index df5da99a1cf..aa8cfb4d492 100644 --- a/platform/uwp/context_egl_uwp.cpp +++ b/platform/uwp/context_egl_uwp.cpp @@ -30,7 +30,7 @@ #include "context_egl_uwp.h" -#include "EGL/eglext.h" +#include using Platform::Exception; diff --git a/platform/uwp/context_egl_uwp.h b/platform/uwp/context_egl_uwp.h index a7788493345..810c3dcbc18 100644 --- a/platform/uwp/context_egl_uwp.h +++ b/platform/uwp/context_egl_uwp.h @@ -31,13 +31,12 @@ #ifndef CONTEXT_EGL_UWP_H #define CONTEXT_EGL_UWP_H -#include - -#include - #include "core/error/error_list.h" #include "core/os/os.h" +#include +#include + using namespace Windows::UI::Core; class ContextEGL_UWP { diff --git a/platform/uwp/export/export.cpp b/platform/uwp/export/export.cpp index c20e3316a5a..3e229c74198 100644 --- a/platform/uwp/export/export.cpp +++ b/platform/uwp/export/export.cpp @@ -30,9 +30,10 @@ #include "export.h" +#include "export_plugin.h" + #include "editor/editor_settings.h" #include "editor/export/editor_export.h" -#include "export_plugin.h" void register_uwp_exporter_types() { // GDREGISTER_VIRTUAL_CLASS(EditorExportPlatformUWP); diff --git a/platform/uwp/export/export_plugin.cpp b/platform/uwp/export/export_plugin.cpp index aac61184b11..69de383efcf 100644 --- a/platform/uwp/export/export_plugin.cpp +++ b/platform/uwp/export/export_plugin.cpp @@ -30,9 +30,10 @@ #include "export_plugin.h" +#include "../logo_svg.gen.h" + #include "editor/editor_scale.h" #include "editor/editor_settings.h" -#include "platform/uwp/logo_svg.gen.h" #include "modules/modules_enabled.gen.h" // For svg and regex. #ifdef MODULE_SVG_ENABLED diff --git a/platform/uwp/export/export_plugin.h b/platform/uwp/export/export_plugin.h index b42a2ae6d99..999d54cb807 100644 --- a/platform/uwp/export/export_plugin.h +++ b/platform/uwp/export/export_plugin.h @@ -31,6 +31,8 @@ #ifndef UWP_EXPORT_PLUGIN_H #define UWP_EXPORT_PLUGIN_H +#include "app_packager.h" + #include "core/config/project_settings.h" #include "core/crypto/crypto_core.h" #include "core/io/dir_access.h" @@ -46,8 +48,6 @@ #include "thirdparty/minizip/unzip.h" #include "thirdparty/minizip/zip.h" -#include "app_packager.h" - #include // Capabilities diff --git a/platform/uwp/os_uwp.h b/platform/uwp/os_uwp.h index 153656add7b..7f2195e4fdb 100644 --- a/platform/uwp/os_uwp.h +++ b/platform/uwp/os_uwp.h @@ -32,12 +32,13 @@ #define OS_UWP_H #include "context_egl_uwp.h" +#include "joypad_uwp.h" + #include "core/input/input.h" #include "core/math/transform_2d.h" #include "core/os/os.h" #include "core/string/ustring.h" #include "drivers/xaudio2/audio_driver_xaudio2.h" -#include "joypad_uwp.h" #include "servers/audio_server.h" #include "servers/rendering/renderer_compositor.h" #include "servers/rendering_server.h" diff --git a/platform/web/api/api.cpp b/platform/web/api/api.cpp index a630e3d8664..ab7154b0fba 100644 --- a/platform/web/api/api.cpp +++ b/platform/web/api/api.cpp @@ -29,10 +29,12 @@ /**************************************************************************/ #include "api.h" -#include "core/config/engine.h" + #include "javascript_bridge_singleton.h" #include "web_tools_editor_plugin.h" +#include "core/config/engine.h" + static JavaScriptBridge *javascript_bridge_singleton; void register_web_api() { @@ -78,6 +80,7 @@ void JavaScriptBridge::_bind_methods() { } #if !defined(WEB_ENABLED) || !defined(JAVASCRIPT_EVAL_ENABLED) + Variant JavaScriptBridge::eval(const String &p_code, bool p_use_global_exec_context) { return Variant(); } @@ -104,16 +107,23 @@ Variant JavaScriptBridge::_create_object_bind(const Variant **p_args, int p_argc } return Ref(); } + #endif + #if !defined(WEB_ENABLED) + bool JavaScriptBridge::pwa_needs_update() const { return false; } + Error JavaScriptBridge::pwa_update() { return ERR_UNAVAILABLE; } + void JavaScriptBridge::force_fs_sync() { } + void JavaScriptBridge::download_buffer(Vector p_arr, const String &p_name, const String &p_mime) { } + #endif diff --git a/platform/web/api/web_tools_editor_plugin.cpp b/platform/web/api/web_tools_editor_plugin.cpp index 213204ff335..d39773bde2d 100644 --- a/platform/web/api/web_tools_editor_plugin.cpp +++ b/platform/web/api/web_tools_editor_plugin.cpp @@ -28,9 +28,10 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ -#if defined(TOOLS_ENABLED) && defined(WEB_ENABLED) #include "web_tools_editor_plugin.h" +#if defined(TOOLS_ENABLED) && defined(WEB_ENABLED) + #include "core/config/engine.h" #include "core/config/project_settings.h" #include "core/io/dir_access.h" @@ -154,4 +155,5 @@ void WebToolsEditorPlugin::_zip_recursive(String p_path, String p_base_path, zip cur = dir->get_next(); } } -#endif + +#endif // TOOLS_ENABLED && WEB_ENABLED diff --git a/platform/web/api/web_tools_editor_plugin.h b/platform/web/api/web_tools_editor_plugin.h index fc74899a581..ac0d5e20eca 100644 --- a/platform/web/api/web_tools_editor_plugin.h +++ b/platform/web/api/web_tools_editor_plugin.h @@ -32,6 +32,7 @@ #define WEB_TOOLS_EDITOR_PLUGIN_H #if defined(TOOLS_ENABLED) && defined(WEB_ENABLED) + #include "core/io/zip_io.h" #include "editor/editor_plugin.h" @@ -48,11 +49,14 @@ public: WebToolsEditorPlugin(); }; + #else + class WebToolsEditorPlugin { public: static void initialize() {} }; -#endif + +#endif // TOOLS_ENABLED && WEB_ENABLED #endif // WEB_TOOLS_EDITOR_PLUGIN_H diff --git a/platform/web/audio_driver_web.h b/platform/web/audio_driver_web.h index be13935bd9e..7bfed834e10 100644 --- a/platform/web/audio_driver_web.h +++ b/platform/web/audio_driver_web.h @@ -31,12 +31,12 @@ #ifndef AUDIO_DRIVER_WEB_H #define AUDIO_DRIVER_WEB_H +#include "godot_audio.h" + #include "core/os/mutex.h" #include "core/os/thread.h" #include "servers/audio_server.h" -#include "godot_audio.h" - class AudioDriverWeb : public AudioDriver { private: struct AudioContext { diff --git a/platform/web/display_server_web.cpp b/platform/web/display_server_web.cpp index e870f0da293..6cb56b404fd 100644 --- a/platform/web/display_server_web.cpp +++ b/platform/web/display_server_web.cpp @@ -30,19 +30,20 @@ #include "display_server_web.h" +#include "dom_keys.inc" +#include "godot_js.h" +#include "os_web.h" + #include "core/config/project_settings.h" +#include "servers/rendering/dummy/rasterizer_dummy.h" + #ifdef GLES3_ENABLED #include "drivers/gles3/rasterizer_gles3.h" #endif -#include "platform/web/os_web.h" -#include "servers/rendering/dummy/rasterizer_dummy.h" #include #include -#include "dom_keys.inc" -#include "godot_js.h" - #define DOM_BUTTON_LEFT 0 #define DOM_BUTTON_MIDDLE 1 #define DOM_BUTTON_RIGHT 2 diff --git a/platform/web/export/export.cpp b/platform/web/export/export.cpp index 80c29024a84..168310c0786 100644 --- a/platform/web/export/export.cpp +++ b/platform/web/export/export.cpp @@ -30,9 +30,10 @@ #include "export.h" +#include "export_plugin.h" + #include "editor/editor_settings.h" #include "editor/export/editor_export.h" -#include "export_plugin.h" void register_web_exporter_types() { GDREGISTER_VIRTUAL_CLASS(EditorExportPlatformWeb); diff --git a/platform/web/export/export_plugin.cpp b/platform/web/export/export_plugin.cpp index 2fff628c85d..a398593f903 100644 --- a/platform/web/export/export_plugin.cpp +++ b/platform/web/export/export_plugin.cpp @@ -30,12 +30,13 @@ #include "export_plugin.h" +#include "../logo_svg.gen.h" +#include "../run_icon_svg.gen.h" + #include "core/config/project_settings.h" #include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/export/editor_export.h" -#include "platform/web/logo_svg.gen.h" -#include "platform/web/run_icon_svg.gen.h" #include "modules/modules_enabled.gen.h" // For svg. #ifdef MODULE_SVG_ENABLED diff --git a/platform/web/export/export_plugin.h b/platform/web/export/export_plugin.h index 334f12d64d9..a1d3fed2f34 100644 --- a/platform/web/export/export_plugin.h +++ b/platform/web/export/export_plugin.h @@ -31,6 +31,8 @@ #ifndef WEB_EXPORT_PLUGIN_H #define WEB_EXPORT_PLUGIN_H +#include "editor_http_server.h" + #include "core/config/project_settings.h" #include "core/io/image_loader.h" #include "core/io/stream_peer_tls.h" @@ -38,7 +40,6 @@ #include "core/io/zip_io.h" #include "editor/editor_node.h" #include "editor/export/editor_export_platform.h" -#include "editor_http_server.h" #include "main/splash.gen.h" class EditorExportPlatformWeb : public EditorExportPlatform { diff --git a/platform/web/godot_audio.h b/platform/web/godot_audio.h index c6f92161fad..a32d5acd976 100644 --- a/platform/web/godot_audio.h +++ b/platform/web/godot_audio.h @@ -35,7 +35,8 @@ extern "C" { #endif -#include "stddef.h" +#include +#include extern int godot_audio_is_available(); extern int godot_audio_has_worklet(); diff --git a/platform/web/godot_js.h b/platform/web/godot_js.h index 660822e2910..3341cf8a672 100644 --- a/platform/web/godot_js.h +++ b/platform/web/godot_js.h @@ -35,7 +35,7 @@ extern "C" { #endif -#include "stddef.h" +#include // Config extern void godot_js_config_locale_get(char *p_ptr, int p_ptr_max); diff --git a/platform/web/godot_webgl2.h b/platform/web/godot_webgl2.h index fd551ff77db..d2f46e125e6 100644 --- a/platform/web/godot_webgl2.h +++ b/platform/web/godot_webgl2.h @@ -31,8 +31,8 @@ #ifndef GODOT_WEBGL2_H #define GODOT_WEBGL2_H -#include "GLES3/gl3.h" -#include "webgl/webgl2.h" +#include +#include #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR 0x9630 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR 0x9632 diff --git a/platform/web/http_client_web.h b/platform/web/http_client_web.h index def7837a278..bb9672ab82e 100644 --- a/platform/web/http_client_web.h +++ b/platform/web/http_client_web.h @@ -37,7 +37,7 @@ extern "C" { #endif -#include "stddef.h" +#include typedef enum { GODOT_JS_FETCH_STATE_REQUESTING = 0, diff --git a/platform/web/javascript_bridge_singleton.cpp b/platform/web/javascript_bridge_singleton.cpp index dba630404fa..45bce1b4805 100644 --- a/platform/web/javascript_bridge_singleton.cpp +++ b/platform/web/javascript_bridge_singleton.cpp @@ -30,9 +30,10 @@ #include "api/javascript_bridge_singleton.h" -#include "emscripten.h" #include "os_web.h" +#include + extern "C" { extern void godot_js_os_download_buffer(const uint8_t *p_buf, int p_buf_size, const char *p_name, const char *p_mime); } @@ -352,6 +353,7 @@ Variant JavaScriptBridge::eval(const String &p_code, bool p_use_global_exec_cont return Variant(); } } + #endif // JAVASCRIPT_EVAL_ENABLED void JavaScriptBridge::download_buffer(Vector p_arr, const String &p_name, const String &p_mime) { diff --git a/platform/web/os_web.cpp b/platform/web/os_web.cpp index 0f84e7e841c..5115ff50dac 100644 --- a/platform/web/os_web.cpp +++ b/platform/web/os_web.cpp @@ -30,12 +30,15 @@ #include "os_web.h" +#include "api/javascript_bridge_singleton.h" +#include "display_server_web.h" +#include "godot_js.h" + #include "core/config/project_settings.h" #include "core/debugger/engine_debugger.h" #include "drivers/unix/dir_access_unix.h" #include "drivers/unix/file_access_unix.h" #include "main/main.h" -#include "platform/web/display_server_web.h" #include "modules/modules_enabled.gen.h" // For websocket. @@ -43,9 +46,6 @@ #include #include -#include "api/javascript_bridge_singleton.h" -#include "godot_js.h" - void OS_Web::alert(const String &p_alert, const String &p_title) { godot_js_display_alert(p_alert.utf8().get_data()); } diff --git a/platform/web/os_web.h b/platform/web/os_web.h index 70d8af9db99..b9570f9ca1a 100644 --- a/platform/web/os_web.h +++ b/platform/web/os_web.h @@ -32,6 +32,7 @@ #define OS_WEB_H #include "audio_driver_web.h" + #include "core/input/input.h" #include "drivers/unix/os_unix.h" #include "servers/audio_server.h" diff --git a/platform/web/web_main.cpp b/platform/web/web_main.cpp index df97b08b8ac..f199f8ffd8c 100644 --- a/platform/web/web_main.cpp +++ b/platform/web/web_main.cpp @@ -28,17 +28,17 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ +#include "display_server_web.h" +#include "godot_js.h" +#include "os_web.h" + #include "core/config/engine.h" #include "core/io/resource_loader.h" #include "main/main.h" -#include "platform/web/display_server_web.h" -#include "platform/web/os_web.h" #include #include -#include "godot_js.h" - static OS_Web *os = nullptr; static uint64_t target_ticks = 0; static bool main_started = false; diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp index f971846959e..dc0a9dabe9e 100644 --- a/platform/windows/display_server_windows.cpp +++ b/platform/windows/display_server_windows.cpp @@ -30,12 +30,16 @@ #include "display_server_windows.h" -#include "core/io/marshalls.h" -#include "core/math/geometry_2d.h" -#include "main/main.h" #include "os_windows.h" + +#include "core/io/marshalls.h" +#include "main/main.h" #include "scene/resources/texture.h" +#if defined(GLES3_ENABLED) +#include "drivers/gles3/rasterizer_gles3.h" +#endif + #include #include @@ -43,10 +47,6 @@ #define DWMWA_USE_IMMERSIVE_DARK_MODE 20 #endif -#if defined(GLES3_ENABLED) -#include "drivers/gles3/rasterizer_gles3.h" -#endif - #if defined(__GNUC__) // Workaround GCC warning from -Wcast-function-type. #define GetProcAddress (void *)GetProcAddress diff --git a/platform/windows/display_server_windows.h b/platform/windows/display_server_windows.h index 4a1619f3310..ae2cd4e8b59 100644 --- a/platform/windows/display_server_windows.h +++ b/platform/windows/display_server_windows.h @@ -31,30 +31,31 @@ #ifndef DISPLAY_SERVER_WINDOWS_H #define DISPLAY_SERVER_WINDOWS_H -#include "servers/display_server.h" +#include "crash_handler_windows.h" +#include "joypad_windows.h" +#include "key_mapping_windows.h" +#include "tts_windows.h" #include "core/config/project_settings.h" #include "core/input/input.h" #include "core/os/os.h" -#include "crash_handler_windows.h" #include "drivers/unix/ip_unix.h" #include "drivers/wasapi/audio_driver_wasapi.h" #include "drivers/winmidi/midi_driver_winmidi.h" -#include "joypad_windows.h" -#include "key_mapping_windows.h" #include "servers/audio_server.h" +#include "servers/display_server.h" #include "servers/rendering/renderer_compositor.h" #include "servers/rendering/renderer_rd/renderer_compositor_rd.h" #include "servers/rendering_server.h" -#include "tts_windows.h" #ifdef XAUDIO2_ENABLED #include "drivers/xaudio2/audio_driver_xaudio2.h" #endif #if defined(VULKAN_ENABLED) +#include "vulkan_context_win.h" + #include "drivers/vulkan/rendering_device_vulkan.h" -#include "platform/windows/vulkan_context_win.h" #endif #if defined(GLES3_ENABLED) diff --git a/platform/windows/export/export.cpp b/platform/windows/export/export.cpp index 08c620e1e93..7a65f74f0d6 100644 --- a/platform/windows/export/export.cpp +++ b/platform/windows/export/export.cpp @@ -30,9 +30,10 @@ #include "export.h" -#include "editor/export/editor_export.h" #include "export_plugin.h" +#include "editor/export/editor_export.h" + void register_windows_exporter_types() { GDREGISTER_VIRTUAL_CLASS(EditorExportPlatformWindows); } diff --git a/platform/windows/export/export_plugin.cpp b/platform/windows/export/export_plugin.cpp index 2ac41af3a2d..7371e4daf77 100644 --- a/platform/windows/export/export_plugin.cpp +++ b/platform/windows/export/export_plugin.cpp @@ -30,14 +30,15 @@ #include "export_plugin.h" +#include "../logo_svg.gen.h" +#include "../run_icon_svg.gen.h" + #include "core/config/project_settings.h" #include "core/io/image_loader.h" #include "editor/editor_node.h" #include "editor/editor_paths.h" #include "editor/editor_scale.h" #include "editor/export/editor_export.h" -#include "platform/windows/logo_svg.gen.h" -#include "platform/windows/run_icon_svg.gen.h" #include "modules/modules_enabled.gen.h" // For svg. #ifdef MODULE_SVG_ENABLED diff --git a/platform/windows/gl_manager_windows.cpp b/platform/windows/gl_manager_windows.cpp index dbe1e1aefa0..1494e3ed1bc 100644 --- a/platform/windows/gl_manager_windows.cpp +++ b/platform/windows/gl_manager_windows.cpp @@ -30,13 +30,11 @@ #include "gl_manager_windows.h" -#ifdef WINDOWS_ENABLED -#ifdef GLES3_ENABLED - -#include -#include +#if defined(WINDOWS_ENABLED) && defined(GLES3_ENABLED) #include +#include +#include #define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 #define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 @@ -345,5 +343,4 @@ GLManager_Windows::~GLManager_Windows() { release_current(); } -#endif // GLES3_ENABLED -#endif // WINDOWS +#endif // WINDOWS_ENABLED && GLES3_ENABLED diff --git a/platform/windows/gl_manager_windows.h b/platform/windows/gl_manager_windows.h index 361c559a5a0..a0d4b28c6f0 100644 --- a/platform/windows/gl_manager_windows.h +++ b/platform/windows/gl_manager_windows.h @@ -119,6 +119,6 @@ public: ~GLManager_Windows(); }; -#endif // defined(WINDOWS_ENABLED) && defined(GLES3_ENABLED) +#endif // WINDOWS_ENABLED && GLES3_ENABLED #endif // GL_MANAGER_WINDOWS_H diff --git a/platform/windows/godot_windows.cpp b/platform/windows/godot_windows.cpp index a26d3baa9f6..8d63b1747ed 100644 --- a/platform/windows/godot_windows.cpp +++ b/platform/windows/godot_windows.cpp @@ -28,9 +28,10 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ -#include "main/main.h" #include "os_windows.h" +#include "main/main.h" + #include #include diff --git a/platform/windows/joypad_windows.h b/platform/windows/joypad_windows.h index 0803ba53c20..cfddbcc8dc0 100644 --- a/platform/windows/joypad_windows.h +++ b/platform/windows/joypad_windows.h @@ -35,7 +35,7 @@ #define DIRECTINPUT_VERSION 0x0800 #include -#include // on unix the file is called "xinput.h", on windows I'm sure it won't mind +#include #ifndef SAFE_RELEASE // when Windows Media Device M? is not present #define SAFE_RELEASE(x) \ diff --git a/platform/windows/lang_table.h b/platform/windows/lang_table.h index 198856ab1bb..e1f4f727467 100644 --- a/platform/windows/lang_table.h +++ b/platform/windows/lang_table.h @@ -31,8 +31,6 @@ #ifndef LANG_TABLE_H #define LANG_TABLE_H -//#include - struct _WinLocale { const char *locale; int main_lang; diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 411811969e4..cb70f93a62f 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -30,6 +30,11 @@ #include "os_windows.h" +#include "display_server_windows.h" +#include "joypad_windows.h" +#include "lang_table.h" +#include "windows_terminal_logger.h" + #include "core/debugger/engine_debugger.h" #include "core/debugger/script_debugger.h" #include "core/io/marshalls.h" @@ -37,14 +42,10 @@ #include "drivers/unix/net_socket_posix.h" #include "drivers/windows/dir_access_windows.h" #include "drivers/windows/file_access_windows.h" -#include "joypad_windows.h" -#include "lang_table.h" #include "main/main.h" -#include "platform/windows/display_server_windows.h" #include "servers/audio_server.h" #include "servers/rendering/rendering_server_default.h" #include "servers/text_server.h" -#include "windows_terminal_logger.h" #include #include diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h index c5f95870b31..e873fb8a130 100644 --- a/platform/windows/os_windows.h +++ b/platform/windows/os_windows.h @@ -31,14 +31,15 @@ #ifndef OS_WINDOWS_H #define OS_WINDOWS_H +#include "crash_handler_windows.h" +#include "key_mapping_windows.h" + #include "core/config/project_settings.h" #include "core/input/input.h" #include "core/os/os.h" -#include "crash_handler_windows.h" #include "drivers/unix/ip_unix.h" #include "drivers/wasapi/audio_driver_wasapi.h" #include "drivers/winmidi/midi_driver_winmidi.h" -#include "key_mapping_windows.h" #include "servers/audio_server.h" #ifdef XAUDIO2_ENABLED @@ -46,8 +47,9 @@ #endif #if defined(VULKAN_ENABLED) +#include "vulkan_context_win.h" + #include "drivers/vulkan/rendering_device_vulkan.h" -#include "platform/windows/vulkan_context_win.h" #endif #include diff --git a/platform/windows/vulkan_context_win.cpp b/platform/windows/vulkan_context_win.cpp index 4c1e6eebe4f..a60055dbec5 100644 --- a/platform/windows/vulkan_context_win.cpp +++ b/platform/windows/vulkan_context_win.cpp @@ -31,6 +31,7 @@ #if defined(WINDOWS_ENABLED) && defined(VULKAN_ENABLED) #include "vulkan_context_win.h" + #ifdef USE_VOLK #include #else @@ -64,4 +65,4 @@ VulkanContextWindows::VulkanContextWindows() { VulkanContextWindows::~VulkanContextWindows() { } -#endif +#endif // WINDOWS_ENABLED && VULKAN_ENABLED diff --git a/platform/windows/windows_terminal_logger.cpp b/platform/windows/windows_terminal_logger.cpp index 47b569dd82d..bb223628a89 100644 --- a/platform/windows/windows_terminal_logger.cpp +++ b/platform/windows/windows_terminal_logger.cpp @@ -33,6 +33,7 @@ #ifdef WINDOWS_ENABLED #include + #define WIN32_LEAN_AND_MEAN #include @@ -163,4 +164,4 @@ void WindowsTerminalLogger::log_error(const char *p_function, const char *p_file WindowsTerminalLogger::~WindowsTerminalLogger() {} -#endif +#endif // WINDOWS_ENABLED diff --git a/platform/windows/windows_terminal_logger.h b/platform/windows/windows_terminal_logger.h index c366d464618..60d82bb9353 100644 --- a/platform/windows/windows_terminal_logger.h +++ b/platform/windows/windows_terminal_logger.h @@ -42,6 +42,6 @@ public: virtual ~WindowsTerminalLogger(); }; -#endif +#endif // WINDOWS_ENABLED #endif // WINDOWS_TERMINAL_LOGGER_H