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.
This commit is contained in:
Rémi Verschelde 2023-06-08 14:51:32 +02:00
parent 2985a9ac34
commit 9e4315bb50
No known key found for this signature in database
GPG Key ID: C3336907360768E1
116 changed files with 372 additions and 309 deletions

View File

@ -28,10 +28,10 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/ /**************************************************************************/
#ifdef COREAUDIO_ENABLED
#include "audio_driver_coreaudio.h" #include "audio_driver_coreaudio.h"
#ifdef COREAUDIO_ENABLED
#include "core/config/project_settings.h" #include "core/config/project_settings.h"
#include "core/os/os.h" #include "core/os/os.h"

View File

@ -28,10 +28,10 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/ /**************************************************************************/
#ifdef COREMIDI_ENABLED
#include "midi_driver_coremidi.h" #include "midi_driver_coremidi.h"
#ifdef COREMIDI_ENABLED
#include "core/string/print_string.h" #include "core/string/print_string.h"
#import <CoreAudio/HostTime.h> #import <CoreAudio/HostTime.h>

View File

@ -21,7 +21,7 @@ android_files = [
"android_keys_utils.cpp", "android_keys_utils.cpp",
"display_server_android.cpp", "display_server_android.cpp",
"plugin/godot_plugin_jni.cpp", "plugin/godot_plugin_jni.cpp",
"vulkan/vulkan_context_android.cpp", "vulkan_context_android.cpp",
] ]
env_android = env.Clone() env_android = env.Clone()

View File

@ -31,8 +31,9 @@
#ifndef ANDROID_KEYS_UTILS_H #ifndef ANDROID_KEYS_UTILS_H
#define ANDROID_KEYS_UTILS_H #define ANDROID_KEYS_UTILS_H
#include "core/os/keyboard.h"
#include <android/input.h> #include <android/input.h>
#include <core/os/keyboard.h>
#define AKEYCODE_MAX 0xFFFF #define AKEYCODE_MAX 0xFFFF

View File

@ -30,10 +30,11 @@
#include "api.h" #include "api.h"
#include "core/config/engine.h"
#include "java_class_wrapper.h" #include "java_class_wrapper.h"
#include "jni_singleton.h" #include "jni_singleton.h"
#include "core/config/engine.h"
#if !defined(ANDROID_ENABLED) #if !defined(ANDROID_ENABLED)
static JavaClassWrapper *java_class_wrapper = nullptr; static JavaClassWrapper *java_class_wrapper = nullptr;
#endif #endif

View File

