From e15a2ff1dbfbf86b8154a8ab3eda69367183d436 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Wed, 28 Feb 2024 23:38:29 +0200 Subject: [PATCH] [macOS] Fix some deprecation warnings. --- platform/macos/display_server_macos.mm | 2 +- platform/macos/godot_application.mm | 2 +- platform/macos/os_macos.mm | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/platform/macos/display_server_macos.mm b/platform/macos/display_server_macos.mm index b2014f284968..6e39afc29b51 100644 --- a/platform/macos/display_server_macos.mm +++ b/platform/macos/display_server_macos.mm @@ -2686,7 +2686,7 @@ return image; } NSBitmapImageRep *bitmap = [NSBitmapImageRep imageRepWithData:data]; - NSData *pngData = [bitmap representationUsingType:NSPNGFileType properties:@{}]; + NSData *pngData = [bitmap representationUsingType:NSBitmapImageFileTypePNG properties:@{}]; image.instantiate(); PNGDriverCommon::png_to_image((const uint8_t *)pngData.bytes, pngData.length, false, image); return image; diff --git a/platform/macos/godot_application.mm b/platform/macos/godot_application.mm index e3a744caa268..f5e1bb43bf00 100644 --- a/platform/macos/godot_application.mm +++ b/platform/macos/godot_application.mm @@ -100,7 +100,7 @@ - (void)mediaKeyEvent:(int)key state:(BOOL)state repeat:(BOOL)repeat { } - (void)sendEvent:(NSEvent *)event { - if ([event type] == NSSystemDefined && [event subtype] == 8) { + if ([event type] == NSEventTypeSystemDefined && [event subtype] == 8) { int keyCode = (([event data1] & 0xFFFF0000) >> 16); int keyFlags = ([event data1] & 0x0000FFFF); int keyState = (((keyFlags & 0xFF00) >> 8)) == 0xA; diff --git a/platform/macos/os_macos.mm b/platform/macos/os_macos.mm index 29f433a51cdc..c5c95c9a70a8 100644 --- a/platform/macos/os_macos.mm +++ b/platform/macos/os_macos.mm @@ -601,7 +601,9 @@ for (const String &arg : p_arguments) { [arguments addObject:[NSString stringWithUTF8String:arg.utf8().get_data()]]; } +#if defined(__x86_64__) if (@available(macOS 10.15, *)) { +#endif NSWorkspaceOpenConfiguration *configuration = [[NSWorkspaceOpenConfiguration alloc] init]; [configuration setArguments:arguments]; [configuration setCreatesNewApplicationInstance:YES]; @@ -630,6 +632,7 @@ } return err; +#if defined(__x86_64__) } else { Error err = ERR_TIMEOUT; NSError *error = nullptr; @@ -645,6 +648,7 @@ } return err; } +#endif } else { return OS_Unix::create_process(p_path, p_arguments, r_child_id, p_open_console); }