summaryrefslogtreecommitdiffstats
path: root/platform
diff options
context:
space:
mode:
authorStuart Carnie <stuart.carnie@gmail.com>2024-02-20 05:52:00 +1100
committerRémi Verschelde <rverschelde@gmail.com>2024-08-20 11:55:21 +0200
commit41875d8aef8fc2e4f245a0be2697030116d62569 (patch)
treeced22c011dfaaf23151de826d5edd9e4c5d0f9d1 /platform
parent5ebfc8a6ba1dec27157f48fc49ede54ea6676720 (diff)
downloadredot-engine-41875d8aef8fc2e4f245a0be2697030116d62569.tar.gz
macOS/iOS: Fix various warnings when targeting newer SDKs
Diffstat (limited to 'platform')
-rw-r--r--platform/ios/godot_view.mm4
-rw-r--r--platform/macos/display_server_macos.mm2
2 files changed, 5 insertions, 1 deletions
diff --git a/platform/ios/godot_view.mm b/platform/ios/godot_view.mm
index 1dddc9306e..e910036198 100644
--- a/platform/ios/godot_view.mm
+++ b/platform/ios/godot_view.mm
@@ -441,6 +441,9 @@ static const float earth_gravity = 9.80665;
UIInterfaceOrientation interfaceOrientation = UIInterfaceOrientationUnknown;
+#if __IPHONE_OS_VERSION_MAX_ALLOWED < 140000
+ interfaceOrientation = [[UIApplication sharedApplication] statusBarOrientation];
+#else
if (@available(iOS 13, *)) {
interfaceOrientation = [UIApplication sharedApplication].delegate.window.windowScene.interfaceOrientation;
#if !defined(TARGET_OS_SIMULATOR) || !TARGET_OS_SIMULATOR
@@ -448,6 +451,7 @@ static const float earth_gravity = 9.80665;
interfaceOrientation = [[UIApplication sharedApplication] statusBarOrientation];
#endif
}
+#endif
switch (interfaceOrientation) {
case UIInterfaceOrientationLandscapeLeft: {
diff --git a/platform/macos/display_server_macos.mm b/platform/macos/display_server_macos.mm
index cd2d8a60ac..b2243dd8d5 100644
--- a/platform/macos/display_server_macos.mm
+++ b/platform/macos/display_server_macos.mm
@@ -2332,7 +2332,7 @@ void DisplayServerMacOS::window_set_window_buttons_offset(const Vector2i &p_offs
wd.wb_offset = p_offset / scale;
wd.wb_offset = wd.wb_offset.maxi(12);
if (wd.window_button_view) {
- [wd.window_button_view setOffset:NSMakePoint(wd.wb_offset.x, wd.wb_offset.y)];
+ [(GodotButtonView *)wd.window_button_view setOffset:NSMakePoint(wd.wb_offset.x, wd.wb_offset.y)];
}
}