@ -33,8 +33,9 @@
#include "core/config/engine.h" #include "core/config/engine.h"
#include "core/variant/variant.h" #include "core/variant/variant.h"
#ifdef ANDROID_ENABLED #ifdef ANDROID_ENABLED
#include "platform/android/jni_utils.h" #include "jni_utils.h"
#endif #endif
class JNISingleton : public Object { class JNISingleton : public Object {

View File

@ -30,10 +30,11 @@
#include "dir_access_jandroid.h" #include "dir_access_jandroid.h"
#include "core/string/print_string.h"
#include "string_android.h" #include "string_android.h"
#include "thread_jandroid.h" #include "thread_jandroid.h"
#include "core/string/print_string.h"
jobject DirAccessJAndroid::dir_access_handler = nullptr; jobject DirAccessJAndroid::dir_access_handler = nullptr;
jclass DirAccessJAndroid::cls = nullptr; jclass DirAccessJAndroid::cls = nullptr;
jmethodID DirAccessJAndroid::_dir_open = nullptr; jmethodID DirAccessJAndroid::_dir_open = nullptr;

View File

@ -31,9 +31,11 @@
#ifndef DIR_ACCESS_JANDROID_H #ifndef DIR_ACCESS_JANDROID_H
#define DIR_ACCESS_JANDROID_H #define DIR_ACCESS_JANDROID_H
#include "java_godot_lib_jni.h"
#include "core/io/dir_access.h" #include "core/io/dir_access.h"
#include "drivers/unix/dir_access_unix.h" #include "drivers/unix/dir_access_unix.h"
#include "java_godot_lib_jni.h"
#include <stdio.h> #include <stdio.h>
/// Android implementation of the DirAccess interface used to provide access to /// Android implementation of the DirAccess interface used to provide access to

View File

@ -30,19 +30,23 @@
#include "display_server_android.h" #include "display_server_android.h"
#include "core/config/project_settings.h"
#include "java_godot_io_wrapper.h" #include "java_godot_io_wrapper.h"
#include "java_godot_wrapper.h" #include "java_godot_wrapper.h"
#include "os_android.h" #include "os_android.h"
#include "tts_android.h" #include "tts_android.h"
#include "core/config/project_settings.h"
#if defined(VULKAN_ENABLED) #if defined(VULKAN_ENABLED)
#include "vulkan_context_android.h"
#include "drivers/vulkan/rendering_device_vulkan.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" #include "servers/rendering/renderer_rd/renderer_compositor_rd.h"
#endif #endif
#ifdef GLES3_ENABLED #ifdef GLES3_ENABLED
#include "drivers/gles3/rasterizer_gles3.h" #include "drivers/gles3/rasterizer_gles3.h"
#include <EGL/egl.h> #include <EGL/egl.h>
#endif #endif

View File

@ -30,10 +30,11 @@
#include "export.h" #include "export.h"
#include "export_plugin.h"
#include "core/os/os.h" #include "core/os/os.h"
#include "editor/editor_settings.h" #include "editor/editor_settings.h"
#include "editor/export/editor_export.h" #include "editor/export/editor_export.h"
#include "export_plugin.h"
void register_android_exporter_types() { void register_android_exporter_types() {
GDREGISTER_VIRTUAL_CLASS(EditorExportPlatformAndroid); GDREGISTER_VIRTUAL_CLASS(EditorExportPlatformAndroid);

View File

@ -30,6 +30,8 @@
#include "export_plugin.h" #include "export_plugin.h"
#include "../logo_svg.gen.h"
#include "../run_icon_svg.gen.h"
#include "gradle_export_util.h" #include "gradle_export_util.h"
#include "core/config/project_settings.h" #include "core/config/project_settings.h"
@ -46,8 +48,6 @@
#include "editor/editor_scale.h" #include "editor/editor_scale.h"
#include "editor/editor_settings.h" #include "editor/editor_settings.h"
#include "main/splash.gen.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. #include "modules/modules_enabled.gen.h" // For svg.
#ifdef MODULE_SVG_ENABLED #ifdef MODULE_SVG_ENABLED

View File

@ -29,6 +29,7 @@
/**************************************************************************/ /**************************************************************************/
#include "godot_plugin_config.h" #include "godot_plugin_config.h"
/* /*
* Set of prebuilt plugins. * Set of prebuilt plugins.
* Currently unused, this is just for future reference: * Currently unused, this is just for future reference:

View File

@ -32,6 +32,7 @@
#define FILE_ACCESS_ANDROID_H #define FILE_ACCESS_ANDROID_H
#include "core/io/file_access.h" #include "core/io/file_access.h"
#include <android/asset_manager.h> #include <android/asset_manager.h>
#include <android/log.h> #include <android/log.h>
#include <stdio.h> #include <stdio.h>

View File

@ -30,9 +30,10 @@
#include "file_access_filesystem_jandroid.h" #include "file_access_filesystem_jandroid.h"
#include "thread_jandroid.h"
#include "core/os/os.h" #include "core/os/os.h"
#include "core/templates/local_vector.h" #include "core/templates/local_vector.h"
#include "thread_jandroid.h"
#include <unistd.h> #include <unistd.h>

View File

@ -31,9 +31,10 @@
#ifndef FILE_ACCESS_FILESYSTEM_JANDROID_H #ifndef FILE_ACCESS_FILESYSTEM_JANDROID_H
#define FILE_ACCESS_FILESYSTEM_JANDROID_H #define FILE_ACCESS_FILESYSTEM_JANDROID_H
#include "core/io/file_access.h"
#include "java_godot_lib_jni.h" #include "java_godot_lib_jni.h"
#include "core/io/file_access.h"
class FileAccessFilesystemJAndroid : public FileAccess { class FileAccessFilesystemJAndroid : public FileAccess {
static jobject file_access_handler; static jobject file_access_handler;
static jclass cls; static jclass cls;

View File

@ -31,12 +31,13 @@
#ifndef JAVA_GODOT_IO_WRAPPER_H #ifndef JAVA_GODOT_IO_WRAPPER_H
#define JAVA_GODOT_IO_WRAPPER_H #define JAVA_GODOT_IO_WRAPPER_H
#include <android/log.h> #include "string_android.h"
#include <jni.h>
#include "core/math/rect2i.h" #include "core/math/rect2i.h"
#include "core/variant/typed_array.h" #include "core/variant/typed_array.h"
#include "string_android.h"
#include <android/log.h>
#include <jni.h>
// Class that makes functions in java/src/org/godotengine/godot/GodotIO.java callable from C++ // Class that makes functions in java/src/org/godotengine/godot/GodotIO.java callable from C++
class GodotIOJavaWrapper { class GodotIOJavaWrapper {

View File

@ -30,37 +30,36 @@
#include "java_godot_lib_jni.h" #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 "android_input_handler.h"
#include "api/java_class_wrapper.h" #include "api/java_class_wrapper.h"
#include "api/jni_singleton.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 "dir_access_jandroid.h"
#include "display_server_android.h" #include "display_server_android.h"
#include "file_access_android.h" #include "file_access_android.h"
#include "file_access_filesystem_jandroid.h" #include "file_access_filesystem_jandroid.h"
#include "java_godot_io_wrapper.h"
#include "java_godot_wrapper.h"
#include "jni_utils.h" #include "jni_utils.h"
#include "main/main.h"
#include "net_socket_android.h" #include "net_socket_android.h"
#include "os_android.h" #include "os_android.h"
#include "string_android.h" #include "string_android.h"
#include "thread_jandroid.h" #include "thread_jandroid.h"
#include "tts_android.h" #include "tts_android.h"
#include <android/input.h> #include "core/config/engine.h"
#include <unistd.h> #include "core/config/project_settings.h"
#include "core/input/input.h"
#include <android/native_window_jni.h> #include "main/main.h"
#ifdef TOOLS_ENABLED #ifdef TOOLS_ENABLED
#include "editor/editor_settings.h" #include "editor/editor_settings.h"
#endif #endif
#include <android/asset_manager_jni.h>
#include <android/input.h>
#include <android/native_window_jni.h>
#include <unistd.h>
static JavaClassWrapper *java_class_wrapper = nullptr; static JavaClassWrapper *java_class_wrapper = nullptr;
static OS_Android *os_android = nullptr; static OS_Android *os_android = nullptr;
static AndroidInputHandler *input_handler = nullptr; static AndroidInputHandler *input_handler = nullptr;

View File

@ -31,12 +31,13 @@
#ifndef JAVA_GODOT_VIEW_WRAPPER_H #ifndef JAVA_GODOT_VIEW_WRAPPER_H
#define JAVA_GODOT_VIEW_WRAPPER_H #define JAVA_GODOT_VIEW_WRAPPER_H
#include "string_android.h"
#include "core/math/vector2.h" #include "core/math/vector2.h"
#include <android/log.h> #include <android/log.h>
#include <jni.h> #include <jni.h>
#include "string_android.h"
// Class that makes functions in java/src/org/godotengine/godot/GodotView.java callable from C++ // Class that makes functions in java/src/org/godotengine/godot/GodotView.java callable from C++
class GodotJavaViewWrapper { class GodotJavaViewWrapper {
private: private:

View File

@ -31,13 +31,14 @@
#ifndef JAVA_GODOT_WRAPPER_H #ifndef JAVA_GODOT_WRAPPER_H
#define JAVA_GODOT_WRAPPER_H #define JAVA_GODOT_WRAPPER_H
#include <android/log.h>
#include <jni.h>
#include "core/templates/list.h"
#include "java_godot_view_wrapper.h" #include "java_godot_view_wrapper.h"
#include "string_android.h" #include "string_android.h"
#include "core/templates/list.h"
#include <android/log.h>
#include <jni.h>
// Class that makes functions in java/src/org/godotengine/godot/Godot.java callable from C++ // Class that makes functions in java/src/org/godotengine/godot/Godot.java callable from C++
class GodotJavaWrapper { class GodotJavaWrapper {
private: private:

View File

@ -32,8 +32,10 @@
#define JNI_UTILS_H #define JNI_UTILS_H
#include "string_android.h" #include "string_android.h"
#include <core/config/engine.h>
#include <core/variant/variant.h> #include "core/config/engine.h"
#include "core/variant/variant.h"
#include <jni.h> #include <jni.h>
struct jvalret { struct jvalret {

View File

@ -30,25 +30,24 @@
#include "os_android.h" #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 "core/config/project_settings.h"
#include "drivers/unix/dir_access_unix.h" #include "drivers/unix/dir_access_unix.h"
#include "drivers/unix/file_access_unix.h" #include "drivers/unix/file_access_unix.h"
#include "main/main.h" #include "main/main.h"
#include "platform/android/display_server_android.h"
#include "scene/main/scene_tree.h" #include "scene/main/scene_tree.h"
#include "servers/rendering_server.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 <dlfcn.h> #include <dlfcn.h>
#include <sys/system_properties.h> #include <sys/system_properties.h>
#include "java_godot_io_wrapper.h"
#include "java_godot_wrapper.h"
const char *OS_Android::ANDROID_EXEC_PATH = "apk"; const char *OS_Android::ANDROID_EXEC_PATH = "apk";
String _remove_symlink(const String &dir) { String _remove_symlink(const String &dir) {

View File

@ -32,6 +32,7 @@
#define OS_ANDROID_H #define OS_ANDROID_H
#include "audio_driver_opensl.h" #include "audio_driver_opensl.h"
#include "core/os/main_loop.h" #include "core/os/main_loop.h"
#include "drivers/unix/os_unix.h" #include "drivers/unix/os_unix.h"
#include "servers/audio_server.h" #include "servers/audio_server.h"

View File

@ -30,12 +30,13 @@
#include "godot_plugin_jni.h" #include "godot_plugin_jni.h"
#include <core/config/engine.h> #include "api/jni_singleton.h"
#include <core/config/project_settings.h> #include "jni_utils.h"
#include <core/error/error_macros.h> #include "string_android.h"
#include <platform/android/api/jni_singleton.h>
#include <platform/android/jni_utils.h> #include "core/config/engine.h"
#include <platform/android/string_android.h> #include "core/config/project_settings.h"
#include "core/error/error_macros.h"
static HashMap<String, JNISingleton *> jni_singletons; static HashMap<String, JNISingleton *> jni_singletons;

View File

@ -31,8 +31,10 @@
#ifndef STRING_ANDROID_H #ifndef STRING_ANDROID_H
#define STRING_ANDROID_H #define STRING_ANDROID_H
#include "core/string/ustring.h"
#include "thread_jandroid.h" #include "thread_jandroid.h"
#include "core/string/ustring.h"
#include <jni.h> #include <jni.h>
/** /**

View File

@ -30,10 +30,10 @@
#include "thread_jandroid.h" #include "thread_jandroid.h"
#include <android/log.h>
#include "core/os/thread.h" #include "core/os/thread.h"
#include <android/log.h>
static JavaVM *java_vm = nullptr; static JavaVM *java_vm = nullptr;
static thread_local JNIEnv *env = nullptr; static thread_local JNIEnv *env = nullptr;

View File

@ -28,10 +28,10 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/ /**************************************************************************/
#ifdef VULKAN_ENABLED
#include "vulkan_context_android.h" #include "vulkan_context_android.h"
#ifdef VULKAN_ENABLED
#ifdef USE_VOLK #ifdef USE_VOLK
#include <volk.h> #include <volk.h>
#else #else

View File

@ -45,4 +45,4 @@ void unregister_ios_api() {
void register_ios_api() {} void register_ios_api() {}
void unregister_ios_api() {} void unregister_ios_api() {}
#endif #endif // IOS_ENABLED

View File

@ -30,13 +30,14 @@
#import "app_delegate.h" #import "app_delegate.h"
#include "core/config/project_settings.h"
#include "drivers/coreaudio/audio_driver_coreaudio.h"
#import "godot_view.h" #import "godot_view.h"
#include "main/main.h" #import "os_ios.h"
#include "os_ios.h"
#import "view_controller.h" #import "view_controller.h"
#include "core/config/project_settings.h"
#import "drivers/coreaudio/audio_driver_coreaudio.h"
#include "main/main.h"
#import <AVFoundation/AVFoundation.h> #import <AVFoundation/AVFoundation.h>
#import <AudioToolbox/AudioServices.h> #import <AudioToolbox/AudioServices.h>

View File

@ -30,11 +30,12 @@
#import "display_layer.h" #import "display_layer.h"
#import "display_server_ios.h"
#import "os_ios.h"
#include "core/config/project_settings.h" #include "core/config/project_settings.h"
#include "core/os/keyboard.h" #include "core/os/keyboard.h"
#include "display_server_ios.h"
#include "main/main.h" #include "main/main.h"
#include "os_ios.h"
#include "servers/audio_server.h" #include "servers/audio_server.h"
#import <AudioToolbox/AudioServices.h> #import <AudioToolbox/AudioServices.h>

View File

@ -35,17 +35,17 @@
#include "servers/display_server.h" #include "servers/display_server.h"
#if defined(VULKAN_ENABLED) #if defined(VULKAN_ENABLED)
#import "vulkan_context_ios.h"
#include "drivers/vulkan/rendering_device_vulkan.h" #include "drivers/vulkan/rendering_device_vulkan.h"
#include "servers/rendering/renderer_rd/renderer_compositor_rd.h" #include "servers/rendering/renderer_rd/renderer_compositor_rd.h"
#include "vulkan_context_ios.h"
#ifdef USE_VOLK #ifdef USE_VOLK
#include <volk.h> #include <volk.h>
#else #else
#include <vulkan/vulkan.h> #include <vulkan/vulkan.h>
#endif #endif
#endif #endif // VULKAN_ENABLED
#if defined(GLES3_ENABLED) #if defined(GLES3_ENABLED)
#include "drivers/gles3/rasterizer_gles3.h" #include "drivers/gles3/rasterizer_gles3.h"

View File

@ -28,20 +28,21 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/ /**************************************************************************/
#include "display_server_ios.h" #import "display_server_ios.h"
#import "app_delegate.h" #import "app_delegate.h"
#include "core/config/project_settings.h"
#include "core/io/file_access_pack.h"
#import "device_metrics.h" #import "device_metrics.h"
#import "godot_view.h" #import "godot_view.h"
#include "ios.h" #import "ios.h"
#import "key_mapping_ios.h" #import "key_mapping_ios.h"
#import "keyboard_input_view.h" #import "keyboard_input_view.h"
#include "os_ios.h" #import "os_ios.h"
#include "tts_ios.h" #import "tts_ios.h"
#import "view_controller.h" #import "view_controller.h"
#include "core/config/project_settings.h"
#include "core/io/file_access_pack.h"
#import <sys/utsname.h> #import <sys/utsname.h>
static const float kDisplayServerIOSAcceleration = 1.f; static const float kDisplayServerIOSAcceleration = 1.f;

View File

@ -30,9 +30,10 @@
#include "export.h" #include "export.h"
#include "editor/export/editor_export.h"
#include "export_plugin.h" #include "export_plugin.h"
#include "editor/export/editor_export.h"
void register_ios_exporter_types() { void register_ios_exporter_types() {
GDREGISTER_VIRTUAL_CLASS(EditorExportPlatformIOS); GDREGISTER_VIRTUAL_CLASS(EditorExportPlatformIOS);
} }

View File

@ -30,11 +30,12 @@
#include "export_plugin.h" #include "export_plugin.h"
#include "../logo_svg.gen.h"
#include "core/string/translation.h" #include "core/string/translation.h"
#include "editor/editor_node.h" #include "editor/editor_node.h"
#include "editor/editor_scale.h" #include "editor/editor_scale.h"
#include "editor/export/editor_export.h" #include "editor/export/editor_export.h"
#include "platform/ios/logo_svg.gen.h"
#include "modules/modules_enabled.gen.h" // For svg. #include "modules/modules_enabled.gen.h" // For svg.
#ifdef MODULE_SVG_ENABLED #ifdef MODULE_SVG_ENABLED

View File

@ -31,6 +31,8 @@
#ifndef IOS_EXPORT_PLUGIN_H #ifndef IOS_EXPORT_PLUGIN_H
#define IOS_EXPORT_PLUGIN_H #define IOS_EXPORT_PLUGIN_H
#include "godot_plugin_config.h"
#include "core/config/project_settings.h" #include "core/config/project_settings.h"
#include "core/io/file_access.h" #include "core/io/file_access.h"
#include "core/io/image_loader.h" #include "core/io/image_loader.h"
@ -43,10 +45,8 @@
#include "editor/editor_settings.h" #include "editor/editor_settings.h"
#include "editor/export/editor_export_platform.h" #include "editor/export/editor_export_platform.h"
#include "main/splash.gen.h" #include "main/splash.gen.h"
#include "string.h"
#include "godot_plugin_config.h"
#include <string.h>
#include <sys/stat.h> #include <sys/stat.h>
// Optional environment variables for defining confidential information. If any // Optional environment variables for defining confidential information. If any

View File

@ -28,9 +28,10 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/ /**************************************************************************/
#import "os_ios.h"
#include "core/string/ustring.h" #include "core/string/ustring.h"
#include "main/main.h" #include "main/main.h"
#include "os_ios.h"
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>

View File

@ -30,12 +30,13 @@
#import "godot_view.h" #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/config/project_settings.h"
#include "core/os/keyboard.h" #include "core/os/keyboard.h"
#include "core/string/ustring.h" #include "core/string/ustring.h"
#import "display_layer.h"
#include "display_server_ios.h"
#import "godot_view_renderer.h"
#import <CoreMotion/CoreMotion.h> #import <CoreMotion/CoreMotion.h>

View File

@ -30,11 +30,12 @@
#import "godot_view_renderer.h" #import "godot_view_renderer.h"
#import "display_server_ios.h"
#import "os_ios.h"
#include "core/config/project_settings.h" #include "core/config/project_settings.h"
#include "core/os/keyboard.h" #include "core/os/keyboard.h"
#import "display_server_ios.h"
#include "main/main.h" #include "main/main.h"
#include "os_ios.h"
#include "servers/audio_server.h" #include "servers/audio_server.h"
#import <AudioToolbox/AudioServices.h> #import <AudioToolbox/AudioServices.h>

View File

@ -32,6 +32,7 @@
#define IOS_H #define IOS_H
#include "core/object/class_db.h" #include "core/object/class_db.h"
#import <CoreHaptics/CoreHaptics.h> #import <CoreHaptics/CoreHaptics.h>
class iOS : public Object { class iOS : public Object {

View File

@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/ /**************************************************************************/
#include "ios.h" #import "ios.h"
#import "app_delegate.h" #import "app_delegate.h"
#import "view_controller.h" #import "view_controller.h"

View File

@ -30,13 +30,12 @@
#import "joypad_ios.h" #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 "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() { JoypadIOS::JoypadIOS() {
observer = [[JoypadIOSObserver alloc] init]; observer = [[JoypadIOSObserver alloc] init];

View File

@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* 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" #include "core/templates/hash_map.h"

View File

@ -30,9 +30,10 @@
#import "keyboard_input_view.h" #import "keyboard_input_view.h"
#import "display_server_ios.h"
#import "os_ios.h"
#include "core/os/keyboard.h" #include "core/os/keyboard.h"
#include "display_server_ios.h"
#include "os_ios.h"
@interface GodotKeyboardInputView () <UITextViewDelegate> @interface GodotKeyboardInputView () <UITextViewDelegate>

View File

@ -33,16 +33,18 @@
#ifdef IOS_ENABLED #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 "drivers/unix/os_unix.h"
#include "ios.h"
#include "joypad_ios.h"
#include "servers/audio_server.h" #include "servers/audio_server.h"
#include "servers/rendering/renderer_compositor.h" #include "servers/rendering/renderer_compositor.h"
#if defined(VULKAN_ENABLED) #if defined(VULKAN_ENABLED)
#import "vulkan_context_ios.h"
#include "drivers/vulkan/rendering_device_vulkan.h" #include "drivers/vulkan/rendering_device_vulkan.h"
#include "platform/ios/vulkan_context_ios.h"
#endif #endif
class OS_IOS : public OS_Unix { class OS_IOS : public OS_Unix {

View File

@ -28,20 +28,21 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/ /**************************************************************************/
#import "os_ios.h"
#ifdef IOS_ENABLED #ifdef IOS_ENABLED
#include "os_ios.h"
#import "app_delegate.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/config/project_settings.h"
#include "core/io/dir_access.h" #include "core/io/dir_access.h"
#include "core/io/file_access.h" #include "core/io/file_access.h"
#include "core/io/file_access_pack.h" #include "core/io/file_access_pack.h"
#include "display_server_ios.h"
#include "drivers/unix/syslog_logger.h" #include "drivers/unix/syslog_logger.h"
#import "godot_view.h"
#include "main/main.h" #include "main/main.h"
#import "view_controller.h"
#import <AudioToolbox/AudioServices.h> #import <AudioToolbox/AudioServices.h>
#import <CoreText/CoreText.h> #import <CoreText/CoreText.h>
@ -51,6 +52,7 @@
#if defined(VULKAN_ENABLED) #if defined(VULKAN_ENABLED)
#include "servers/rendering/renderer_rd/renderer_compositor_rd.h" #include "servers/rendering/renderer_rd/renderer_compositor_rd.h"
#import <QuartzCore/CAMetalLayer.h> #import <QuartzCore/CAMetalLayer.h>
#ifdef USE_VOLK #ifdef USE_VOLK
#include <volk.h> #include <volk.h>

View File

@ -31,18 +31,18 @@
#ifndef TTS_IOS_H #ifndef TTS_IOS_H
#define TTS_IOS_H #define TTS_IOS_H
#if __has_include(<AVFAudio/AVSpeechSynthesis.h>)
#import <AVFAudio/AVSpeechSynthesis.h>
#else
#import <AVFoundation/AVFoundation.h>
#endif
#include "core/string/ustring.h" #include "core/string/ustring.h"
#include "core/templates/hash_map.h" #include "core/templates/hash_map.h"
#include "core/templates/list.h" #include "core/templates/list.h"
#include "core/variant/array.h" #include "core/variant/array.h"
#include "servers/display_server.h" #include "servers/display_server.h"
#if __has_include(<AVFAudio/AVSpeechSynthesis.h>)
#import <AVFAudio/AVSpeechSynthesis.h>
#else
#import <AVFoundation/AVFoundation.h>
#endif
@interface TTS_IOS : NSObject <AVSpeechSynthesizerDelegate> { @interface TTS_IOS : NSObject <AVSpeechSynthesizerDelegate> {
bool speaking; bool speaking;
HashMap<id, int> ids; HashMap<id, int> ids;

View File

@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/ /**************************************************************************/
#include "tts_ios.h" #import "tts_ios.h"
@implementation TTS_IOS @implementation TTS_IOS

View File

@ -29,13 +29,15 @@
/**************************************************************************/ /**************************************************************************/
#import "view_controller.h" #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.h"
#import "godot_view_renderer.h" #import "godot_view_renderer.h"
#import "key_mapping_ios.h" #import "key_mapping_ios.h"
#import "keyboard_input_view.h" #import "keyboard_input_view.h"
#include "os_ios.h" #import "os_ios.h"
#include "core/config/project_settings.h"
#import <AVFoundation/AVFoundation.h> #import <AVFoundation/AVFoundation.h>
#import <GameController/GameController.h> #import <GameController/GameController.h>

View File

@ -28,9 +28,10 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/ /**************************************************************************/
#import "vulkan_context_ios.h"
#ifdef VULKAN_ENABLED #ifdef VULKAN_ENABLED
#include "vulkan_context_ios.h"
#ifdef USE_VOLK #ifdef USE_VOLK
#include <volk.h> #include <volk.h>
#else #else

View File

@ -30,9 +30,10 @@
#include "export.h" #include "export.h"
#include "editor/export/editor_export.h"
#include "export_plugin.h" #include "export_plugin.h"
#include "editor/export/editor_export.h"
void register_linuxbsd_exporter_types() { void register_linuxbsd_exporter_types() {
GDREGISTER_VIRTUAL_CLASS(EditorExportPlatformLinuxBSD); GDREGISTER_VIRTUAL_CLASS(EditorExportPlatformLinuxBSD);
} }

View File

@ -30,13 +30,14 @@
#include "export_plugin.h" #include "export_plugin.h"
#include "../logo_svg.gen.h"
#include "../run_icon_svg.gen.h"
#include "core/config/project_settings.h" #include "core/config/project_settings.h"
#include "editor/editor_node.h" #include "editor/editor_node.h"
#include "editor/editor_paths.h" #include "editor/editor_paths.h"
#include "editor/editor_scale.h" #include "editor/editor_scale.h"
#include "editor/export/editor_export.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. #include "modules/modules_enabled.gen.h" // For svg.
#ifdef MODULE_SVG_ENABLED #ifdef MODULE_SVG_ENABLED

View File

@ -35,6 +35,7 @@
#include "core/error/error_macros.h" #include "core/error/error_macros.h"
#include "core/os/os.h" #include "core/os/os.h"
#include "core/string/ustring.h" #include "core/string/ustring.h"
#include "core/variant/variant.h"
#ifdef SOWRAP_ENABLED #ifdef SOWRAP_ENABLED
#include "dbus-so_wrap.h" #include "dbus-so_wrap.h"
@ -42,8 +43,6 @@
#include <dbus/dbus.h> #include <dbus/dbus.h>
#endif #endif
#include "core/variant/variant.h"
#define BUS_OBJECT_NAME "org.freedesktop.portal.Desktop" #define BUS_OBJECT_NAME "org.freedesktop.portal.Desktop"
#define BUS_OBJECT_PATH "/org/freedesktop/portal/desktop" #define BUS_OBJECT_PATH "/org/freedesktop/portal/desktop"

View File

@ -28,6 +28,10 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/ /**************************************************************************/
#include "os_linuxbsd.h"
#include "main/main.h"
#include <limits.h> #include <limits.h>
#include <locale.h> #include <locale.h>
#include <stdlib.h> #include <stdlib.h>
@ -37,9 +41,6 @@
#include <sys/resource.h> #include <sys/resource.h>
#endif #endif
#include "main/main.h"
#include "os_linuxbsd.h"
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
#if defined(SANITIZERS_ENABLED) #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. // 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.

View File

@ -32,6 +32,7 @@
#define JOYPAD_LINUX_H #define JOYPAD_LINUX_H
#ifdef JOYDEV_ENABLED #ifdef JOYDEV_ENABLED
#include "core/input/input.h" #include "core/input/input.h"
#include "core/os/mutex.h" #include "core/os/mutex.h"
#include "core/os/thread.h" #include "core/os/thread.h"

View File

@ -35,17 +35,13 @@
#include "main/main.h" #include "main/main.h"
#include "servers/display_server.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 #ifdef X11_ENABLED
#include "x11/display_server_x11.h" #include "x11/display_server_x11.h"
#endif #endif
#ifdef HAVE_MNTENT #include "modules/modules_enabled.gen.h" // For regex.
#include <mntent.h> #ifdef MODULE_REGEX_ENABLED
#include "modules/regex/regex.h"
#endif #endif
#include <dlfcn.h> #include <dlfcn.h>
@ -57,6 +53,10 @@
#include <sys/utsname.h> #include <sys/utsname.h>
#include <unistd.h> #include <unistd.h>
#ifdef HAVE_MNTENT
#include <mntent.h>
#endif
void OS_LinuxBSD::alert(const String &p_alert, const String &p_title) { void OS_LinuxBSD::alert(const String &p_alert, const String &p_title) {
const char *message_programs[] = { "zenity", "kdialog", "Xdialog", "xmessage" }; const char *message_programs[] = { "zenity", "kdialog", "Xdialog", "xmessage" };

View File

@ -31,13 +31,14 @@
#ifndef OS_LINUXBSD_H #ifndef OS_LINUXBSD_H
#define OS_LINUXBSD_H #define OS_LINUXBSD_H
#include "core/input/input.h"
#include "crash_handler_linuxbsd.h" #include "crash_handler_linuxbsd.h"
#include "joypad_linux.h"
#include "core/input/input.h"
#include "drivers/alsa/audio_driver_alsa.h" #include "drivers/alsa/audio_driver_alsa.h"
#include "drivers/alsamidi/midi_driver_alsamidi.h" #include "drivers/alsamidi/midi_driver_alsamidi.h"
#include "drivers/pulseaudio/audio_driver_pulseaudio.h" #include "drivers/pulseaudio/audio_driver_pulseaudio.h"
#include "drivers/unix/os_unix.h" #include "drivers/unix/os_unix.h"
#include "joypad_linux.h"
#include "servers/audio_server.h" #include "servers/audio_server.h"
#ifdef FONTCONFIG_ENABLED #ifdef FONTCONFIG_ENABLED

View File

@ -28,29 +28,26 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/ /**************************************************************************/
#ifdef X11_ENABLED #if defined(X11_ENABLED) && defined(GLES3_ENABLED)
#if defined(GLES3_ENABLED)
#include "detect_prime_x11.h" #include "detect_prime_x11.h"
#include "core/string/print_string.h" #include "core/string/print_string.h"
#include "core/string/ustring.h" #include "core/string/ustring.h"
#include <stdlib.h>
#include "thirdparty/glad/glad/gl.h" #include "thirdparty/glad/glad/gl.h"
#include "thirdparty/glad/glad/glx.h" #include "thirdparty/glad/glad/glx.h"
#ifdef SOWRAP_ENABLED #ifdef SOWRAP_ENABLED
#include "dynwrappers/xlib-so_wrap.h" #include "x11/dynwrappers/xlib-so_wrap.h"
#else #else
#include <X11/XKBlib.h> #include <X11/XKBlib.h>
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
#endif #endif
#include <cstring> #include <stdlib.h>
#include <string.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <unistd.h> #include <unistd.h>
@ -265,5 +262,4 @@ int detect_prime() {
return preferred; return preferred;
} }
#endif #endif // X11_ENABLED && GLES3_ENABLED
#endif

View File

@ -32,12 +32,13 @@
#ifdef X11_ENABLED #ifdef X11_ENABLED
#include "x11/detect_prime_x11.h"
#include "x11/key_mapping_x11.h"
#include "core/config/project_settings.h" #include "core/config/project_settings.h"
#include "core/math/math_funcs.h" #include "core/math/math_funcs.h"
#include "core/string/print_string.h" #include "core/string/print_string.h"
#include "core/string/ustring.h" #include "core/string/ustring.h"
#include "detect_prime_x11.h"
#include "key_mapping_x11.h"
#include "main/main.h" #include "main/main.h"
#include "scene/resources/texture.h" #include "scene/resources/texture.h"
@ -58,6 +59,9 @@
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.h>
#undef CursorShape
#include <X11/XKBlib.h>
// ICCCM // ICCCM
#define WM_NormalState 1L // window normal state #define WM_NormalState 1L // window normal state
#define WM_IconicState 3L // window minimized #define WM_IconicState 3L // window minimized
@ -65,9 +69,6 @@
#define _NET_WM_STATE_REMOVE 0L // remove/unset property #define _NET_WM_STATE_REMOVE 0L // remove/unset property
#define _NET_WM_STATE_ADD 1L // add/set property #define _NET_WM_STATE_ADD 1L // add/set property
#undef CursorShape
#include <X11/XKBlib.h>
// 2.2 is the first release with multitouch // 2.2 is the first release with multitouch
#define XINPUT_CLIENT_VERSION_MAJOR 2 #define XINPUT_CLIENT_VERSION_MAJOR 2
#define XINPUT_CLIENT_VERSION_MINOR 2 #define XINPUT_CLIENT_VERSION_MINOR 2

View File

@ -33,7 +33,7 @@
#ifdef X11_ENABLED #ifdef X11_ENABLED
#include "servers/display_server.h" #include "joypad_linux.h"
#include "core/input/input.h" #include "core/input/input.h"
#include "core/os/mutex.h" #include "core/os/mutex.h"
@ -43,27 +43,28 @@
#include "drivers/alsamidi/midi_driver_alsamidi.h" #include "drivers/alsamidi/midi_driver_alsamidi.h"
#include "drivers/pulseaudio/audio_driver_pulseaudio.h" #include "drivers/pulseaudio/audio_driver_pulseaudio.h"
#include "drivers/unix/os_unix.h" #include "drivers/unix/os_unix.h"
#include "joypad_linux.h"
#include "servers/audio_server.h" #include "servers/audio_server.h"
#include "servers/display_server.h"
#include "servers/rendering/renderer_compositor.h" #include "servers/rendering/renderer_compositor.h"
#include "servers/rendering_server.h" #include "servers/rendering_server.h"
#if defined(SPEECHD_ENABLED) #if defined(SPEECHD_ENABLED)
#include "../tts_linux.h" #include "tts_linux.h"
#endif #endif
#if defined(GLES3_ENABLED) #if defined(GLES3_ENABLED)
#include "gl_manager_x11.h" #include "x11/gl_manager_x11.h"
#endif #endif
#if defined(VULKAN_ENABLED) #if defined(VULKAN_ENABLED)
#include "x11/vulkan_context_x11.h"
#include "drivers/vulkan/rendering_device_vulkan.h" #include "drivers/vulkan/rendering_device_vulkan.h"
#include "vulkan_context_x11.h"
#endif #endif
#if defined(DBUS_ENABLED) #if defined(DBUS_ENABLED)
#include "../freedesktop_portal_desktop.h" #include "freedesktop_portal_desktop.h"
#include "../freedesktop_screensaver.h" #include "freedesktop_screensaver.h"
#endif #endif
#include <X11/Xatom.h> #include <X11/Xatom.h>
@ -72,16 +73,16 @@
#include <X11/keysym.h> #include <X11/keysym.h>
#ifdef SOWRAP_ENABLED #ifdef SOWRAP_ENABLED
#include "dynwrappers/xlib-so_wrap.h" #include "x11/dynwrappers/xlib-so_wrap.h"
#include "dynwrappers/xcursor-so_wrap.h" #include "x11/dynwrappers/xcursor-so_wrap.h"
#include "dynwrappers/xext-so_wrap.h" #include "x11/dynwrappers/xext-so_wrap.h"
#include "dynwrappers/xinerama-so_wrap.h" #include "x11/dynwrappers/xinerama-so_wrap.h"
#include "dynwrappers/xinput2-so_wrap.h" #include "x11/dynwrappers/xinput2-so_wrap.h"
#include "dynwrappers/xrandr-so_wrap.h" #include "x11/dynwrappers/xrandr-so_wrap.h"
#include "dynwrappers/xrender-so_wrap.h" #include "x11/dynwrappers/xrender-so_wrap.h"
#include "../xkbcommon-so_wrap.h" #include "xkbcommon-so_wrap.h"
#else #else
#include <X11/XKBlib.h> #include <X11/XKBlib.h>
#include <X11/Xlib.h> #include <X11/Xlib.h>
@ -521,6 +522,6 @@ public:
~DisplayServerX11(); ~DisplayServerX11();
}; };
#endif // X11 enabled #endif // X11_ENABLED
#endif // DISPLAY_SERVER_X11_H #endif // DISPLAY_SERVER_X11_H

View File

@ -30,15 +30,14 @@
#include "gl_manager_x11.h" #include "gl_manager_x11.h"
#ifdef X11_ENABLED #if defined(X11_ENABLED) && defined(GLES3_ENABLED)
#if defined(GLES3_ENABLED)
#include "thirdparty/glad/glad/glx.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include "thirdparty/glad/glad/glx.h"
#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 #define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091
#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 #define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092
@ -403,5 +402,4 @@ GLManager_X11::~GLManager_X11() {
release_current(); release_current();
} }
#endif #endif // X11_ENABLED && GLES3_ENABLED
#endif

View File

@ -31,12 +31,11 @@
#ifndef GL_MANAGER_X11_H #ifndef GL_MANAGER_X11_H
#define GL_MANAGER_X11_H #define GL_MANAGER_X11_H
#ifdef X11_ENABLED #if defined(X11_ENABLED) && defined(GLES3_ENABLED)
#ifdef GLES3_ENABLED
#include "core/os/os.h" #include "core/os/os.h"
#include "core/templates/local_vector.h" #include "core/templates/local_vector.h"
#include "servers/display_server.h"
#ifdef SOWRAP_ENABLED #ifdef SOWRAP_ENABLED
#include "dynwrappers/xlib-so_wrap.h" #include "dynwrappers/xlib-so_wrap.h"
@ -53,8 +52,6 @@
#include <X11/extensions/shape.h> #include <X11/extensions/shape.h>
#endif #endif
#include "servers/display_server.h"
struct GLManager_X11_Private; struct GLManager_X11_Private;
class GLManager_X11 { class GLManager_X11 {
@ -136,7 +133,6 @@ public:
~GLManager_X11(); ~GLManager_X11();
}; };
#endif // GLES3_ENABLED #endif // X11_ENABLED && GLES3_ENABLED
#endif // X11_ENABLED
#endif // GL_MANAGER_X11_H #endif // GL_MANAGER_X11_H

View File

@ -31,16 +31,17 @@
#ifndef KEY_MAPPING_X11_H #ifndef KEY_MAPPING_X11_H
#define KEY_MAPPING_X11_H #define KEY_MAPPING_X11_H
#include "core/os/keyboard.h"
#include "core/templates/hash_map.h"
#include <X11/XF86keysym.h> #include <X11/XF86keysym.h>
#include <X11/Xlib.h> #include <X11/Xlib.h>
#define XK_MISCELLANY #define XK_MISCELLANY
#define XK_LATIN1 #define XK_LATIN1
#define XK_XKB_KEYS #define XK_XKB_KEYS
#include <X11/keysymdef.h> #include <X11/keysymdef.h>
#include "core/os/keyboard.h"
#include "core/templates/hash_map.h"
class KeyMappingX11 { class KeyMappingX11 {
struct HashMapHasherKeys { struct HashMapHasherKeys {
static _FORCE_INLINE_ uint32_t hash(const Key p_key) { return hash_fmix32(static_cast<uint32_t>(p_key)); } static _FORCE_INLINE_ uint32_t hash(const Key p_key) { return hash_fmix32(static_cast<uint32_t>(p_key)); }

View File

@ -34,6 +34,7 @@
#ifdef VULKAN_ENABLED #ifdef VULKAN_ENABLED
#include "drivers/vulkan/vulkan_context.h" #include "drivers/vulkan/vulkan_context.h"
#include <X11/Xlib.h> #include <X11/Xlib.h>
class VulkanContextX11 : public VulkanContext { class VulkanContextX11 : public VulkanContext {

View File

@ -31,8 +31,6 @@
#ifndef DISPLAY_SERVER_MACOS_H #ifndef DISPLAY_SERVER_MACOS_H
#define DISPLAY_SERVER_MACOS_H #define DISPLAY_SERVER_MACOS_H
#define BitMap _QDBitMap // Suppress deprecated QuickDraw definition.
#include "core/input/input.h" #include "core/input/input.h"
#include "servers/display_server.h" #include "servers/display_server.h"
@ -41,10 +39,13 @@
#endif // GLES3_ENABLED #endif // GLES3_ENABLED
#if defined(VULKAN_ENABLED) #if defined(VULKAN_ENABLED)
#include "vulkan_context_macos.h"
#include "drivers/vulkan/rendering_device_vulkan.h" #include "drivers/vulkan/rendering_device_vulkan.h"
#include "platform/macos/vulkan_context_macos.h"
#endif // VULKAN_ENABLED #endif // VULKAN_ENABLED
#define BitMap _QDBitMap // Suppress deprecated QuickDraw definition.
#import <AppKit/AppKit.h> #import <AppKit/AppKit.h>
#import <AppKit/NSCursor.h> #import <AppKit/NSCursor.h>
#import <ApplicationServices/ApplicationServices.h> #import <ApplicationServices/ApplicationServices.h>

View File

@ -38,7 +38,6 @@
#include "godot_window_delegate.h" #include "godot_window_delegate.h"
#include "key_mapping_macos.h" #include "key_mapping_macos.h"
#include "os_macos.h" #include "os_macos.h"
#include "tts_macos.h" #include "tts_macos.h"
#include "core/config/project_settings.h" #include "core/config/project_settings.h"
@ -48,13 +47,6 @@
#include "main/main.h" #include "main/main.h"
#include "scene/resources/texture.h" #include "scene/resources/texture.h"
#import <Carbon/Carbon.h>
#import <Cocoa/Cocoa.h>
#import <IOKit/IOCFPlugIn.h>
#import <IOKit/IOKitLib.h>
#import <IOKit/hid/IOHIDKeys.h>
#import <IOKit/hid/IOHIDLib.h>
#if defined(GLES3_ENABLED) #if defined(GLES3_ENABLED)
#include "drivers/gles3/rasterizer_gles3.h" #include "drivers/gles3/rasterizer_gles3.h"
#endif #endif
@ -63,6 +55,13 @@
#include "servers/rendering/renderer_rd/renderer_compositor_rd.h" #include "servers/rendering/renderer_rd/renderer_compositor_rd.h"
#endif #endif
#import <Carbon/Carbon.h>
#import <Cocoa/Cocoa.h>
#import <IOKit/IOCFPlugIn.h>
#import <IOKit/IOKitLib.h>
#import <IOKit/hid/IOHIDKeys.h>
#import <IOKit/hid/IOHIDLib.h>
const NSMenu *DisplayServerMacOS::_get_menu_root(const String &p_menu_root) const { const NSMenu *DisplayServerMacOS::_get_menu_root(const String &p_menu_root) const {
const NSMenu *menu = nullptr; const NSMenu *menu = nullptr;
if (p_menu_root == "" || p_menu_root.to_lower() == "_main") { if (p_menu_root == "" || p_menu_root.to_lower() == "_main") {

View File

@ -41,6 +41,8 @@
// - Requirements code generator is not implemented (only hard-coded requirements for the ad-hoc signing is supported). // - 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. // - RFC5652/CMS blob generation is not implemented, supports ad-hoc signing only.
#include "plist.h"
#include "core/crypto/crypto_core.h" #include "core/crypto/crypto_core.h"
#include "core/io/dir_access.h" #include "core/io/dir_access.h"
#include "core/io/file_access.h" #include "core/io/file_access.h"
@ -51,8 +53,6 @@
#include "modules/regex/regex.h" #include "modules/regex/regex.h"
#endif #endif
#include "plist.h"
#ifdef MODULE_REGEX_ENABLED #ifdef MODULE_REGEX_ENABLED
/*************************************************************************/ /*************************************************************************/

View File

@ -30,6 +30,8 @@
#include "export_plugin.h" #include "export_plugin.h"
#include "../logo_svg.gen.h"
#include "../run_icon_svg.gen.h"
#include "codesign.h" #include "codesign.h"
#include "lipo.h" #include "lipo.h"
#include "macho.h" #include "macho.h"
@ -39,8 +41,6 @@
#include "editor/editor_node.h" #include "editor/editor_node.h"
#include "editor/editor_paths.h" #include "editor/editor_paths.h"
#include "editor/editor_scale.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. #include "modules/modules_enabled.gen.h" // For svg and regex.
#ifdef MODULE_SVG_ENABLED #ifdef MODULE_SVG_ENABLED

View File

@ -33,11 +33,11 @@
// Universal / Universal 2 fat binary file creator and extractor. // Universal / Universal 2 fat binary file creator and extractor.
#include "macho.h"
#include "core/io/file_access.h" #include "core/io/file_access.h"
#include "core/object/ref_counted.h" #include "core/object/ref_counted.h"
#include "macho.h"
class LipO : public RefCounted { class LipO : public RefCounted {
struct FatArch { struct FatArch {
uint32_t cputype; uint32_t cputype;

View File

@ -33,9 +33,6 @@
#if defined(MACOS_ENABLED) && defined(GLES3_ENABLED) #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/error/error_list.h"
#include "core/os/os.h" #include "core/os/os.h"
#include "core/templates/local_vector.h" #include "core/templates/local_vector.h"
@ -45,6 +42,9 @@
#import <ApplicationServices/ApplicationServices.h> #import <ApplicationServices/ApplicationServices.h>
#import <CoreVideo/CoreVideo.h> #import <CoreVideo/CoreVideo.h>
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations" // OpenGL is deprecated in macOS 10.14
class GLManager_MacOS { class GLManager_MacOS {
public: public:
enum ContextType { enum ContextType {

View File

@ -30,15 +30,14 @@
#include "gl_manager_macos_legacy.h" #include "gl_manager_macos_legacy.h"
#ifdef MACOS_ENABLED #if defined(MACOS_ENABLED) && defined(GLES3_ENABLED)
#ifdef GLES3_ENABLED
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations" // OpenGL is deprecated in macOS 10.14
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations" // OpenGL is deprecated in macOS 10.14
Error GLManager_MacOS::create_context(GLWindow &win) { Error GLManager_MacOS::create_context(GLWindow &win) {
NSOpenGLPixelFormatAttribute attributes[] = { NSOpenGLPixelFormatAttribute attributes[] = {
NSOpenGLPFADoubleBuffer, NSOpenGLPFADoubleBuffer,
@ -237,5 +236,4 @@ GLManager_MacOS::~GLManager_MacOS() {
#pragma clang diagnostic pop #pragma clang diagnostic pop
#endif // GLES3_ENABLED #endif // MACOS_ENABLED && GLES3_ENABLED
#endif // MACOS_ENABLED

View File

@ -32,6 +32,7 @@
#include "display_server_macos.h" #include "display_server_macos.h"
#include "key_mapping_macos.h" #include "key_mapping_macos.h"
#include "main/main.h" #include "main/main.h"
@implementation GodotContentLayerDelegate @implementation GodotContentLayerDelegate

View File

@ -28,10 +28,10 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/ /**************************************************************************/
#include "main/main.h"
#include "os_macos.h" #include "os_macos.h"
#include "main/main.h"
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>

View File

@ -31,13 +31,13 @@
#ifndef JOYPAD_MACOS_H #ifndef JOYPAD_MACOS_H
#define JOYPAD_MACOS_H #define JOYPAD_MACOS_H
#include "core/input/input.h"
#import <ForceFeedback/ForceFeedback.h> #import <ForceFeedback/ForceFeedback.h>
#import <ForceFeedback/ForceFeedbackConstants.h> #import <ForceFeedback/ForceFeedbackConstants.h>
#import <IOKit/hid/IOHIDLib.h> #import <IOKit/hid/IOHIDLib.h>
#import <Kernel/IOKit/hidsystem/IOHIDUsageTables.h> #import <Kernel/IOKit/hidsystem/IOHIDUsageTables.h>
#include "core/input/input.h"
struct rec_element { struct rec_element {
IOHIDElementRef ref; IOHIDElementRef ref;
IOHIDElementCookie cookie; IOHIDElementCookie cookie;

View File

@ -30,12 +30,12 @@
#include "key_mapping_macos.h" #include "key_mapping_macos.h"
#import <Carbon/Carbon.h>
#import <Cocoa/Cocoa.h>
#include "core/templates/hash_map.h" #include "core/templates/hash_map.h"
#include "core/templates/hash_set.h" #include "core/templates/hash_set.h"
#import <Carbon/Carbon.h>
#import <Cocoa/Cocoa.h>
struct HashMapHasherKeys { struct HashMapHasherKeys {
static _FORCE_INLINE_ uint32_t hash(const Key p_key) { return hash_fmix32(static_cast<uint32_t>(p_key)); } static _FORCE_INLINE_ uint32_t hash(const Key p_key) { return hash_fmix32(static_cast<uint32_t>(p_key)); }
static _FORCE_INLINE_ uint32_t hash(const char32_t p_uchar) { return hash_fmix32(p_uchar); } static _FORCE_INLINE_ uint32_t hash(const char32_t p_uchar) { return hash_fmix32(p_uchar); }

View File

@ -31,12 +31,13 @@
#ifndef OS_MACOS_H #ifndef OS_MACOS_H
#define OS_MACOS_H #define OS_MACOS_H
#include "core/input/input.h"
#include "crash_handler_macos.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 "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" #include "servers/audio_server.h"
class OS_MacOS : public OS_Unix { class OS_MacOS : public OS_Unix {

View File

@ -30,16 +30,16 @@
#include "os_macos.h" #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 "dir_access_macos.h"
#include "display_server_macos.h" #include "display_server_macos.h"
#include "godot_application.h" #include "godot_application.h"
#include "godot_application_delegate.h" #include "godot_application_delegate.h"
#include "macos_terminal_logger.h" #include "macos_terminal_logger.h"
#include "core/crypto/crypto_core.h"
#include "core/version_generated.gen.h"
#include "main/main.h"
#include <dlfcn.h> #include <dlfcn.h>
#include <libproc.h> #include <libproc.h>
#include <mach-o/dyld.h> #include <mach-o/dyld.h>

View File

@ -34,6 +34,7 @@
#ifdef VULKAN_ENABLED #ifdef VULKAN_ENABLED
#include "drivers/vulkan/vulkan_context.h" #include "drivers/vulkan/vulkan_context.h"
#import <AppKit/AppKit.h> #import <AppKit/AppKit.h>
class VulkanContextMacOS : public VulkanContext { class VulkanContextMacOS : public VulkanContext {

View File

@ -28,8 +28,10 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/ /**************************************************************************/
#ifdef VULKAN_ENABLED
#include "vulkan_context_macos.h" #include "vulkan_context_macos.h"
#ifdef VULKAN_ENABLED
#ifdef USE_VOLK #ifdef USE_VOLK
#include <volk.h> #include <volk.h>
#else #else

View File

@ -28,17 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* 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 "app_uwp.h"
#include "core/io/dir_access.h" #include "core/io/dir_access.h"
#include "core/io/file_access.h" #include "core/io/file_access.h"
#include "core/os/keyboard.h" #include "core/os/keyboard.h"
#include "main/main.h" #include "main/main.h"
#include "platform/windows/key_mapping_windows.h" #include "platform/windows/key_mapping_windows.h"
#include <collection.h> #include <collection.h>

View File

@ -31,13 +31,12 @@
#ifndef APP_UWP_H #ifndef APP_UWP_H
#define APP_UWP_H #define APP_UWP_H
#include <string>
#include <wrl.h>
#include "GLES2/gl2.h"
#include "os_uwp.h" #include "os_uwp.h"
#include <GLES2/gl2.h>
#include <wrl.h>
#include <string>
/** clang-format does not play nice with this C++/CX hybrid, needs investigation. */ /** clang-format does not play nice with this C++/CX hybrid, needs investigation. */
/* clang-format off */ /* clang-format off */

View File

@ -30,7 +30,7 @@
#include "context_egl_uwp.h" #include "context_egl_uwp.h"
#include "EGL/eglext.h" #include <EGL/eglext.h>
using Platform::Exception; using Platform::Exception;

View File

@ -31,13 +31,12 @@
#ifndef CONTEXT_EGL_UWP_H #ifndef CONTEXT_EGL_UWP_H
#define CONTEXT_EGL_UWP_H #define CONTEXT_EGL_UWP_H
#include <wrl.h>
#include <EGL/egl.h>
#include "core/error/error_list.h" #include "core/error/error_list.h"
#include "core/os/os.h" #include "core/os/os.h"
#include <EGL/egl.h>
#include <wrl.h>
using namespace Windows::UI::Core; using namespace Windows::UI::Core;
class ContextEGL_UWP { class ContextEGL_UWP {

View File

@ -30,9 +30,10 @@
#include "export.h" #include "export.h"
#include "export_plugin.h"
#include "editor/editor_settings.h" #include "editor/editor_settings.h"
#include "editor/export/editor_export.h" #include "editor/export/editor_export.h"
#include "export_plugin.h"
void register_uwp_exporter_types() { void register_uwp_exporter_types() {
// GDREGISTER_VIRTUAL_CLASS(EditorExportPlatformUWP); // GDREGISTER_VIRTUAL_CLASS(EditorExportPlatformUWP);

View File

@ -30,9 +30,10 @@
#include "export_plugin.h" #include "export_plugin.h"
#include "../logo_svg.gen.h"
#include "editor/editor_scale.h" #include "editor/editor_scale.h"
#include "editor/editor_settings.h" #include "editor/editor_settings.h"
#include "platform/uwp/logo_svg.gen.h"
#include "modules/modules_enabled.gen.h" // For svg and regex. #include "modules/modules_enabled.gen.h" // For svg and regex.
#ifdef MODULE_SVG_ENABLED #ifdef MODULE_SVG_ENABLED

View File

@ -31,6 +31,8 @@
#ifndef UWP_EXPORT_PLUGIN_H #ifndef UWP_EXPORT_PLUGIN_H
#define UWP_EXPORT_PLUGIN_H #define UWP_EXPORT_PLUGIN_H
#include "app_packager.h"
#include "core/config/project_settings.h" #include "core/config/project_settings.h"
#include "core/crypto/crypto_core.h" #include "core/crypto/crypto_core.h"
#include "core/io/dir_access.h" #include "core/io/dir_access.h"
@ -46,8 +48,6 @@
#include "thirdparty/minizip/unzip.h" #include "thirdparty/minizip/unzip.h"
#include "thirdparty/minizip/zip.h" #include "thirdparty/minizip/zip.h"
#include "app_packager.h"
#include <zlib.h> #include <zlib.h>
// Capabilities // Capabilities

View File

@ -32,12 +32,13 @@
#define OS_UWP_H #define OS_UWP_H
#include "context_egl_uwp.h" #include "context_egl_uwp.h"
#include "joypad_uwp.h"
#include "core/input/input.h" #include "core/input/input.h"
#include "core/math/transform_2d.h" #include "core/math/transform_2d.h"
#include "core/os/os.h" #include "core/os/os.h"
#include "core/string/ustring.h" #include "core/string/ustring.h"
#include "drivers/xaudio2/audio_driver_xaudio2.h" #include "drivers/xaudio2/audio_driver_xaudio2.h"
#include "joypad_uwp.h"
#include "servers/audio_server.h" #include "servers/audio_server.h"
#include "servers/rendering/renderer_compositor.h" #include "servers/rendering/renderer_compositor.h"
#include "servers/rendering_server.h" #include "servers/rendering_server.h"

View File

@ -29,10 +29,12 @@
/**************************************************************************/ /**************************************************************************/
#include "api.h" #include "api.h"
#include "core/config/engine.h"
#include "javascript_bridge_singleton.h" #include "javascript_bridge_singleton.h"
#include "web_tools_editor_plugin.h" #include "web_tools_editor_plugin.h"
#include "core/config/engine.h"
static JavaScriptBridge *javascript_bridge_singleton; static JavaScriptBridge *javascript_bridge_singleton;
void register_web_api() { void register_web_api() {
@ -78,6 +80,7 @@ void JavaScriptBridge::_bind_methods() {
} }
#if !defined(WEB_ENABLED) || !defined(JAVASCRIPT_EVAL_ENABLED) #if !defined(WEB_ENABLED) || !defined(JAVASCRIPT_EVAL_ENABLED)
Variant JavaScriptBridge::eval(const String &p_code, bool p_use_global_exec_context) { Variant JavaScriptBridge::eval(const String &p_code, bool p_use_global_exec_context) {
return Variant(); return Variant();
} }
@ -104,16 +107,23 @@ Variant JavaScriptBridge::_create_object_bind(const Variant **p_args, int p_argc
} }
return Ref<JavaScriptObject>(); return Ref<JavaScriptObject>();
} }
#endif #endif
#if !defined(WEB_ENABLED) #if !defined(WEB_ENABLED)
bool JavaScriptBridge::pwa_needs_update() const { bool JavaScriptBridge::pwa_needs_update() const {
return false; return false;
} }
Error JavaScriptBridge::pwa_update() { Error JavaScriptBridge::pwa_update() {
return ERR_UNAVAILABLE; return ERR_UNAVAILABLE;
} }
void JavaScriptBridge::force_fs_sync() { void JavaScriptBridge::force_fs_sync() {
} }
void JavaScriptBridge::download_buffer(Vector<uint8_t> p_arr, const String &p_name, const String &p_mime) { void JavaScriptBridge::download_buffer(Vector<uint8_t> p_arr, const String &p_name, const String &p_mime) {
} }
#endif #endif

View File

@ -28,9 +28,10 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/ /**************************************************************************/
#if defined(TOOLS_ENABLED) && defined(WEB_ENABLED)
#include "web_tools_editor_plugin.h" #include "web_tools_editor_plugin.h"
#if defined(TOOLS_ENABLED) && defined(WEB_ENABLED)
#include "core/config/engine.h" #include "core/config/engine.h"
#include "core/config/project_settings.h" #include "core/config/project_settings.h"
#include "core/io/dir_access.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(); cur = dir->get_next();
} }
} }
#endif
#endif // TOOLS_ENABLED && WEB_ENABLED

View File

@ -32,6 +32,7 @@
#define WEB_TOOLS_EDITOR_PLUGIN_H #define WEB_TOOLS_EDITOR_PLUGIN_H
#if defined(TOOLS_ENABLED) && defined(WEB_ENABLED) #if defined(TOOLS_ENABLED) && defined(WEB_ENABLED)
#include "core/io/zip_io.h" #include "core/io/zip_io.h"
#include "editor/editor_plugin.h" #include "editor/editor_plugin.h"
@ -48,11 +49,14 @@ public:
WebToolsEditorPlugin(); WebToolsEditorPlugin();
}; };
#else #else
class WebToolsEditorPlugin { class WebToolsEditorPlugin {
public: public:
static void initialize() {} static void initialize() {}
}; };
#endif
#endif // TOOLS_ENABLED && WEB_ENABLED
#endif // WEB_TOOLS_EDITOR_PLUGIN_H #endif // WEB_TOOLS_EDITOR_PLUGIN_H

View File

@ -31,12 +31,12 @@
#ifndef AUDIO_DRIVER_WEB_H #ifndef AUDIO_DRIVER_WEB_H
#define AUDIO_DRIVER_WEB_H #define AUDIO_DRIVER_WEB_H
#include "godot_audio.h"
#include "core/os/mutex.h" #include "core/os/mutex.h"
#include "core/os/thread.h" #include "core/os/thread.h"
#include "servers/audio_server.h" #include "servers/audio_server.h"
#include "godot_audio.h"
class AudioDriverWeb : public AudioDriver { class AudioDriverWeb : public AudioDriver {
private: private:
struct AudioContext { struct AudioContext {

View File

@ -30,19 +30,20 @@
#include "display_server_web.h" #include "display_server_web.h"
#include "dom_keys.inc"
#include "godot_js.h"
#include "os_web.h"
#include "core/config/project_settings.h" #include "core/config/project_settings.h"
#include "servers/rendering/dummy/rasterizer_dummy.h"
#ifdef GLES3_ENABLED #ifdef GLES3_ENABLED
#include "drivers/gles3/rasterizer_gles3.h" #include "drivers/gles3/rasterizer_gles3.h"
#endif #endif
#include "platform/web/os_web.h"
#include "servers/rendering/dummy/rasterizer_dummy.h"
#include <emscripten.h> #include <emscripten.h>
#include <png.h> #include <png.h>
#include "dom_keys.inc"
#include "godot_js.h"
#define DOM_BUTTON_LEFT 0 #define DOM_BUTTON_LEFT 0
#define DOM_BUTTON_MIDDLE 1 #define DOM_BUTTON_MIDDLE 1
#define DOM_BUTTON_RIGHT 2 #define DOM_BUTTON_RIGHT 2

View File

@ -30,9 +30,10 @@
#include "export.h" #include "export.h"
#include "export_plugin.h"
#include "editor/editor_settings.h" #include "editor/editor_settings.h"
#include "editor/export/editor_export.h" #include "editor/export/editor_export.h"
#include "export_plugin.h"
void register_web_exporter_types() { void register_web_exporter_types() {
GDREGISTER_VIRTUAL_CLASS(EditorExportPlatformWeb); GDREGISTER_VIRTUAL_CLASS(EditorExportPlatformWeb);

View File

@ -30,12 +30,13 @@
#include "export_plugin.h" #include "export_plugin.h"
#include "../logo_svg.gen.h"
#include "../run_icon_svg.gen.h"
#include "core/config/project_settings.h" #include "core/config/project_settings.h"
#include "editor/editor_scale.h" #include "editor/editor_scale.h"
#include "editor/editor_settings.h" #include "editor/editor_settings.h"
#include "editor/export/editor_export.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. #include "modules/modules_enabled.gen.h" // For svg.
#ifdef MODULE_SVG_ENABLED #ifdef MODULE_SVG_ENABLED

View File

@ -31,6 +31,8 @@
#ifndef WEB_EXPORT_PLUGIN_H #ifndef WEB_EXPORT_PLUGIN_H
#define WEB_EXPORT_PLUGIN_H #define WEB_EXPORT_PLUGIN_H
#include "editor_http_server.h"
#include "core/config/project_settings.h" #include "core/config/project_settings.h"
#include "core/io/image_loader.h" #include "core/io/image_loader.h"
#include "core/io/stream_peer_tls.h" #include "core/io/stream_peer_tls.h"
@ -38,7 +40,6 @@
#include "core/io/zip_io.h" #include "core/io/zip_io.h"
#include "editor/editor_node.h" #include "editor/editor_node.h"
#include "editor/export/editor_export_platform.h" #include "editor/export/editor_export_platform.h"
#include "editor_http_server.h"
#include "main/splash.gen.h" #include "main/splash.gen.h"
class EditorExportPlatformWeb : public EditorExportPlatform { class EditorExportPlatformWeb : public EditorExportPlatform {

View File

@ -35,7 +35,8 @@
extern "C" { extern "C" {
#endif #endif
#include "stddef.h" #include <stddef.h>
#include <stdint.h>
extern int godot_audio_is_available(); extern int godot_audio_is_available();
extern int godot_audio_has_worklet(); extern int godot_audio_has_worklet();

View File

@ -35,7 +35,7 @@
extern "C" { extern "C" {
#endif #endif
#include "stddef.h" #include <stddef.h>
// Config // Config
extern void godot_js_config_locale_get(char *p_ptr, int p_ptr_max); extern void godot_js_config_locale_get(char *p_ptr, int p_ptr_max);

View File

@ -31,8 +31,8 @@
#ifndef GODOT_WEBGL2_H #ifndef GODOT_WEBGL2_H
#define GODOT_WEBGL2_H #define GODOT_WEBGL2_H
#include "GLES3/gl3.h" #include <GLES3/gl3.h>
#include "webgl/webgl2.h" #include <webgl/webgl2.h>
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR 0x9630 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR 0x9630
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR 0x9632 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR 0x9632

View File

@ -37,7 +37,7 @@
extern "C" { extern "C" {
#endif #endif
#include "stddef.h" #include <stddef.h>
typedef enum { typedef enum {
GODOT_JS_FETCH_STATE_REQUESTING = 0, GODOT_JS_FETCH_STATE_REQUESTING = 0,

View File

@ -30,9 +30,10 @@
#include "api/javascript_bridge_singleton.h" #include "api/javascript_bridge_singleton.h"
#include "emscripten.h"
#include "os_web.h" #include "os_web.h"
#include <emscripten.h>
extern "C" { 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); 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(); return Variant();
} }
} }
#endif // JAVASCRIPT_EVAL_ENABLED #endif // JAVASCRIPT_EVAL_ENABLED
void JavaScriptBridge::download_buffer(Vector<uint8_t> p_arr, const String &p_name, const String &p_mime) { void JavaScriptBridge::download_buffer(Vector<uint8_t> p_arr, const String &p_name, const String &p_mime) {

View File

@ -30,12 +30,15 @@
#include "os_web.h" #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/config/project_settings.h"
#include "core/debugger/engine_debugger.h" #include "core/debugger/engine_debugger.h"
#include "drivers/unix/dir_access_unix.h" #include "drivers/unix/dir_access_unix.h"
#include "drivers/unix/file_access_unix.h" #include "drivers/unix/file_access_unix.h"
#include "main/main.h" #include "main/main.h"
#include "platform/web/display_server_web.h"
#include "modules/modules_enabled.gen.h" // For websocket. #include "modules/modules_enabled.gen.h" // For websocket.
@ -43,9 +46,6 @@
#include <emscripten.h> #include <emscripten.h>
#include <stdlib.h> #include <stdlib.h>
#include "api/javascript_bridge_singleton.h"
#include "godot_js.h"
void OS_Web::alert(const String &p_alert, const String &p_title) { void OS_Web::alert(const String &p_alert, const String &p_title) {
godot_js_display_alert(p_alert.utf8().get_data()); godot_js_display_alert(p_alert.utf8().get_data());
} }

Some files were not shown because too many files have changed in this diff Show More