diff options
author | Stuart Carnie <stuart.carnie@gmail.com> | 2024-02-20 05:52:00 +1100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-08-20 11:55:21 +0200 |
commit | 41875d8aef8fc2e4f245a0be2697030116d62569 (patch) | |
tree | ced22c011dfaaf23151de826d5edd9e4c5d0f9d1 /platform | |
parent | 5ebfc8a6ba1dec27157f48fc49ede54ea6676720 (diff) | |
download | redot-engine-41875d8aef8fc2e4f245a0be2697030116d62569.tar.gz |
macOS/iOS: Fix various warnings when targeting newer SDKs
Diffstat (limited to 'platform')
-rw-r--r-- | platform/ios/godot_view.mm | 4 | ||||
-rw-r--r-- | platform/macos/display_server_macos.mm | 2 |
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)]; } } |