summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
Diffstat (limited to 'platform')
-rw-r--r--platform/bb10/bbutil.h6
-rw-r--r--platform/uwp/app.h72
-rw-r--r--platform/uwp/export/export.cpp21
-rw-r--r--platform/uwp/joypad_uwp.h4
-rw-r--r--platform/uwp/os_uwp.h3
-rw-r--r--platform/windows/joypad.cpp2
-rw-r--r--platform/x11/os_x11.cpp17
7 files changed, 69 insertions, 56 deletions
diff --git a/platform/bb10/bbutil.h b/platform/bb10/bbutil.h
index c2a4c5a7f5..77f4402fbd 100644
--- a/platform/bb10/bbutil.h
+++ b/platform/bb10/bbutil.h
@@ -13,7 +13,11 @@ extern "C" {
extern EGLDisplay egl_disp;
extern EGLSurface egl_surf;
-enum RENDERING_API {GL_ES_1 = EGL_OPENGL_ES_BIT, GL_ES_2 = EGL_OPENGL_ES2_BIT, VG = EGL_OPENVG_BIT};
+enum RENDERING_API {
+ GL_ES_1 = EGL_OPENGL_ES_BIT,
+ GL_ES_2 = EGL_OPENGL_ES2_BIT,
+ VG = EGL_OPENVG_BIT
+};
/**
* Initializes EGL, GL and loads a default font
diff --git a/platform/uwp/app.h b/platform/uwp/app.h
index 6df9c5699e..fd6fc950a7 100644
--- a/platform/uwp/app.h
+++ b/platform/uwp/app.h
@@ -32,38 +32,41 @@
#include <wrl.h>
-#include "os_uwp.h"
#include "GLES2/gl2.h"
+#include "os_uwp.h"
+
+/** clang-format does not play nice with this C++/CX hybrid, needs investigation. */
+/* clang-format off */
namespace GodotUWP
{
- ref class App sealed : public Windows::ApplicationModel::Core::IFrameworkView
- {
- public:
- App();
-
- // IFrameworkView Methods.
- virtual void Initialize(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView);
- virtual void SetWindow(Windows::UI::Core::CoreWindow^ window);
- virtual void Load(Platform::String^ entryPoint);
- virtual void Run();
- virtual void Uninitialize();
+ ref class App sealed : public Windows::ApplicationModel::Core::IFrameworkView
+ {
+ public:
+ App();
+
+ // IFrameworkView Methods.
+ virtual void Initialize(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView);
+ virtual void SetWindow(Windows::UI::Core::CoreWindow^ window);
+ virtual void Load(Platform::String^ entryPoint);
+ virtual void Run();
+ virtual void Uninitialize();
property Windows::Foundation::EventRegistrationToken MouseMovedToken {
- Windows::Foundation::EventRegistrationToken get() { return this->mouseMovedToken; }
- void set(Windows::Foundation::EventRegistrationToken p_token) { this->mouseMovedToken = p_token; }
- };
+ Windows::Foundation::EventRegistrationToken get() { return this->mouseMovedToken; }
+ void set(Windows::Foundation::EventRegistrationToken p_token) { this->mouseMovedToken = p_token; }
+ }
- private:
+ private:
void RecreateRenderer();
- // Application lifecycle event handlers.
- void OnActivated(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^ args);
+ // Application lifecycle event handlers.
+ void OnActivated(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^ args);
- // Window event handlers.
- void OnWindowSizeChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ args);
- void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args);
- void OnWindowClosed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CoreWindowEventArgs^ args);
+ // Window event handlers.
+ void OnWindowSizeChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ args);
+ void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args);
+ void OnWindowClosed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CoreWindowEventArgs^ args);
void pointer_event(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args, bool p_pressed, bool p_is_wheel = false);
void OnPointerPressed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
@@ -81,20 +84,20 @@ namespace GodotUWP
void OnKeyUp(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args);
void OnCharacterReceived(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CharacterReceivedEventArgs^ args);
- void UpdateWindowSize(Windows::Foundation::Size size);
- void InitializeEGL(Windows::UI::Core::CoreWindow^ window);
- void CleanupEGL();
+ void UpdateWindowSize(Windows::Foundation::Size size);
+ void InitializeEGL(Windows::UI::Core::CoreWindow^ window);
+ void CleanupEGL();
char** get_command_line(unsigned int* out_argc);
- bool mWindowClosed;
- bool mWindowVisible;
- GLsizei mWindowWidth;
- GLsizei mWindowHeight;
+ bool mWindowClosed;
+ bool mWindowVisible;
+ GLsizei mWindowWidth;
+ GLsizei mWindowHeight;
- EGLDisplay mEglDisplay;
- EGLContext mEglContext;
- EGLSurface mEglSurface;
+ EGLDisplay mEglDisplay;
+ EGLContext mEglContext;
+ EGLSurface mEglSurface;
CoreWindow^ window;
OSUWP* os;
@@ -103,6 +106,7 @@ namespace GodotUWP
int last_touch_y[32];
int number_of_contacts;
Windows::Foundation::Point last_mouse_pos;
- };
-
+ }
}
+
+/* clang-format on */
diff --git a/platform/uwp/export/export.cpp b/platform/uwp/export/export.cpp
index 4648384480..f31c91ef6d 100644
--- a/platform/uwp/export/export.cpp
+++ b/platform/uwp/export/export.cpp
@@ -618,9 +618,7 @@ void AppxPackager::make_content_types() {
types[ext] = content_type(ext);
- tmp_file->store_string("<Default Extension=\"" + ext +
- "\" ContentType=\""
- + types[ext] + "\" />");
+ tmp_file->store_string("<Default Extension=\"" + ext + "\" ContentType=\"" + types[ext] + "\" />");
}
// Appx signature file
@@ -1174,9 +1172,9 @@ Error AppxPackager::MakeIndirectDataContent(asn1::SPCIndirectDataContent &idc) {
MakeSPCInfoValue(*infoValue);
ASN1_TYPE* value =
- EncodedASN1::FromItem<asn1::SPCInfoValue,
- asn1::i2d_SPCInfoValue>(infoValue)
- .ToSequenceType();
+ EncodedASN1::FromItem<asn1::SPCInfoValue,
+ asn1::i2d_SPCInfoValue>(infoValue)
+ .ToSequenceType();
{
Vector<uint8_t> digest;
@@ -1202,8 +1200,10 @@ Error AppxPackager::add_attributes(PKCS7_SIGNER_INFO * p_signer_info) {
asn1::SPCSpOpusInfo* opus = asn1::SPCSpOpusInfo_new();
if (!opus) return openssl_error(ERR_peek_last_error());
- ASN1_STRING* opus_value = EncodedASN1::FromItem<asn1::SPCSpOpusInfo, asn1::i2d_SPCSpOpusInfo>(opus)
- .ToSequenceString();
+ ASN1_STRING* opus_value =
+ EncodedASN1::FromItem<asn1::SPCSpOpusInfo,
+ asn1::i2d_SPCSpOpusInfo>(opus)
+ .ToSequenceString();
if (!PKCS7_add_signed_attribute(
p_signer_info,
@@ -1237,8 +1237,9 @@ Error AppxPackager::add_attributes(PKCS7_SIGNER_INFO * p_signer_info) {
statement_type->type = OBJ_nid2obj(NID_ms_code_ind);
ASN1_STRING* statement_type_value =
- EncodedASN1::FromItem<asn1::SPCStatementType, asn1::i2d_SPCStatementType>(statement_type)
- .ToSequenceString();
+ EncodedASN1::FromItem<asn1::SPCStatementType,
+ asn1::i2d_SPCStatementType>(statement_type)
+ .ToSequenceString();
if (!PKCS7_add_signed_attribute(
p_signer_info,
diff --git a/platform/uwp/joypad_uwp.h b/platform/uwp/joypad_uwp.h
index 90505b409a..5d81ac44c0 100644
--- a/platform/uwp/joypad_uwp.h
+++ b/platform/uwp/joypad_uwp.h
@@ -33,10 +33,12 @@
ref class JoypadUWP sealed {
+ /** clang-format breaks this, it does not understand this token. */
+ /* clang-format off */
internal:
-
void register_events();
uint32_t process_controllers(uint32_t p_last_id);
+ /* clang-format on */
JoypadUWP();
JoypadUWP(InputDefault* p_input);
diff --git a/platform/uwp/os_uwp.h b/platform/uwp/os_uwp.h
index 82376dd2f6..f9e050e7a3 100644
--- a/platform/uwp/os_uwp.h
+++ b/platform/uwp/os_uwp.h
@@ -157,9 +157,12 @@ private:
void on_magnetometer_reading_changed(Windows::Devices::Sensors::Magnetometer^ sender, Windows::Devices::Sensors::MagnetometerReadingChangedEventArgs^ args);
void on_gyroscope_reading_changed(Windows::Devices::Sensors::Gyrometer^ sender, Windows::Devices::Sensors::GyrometerReadingChangedEventArgs^ args);
+ /** clang-format breaks this, it does not understand this token. */
+ /* clang-format off */
internal:
ManagedType() { alert_close_handle = false; }
property OSUWP* os;
+ /* clang-format on */
};
ManagedType^ managed_object;
Windows::Devices::Sensors::Accelerometer^ accelerometer;
diff --git a/platform/windows/joypad.cpp b/platform/windows/joypad.cpp
index 6ea23ebb28..f2848268fc 100644
--- a/platform/windows/joypad.cpp
+++ b/platform/windows/joypad.cpp
@@ -249,7 +249,7 @@ BOOL CALLBACK JoypadWindows::enumCallback(const DIDEVICEINSTANCE* instance, void
JoypadWindows* self = (JoypadWindows*)pContext;
- if (self->is_xinput_device(&instance->guidProduct)) {;
+ if (self->is_xinput_device(&instance->guidProduct)) {
return DIENUM_CONTINUE;
}
self->setup_dinput_joypad(instance);
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index 6525af68d2..41746c2431 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -545,11 +545,10 @@ void OS_X11::set_mouse_mode(MouseMode p_mode) {
}
}
- if (XGrabPointer(x11_display, x11_window, True,
- ButtonPressMask | ButtonReleaseMask |
- PointerMotionMask, GrabModeAsync, GrabModeAsync,
- x11_window, None, CurrentTime) !=
- GrabSuccess) {
+ if (XGrabPointer(
+ x11_display, x11_window, True,
+ ButtonPressMask | ButtonReleaseMask | PointerMotionMask,
+ GrabModeAsync, GrabModeAsync, x11_window, None, CurrentTime) != GrabSuccess) {
ERR_PRINT("NO GRAB");
}
@@ -1290,10 +1289,10 @@ void OS_X11::process_xevents() {
minimized = false;
main_loop->notification(MainLoop::NOTIFICATION_WM_FOCUS_IN);
if (mouse_mode==MOUSE_MODE_CAPTURED) {
- XGrabPointer(x11_display, x11_window, True,
- ButtonPressMask | ButtonReleaseMask |
- PointerMotionMask, GrabModeAsync, GrabModeAsync,
- x11_window, None, CurrentTime);
+ XGrabPointer(
+ x11_display, x11_window, True,
+ ButtonPressMask | ButtonReleaseMask | PointerMotionMask,
+ GrabModeAsync, GrabModeAsync, x11_window, None, CurrentTime);
}
break;