diff options
Diffstat (limited to 'platform')
| -rw-r--r-- | platform/android/display_server_android.cpp | 11 | ||||
| -rw-r--r-- | platform/android/export/export_plugin.cpp | 7 | ||||
| -rw-r--r-- | platform/android/export/gradle_export_util.cpp | 3 | ||||
| -rw-r--r-- | platform/android/java/lib/src/org/godotengine/godot/Godot.java | 15 | ||||
| -rw-r--r-- | platform/android/java/lib/src/org/godotengine/godot/io/StorageScope.kt | 9 | ||||
| -rw-r--r-- | platform/ios/godot_ios.mm | 9 | ||||
| -rw-r--r-- | platform/ios/godot_view.mm | 6 | ||||
| -rw-r--r-- | platform/ios/ios.mm | 2 | ||||
| -rw-r--r-- | platform/ios/joypad_ios.mm | 6 | ||||
| -rw-r--r-- | platform/ios/main.m | 3 | ||||
| -rw-r--r-- | platform/ios/os_ios.mm | 2 | ||||
| -rw-r--r-- | platform/ios/view_controller.mm | 6 | ||||
| -rw-r--r-- | platform/linuxbsd/x11/display_server_x11.cpp | 6 | ||||
| -rw-r--r-- | platform/macos/detect.py | 2 | ||||
| -rw-r--r-- | platform/macos/display_server_macos.mm | 20 | ||||
| -rw-r--r-- | platform/macos/godot_main_macos.mm | 9 | ||||
| -rw-r--r-- | platform/macos/key_mapping_macos.mm | 2 | ||||
| -rw-r--r-- | platform/web/api/web_tools_editor_plugin.cpp | 2 | ||||
| -rw-r--r-- | platform/windows/display_server_windows.cpp | 3 |
19 files changed, 63 insertions, 60 deletions
diff --git a/platform/android/display_server_android.cpp b/platform/android/display_server_android.cpp index af4ba1255b..e07e0e1149 100644 --- a/platform/android/display_server_android.cpp +++ b/platform/android/display_server_android.cpp @@ -676,16 +676,19 @@ void DisplayServerAndroid::cursor_set_custom_image(const Ref<Resource> &p_cursor void DisplayServerAndroid::window_set_vsync_mode(DisplayServer::VSyncMode p_vsync_mode, WindowID p_window) { #if defined(VULKAN_ENABLED) - context_vulkan->set_vsync_mode(p_window, p_vsync_mode); + if (context_vulkan) { + context_vulkan->set_vsync_mode(p_window, p_vsync_mode); + } #endif } DisplayServer::VSyncMode DisplayServerAndroid::window_get_vsync_mode(WindowID p_window) const { #if defined(VULKAN_ENABLED) - return context_vulkan->get_vsync_mode(p_window); -#else - return DisplayServer::VSYNC_ENABLED; + if (context_vulkan) { + return context_vulkan->get_vsync_mode(p_window); + } #endif + return DisplayServer::VSYNC_ENABLED; } void DisplayServerAndroid::reset_swap_buffers_flag() { diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp index 641258a26c..a362b6370e 100644 --- a/platform/android/export/export_plugin.cpp +++ b/platform/android/export/export_plugin.cpp @@ -1066,8 +1066,13 @@ void EditorExportPlatformAndroid::_fix_manifest(const Ref<EditorExportPreset> &p if (_uses_vulkan()) { // Require vulkan hardware level 1 support feature_names.push_back("android.hardware.vulkan.level"); - feature_required_list.push_back(true); + feature_required_list.push_back(false); feature_versions.push_back(1); + + // Require vulkan version 1.0 + feature_names.push_back("android.hardware.vulkan.version"); + feature_required_list.push_back(true); + feature_versions.push_back(0x400003); // Encoded value for api version 1.0 } if (feature_names.size() > 0) { diff --git a/platform/android/export/gradle_export_util.cpp b/platform/android/export/gradle_export_util.cpp index 61f8c5574b..ba4487cc4d 100644 --- a/platform/android/export/gradle_export_util.cpp +++ b/platform/android/export/gradle_export_util.cpp @@ -275,7 +275,8 @@ String _get_xr_features_tag(const Ref<EditorExportPreset> &p_preset, bool p_uses } if (p_uses_vulkan) { - manifest_xr_features += " <uses-feature tools:node=\"replace\" android:name=\"android.hardware.vulkan.level\" android:required=\"true\" android:version=\"1\" />\n"; + manifest_xr_features += " <uses-feature tools:node=\"replace\" android:name=\"android.hardware.vulkan.level\" android:required=\"false\" android:version=\"1\" />\n"; + manifest_xr_features += " <uses-feature tools:node=\"replace\" android:name=\"android.hardware.vulkan.version\" android:required=\"true\" android:version=\"0x400003\" />\n"; } return manifest_xr_features; } diff --git a/platform/android/java/lib/src/org/godotengine/godot/Godot.java b/platform/android/java/lib/src/org/godotengine/godot/Godot.java index 9b65a52b70..e111bd18ca 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/Godot.java +++ b/platform/android/java/lib/src/org/godotengine/godot/Godot.java @@ -282,7 +282,8 @@ public class Godot extends Fragment implements SensorEventListener, IDownloaderC if (usesVulkan()) { if (!meetsVulkanRequirements(activity.getPackageManager())) { - Log.w(TAG, "Missing requirements for vulkan support!"); + alert(R.string.error_missing_vulkan_requirements_message, R.string.text_error_title, this::forceQuit); + return false; } mRenderView = new GodotVulkanRenderView(activity, this); } else { @@ -392,7 +393,17 @@ public class Godot extends Fragment implements SensorEventListener, IDownloaderC return false; } - return Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && packageManager.hasSystemFeature(PackageManager.FEATURE_VULKAN_HARDWARE_LEVEL, 1); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + if (!packageManager.hasSystemFeature(PackageManager.FEATURE_VULKAN_HARDWARE_LEVEL, 1)) { + // Optional requirements.. log as warning if missing + Log.w(TAG, "The vulkan hardware level does not meet the minimum requirement: 1"); + } + + // Check for api version 1.0 + return packageManager.hasSystemFeature(PackageManager.FEATURE_VULKAN_HARDWARE_VERSION, 0x400003); + } + + return false; } public void setKeepScreenOn(final boolean p_enabled) { diff --git a/platform/android/java/lib/src/org/godotengine/godot/io/StorageScope.kt b/platform/android/java/lib/src/org/godotengine/godot/io/StorageScope.kt index 833ab40af0..8ee3d5f48f 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/io/StorageScope.kt +++ b/platform/android/java/lib/src/org/godotengine/godot/io/StorageScope.kt @@ -76,6 +76,13 @@ internal enum class StorageScope { return UNKNOWN } + // If we have 'All Files Access' permission, we can access all directories without + // restriction. + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R + && Environment.isExternalStorageManager()) { + return APP + } + val canonicalPathFile = pathFile.canonicalPath if (internalAppDir != null && canonicalPathFile.startsWith(internalAppDir)) { @@ -90,7 +97,7 @@ internal enum class StorageScope { return APP } - var rootDir: String? = System.getenv("ANDROID_ROOT") + val rootDir: String? = System.getenv("ANDROID_ROOT") if (rootDir != null && canonicalPathFile.startsWith(rootDir)) { return APP } diff --git a/platform/ios/godot_ios.mm b/platform/ios/godot_ios.mm index dc6f7c82bd..b01e339211 100644 --- a/platform/ios/godot_ios.mm +++ b/platform/ios/godot_ios.mm @@ -83,14 +83,9 @@ int ios_main(int argc, char **argv) { char path[512]; memcpy(path, argv[0], len > sizeof(path) ? sizeof(path) : len); path[len] = 0; - printf("Path: %s\n", path); chdir(path); } - printf("godot_ios %s\n", argv[0]); - char cwd[512]; - getcwd(cwd, sizeof(cwd)); - printf("cwd %s\n", cwd); os = new OS_IOS(); // We must override main when testing is enabled @@ -104,10 +99,7 @@ int ios_main(int argc, char **argv) { argc = add_path(argc, fargv); argc = add_cmdline(argc, fargv); - printf("os created\n"); - Error err = Main::setup(fargv[0], argc - 1, &fargv[1], false); - printf("setup %i\n", err); if (err == ERR_HELP) { // Returned by --help and --version, so success. return 0; @@ -121,7 +113,6 @@ int ios_main(int argc, char **argv) { } void ios_finish() { - printf("ios_finish\n"); Main::cleanup(); delete os; } diff --git a/platform/ios/godot_view.mm b/platform/ios/godot_view.mm index 67e47092d8..ff04ea9838 100644 --- a/platform/ios/godot_view.mm +++ b/platform/ios/godot_view.mm @@ -173,7 +173,7 @@ static const float earth_gravity = 9.80665; self.isActive = NO; - printf("******** stop animation!\n"); + print_verbose("Stop animation!"); if (self.useCADisplayLink) { [self.displayLink invalidate]; @@ -193,7 +193,7 @@ static const float earth_gravity = 9.80665; self.isActive = YES; - printf("start animation!\n"); + print_verbose("Start animation!"); if (self.useCADisplayLink) { self.displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(drawView)]; @@ -213,7 +213,7 @@ static const float earth_gravity = 9.80665; - (void)drawView { if (!self.isActive) { - printf("draw view not active!\n"); + print_verbose("Draw view not active!"); return; } diff --git a/platform/ios/ios.mm b/platform/ios/ios.mm index d240891a5c..1065f5fd2a 100644 --- a/platform/ios/ios.mm +++ b/platform/ios/ios.mm @@ -173,7 +173,7 @@ String iOS::get_rate_url(int p_app_id) const { String ret = app_url_path.replace("APP_ID", String::num(p_app_id)); - printf("returning rate url %s\n", ret.utf8().get_data()); + print_verbose(vformat("Returning rate url %s", ret)); return ret; } diff --git a/platform/ios/joypad_ios.mm b/platform/ios/joypad_ios.mm index 9194b09ef6..421c82dfc4 100644 --- a/platform/ios/joypad_ios.mm +++ b/platform/ios/joypad_ios.mm @@ -150,7 +150,7 @@ void JoypadIOS::start_processing() { int joy_id = Input::get_singleton()->get_unused_joy_id(); if (joy_id == -1) { - printf("Couldn't retrieve new joy id\n"); + print_verbose("Couldn't retrieve new joy ID."); return; } @@ -174,12 +174,12 @@ void JoypadIOS::start_processing() { GCController *controller = (GCController *)notification.object; if (!controller) { - printf("Couldn't retrieve new controller\n"); + print_verbose("Couldn't retrieve new controller."); return; } if ([[self.connectedJoypads allKeysForObject:controller] count] > 0) { - printf("Controller is already registered\n"); + print_verbose("Controller is already registered."); } else if (!self.isProcessing) { [self.joypadsQueue addObject:controller]; } else { diff --git a/platform/ios/main.m b/platform/ios/main.m index 9ccc420c73..33b1034d98 100644 --- a/platform/ios/main.m +++ b/platform/ios/main.m @@ -42,15 +42,12 @@ int main(int argc, char *argv[]) { setenv("MVK_CONFIG_FULL_IMAGE_VIEW_SWIZZLE", "1", 1); #endif - printf("*********** main.m\n"); gargc = argc; gargv = argv; - printf("running app main\n"); @autoreleasepool { NSString *className = NSStringFromClass([GodotApplicalitionDelegate class]); UIApplicationMain(argc, argv, nil, className); } - printf("main done\n"); return 0; } diff --git a/platform/ios/os_ios.mm b/platform/ios/os_ios.mm index 4d2dd3c52c..b2f72c310f 100644 --- a/platform/ios/os_ios.mm +++ b/platform/ios/os_ios.mm @@ -302,7 +302,7 @@ Error OS_IOS::shell_open(String p_uri) { return ERR_CANT_OPEN; } - printf("opening url %s\n", p_uri.utf8().get_data()); + print_verbose(vformat("Opening URL %s", p_uri)); [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil]; diff --git a/platform/ios/view_controller.mm b/platform/ios/view_controller.mm index a5aba201d7..8709252623 100644 --- a/platform/ios/view_controller.mm +++ b/platform/ios/view_controller.mm @@ -150,7 +150,7 @@ - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; - printf("*********** did receive memory warning!\n"); + print_verbose("Did receive memory warning!"); } - (void)viewDidLoad { @@ -165,11 +165,11 @@ } - (void)observeKeyboard { - printf("******** setting up keyboard input view\n"); + print_verbose("Setting up keyboard input view."); self.keyboardView = [GodotKeyboardInputView new]; [self.view addSubview:self.keyboardView]; - printf("******** adding observer for keyboard show/hide\n"); + print_verbose("Adding observer for keyboard show/hide."); [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardOnScreen:) diff --git a/platform/linuxbsd/x11/display_server_x11.cpp b/platform/linuxbsd/x11/display_server_x11.cpp index e5f278cc19..8343370533 100644 --- a/platform/linuxbsd/x11/display_server_x11.cpp +++ b/platform/linuxbsd/x11/display_server_x11.cpp @@ -605,7 +605,7 @@ String DisplayServerX11::_clipboard_get_impl(Atom p_source, Window x11_window, A success = true; } } else { - printf("Failed to get selection data chunk.\n"); + print_verbose("Failed to get selection data chunk."); done = true; } @@ -632,7 +632,7 @@ String DisplayServerX11::_clipboard_get_impl(Atom p_source, Window x11_window, A if (result == Success) { ret.parse_utf8((const char *)data); } else { - printf("Failed to get selection data.\n"); + print_verbose("Failed to get selection data."); } if (data) { @@ -3343,7 +3343,7 @@ Atom DisplayServerX11::_process_selection_request_target(Atom p_target, Window p return p_property; } else { char *target_name = XGetAtomName(x11_display, p_target); - printf("Target '%s' not supported.\n", target_name); + print_verbose(vformat("Target '%s' not supported.", target_name)); if (target_name) { XFree(target_name); } diff --git a/platform/macos/detect.py b/platform/macos/detect.py index e3c1f17b8f..ae8749354e 100644 --- a/platform/macos/detect.py +++ b/platform/macos/detect.py @@ -144,7 +144,7 @@ def configure(env: "Environment"): env["CC"] = basecmd + "cc" env["CXX"] = basecmd + "c++" else: - # there aren't any ccache wrappers available for OS X cross-compile, + # there aren't any ccache wrappers available for macOS cross-compile, # to enable caching we need to prepend the path to the ccache binary env["CC"] = ccache_path + " " + basecmd + "cc" env["CXX"] = ccache_path + " " + basecmd + "c++" diff --git a/platform/macos/display_server_macos.mm b/platform/macos/display_server_macos.mm index bcbba74b41..322c3f85bf 100644 --- a/platform/macos/display_server_macos.mm +++ b/platform/macos/display_server_macos.mm @@ -130,7 +130,7 @@ DisplayServerMacOS::WindowID DisplayServerMacOS::_create_window(WindowMode p_mod wpos.x = CLAMP(wpos.x, srect.position.x, srect.position.x + srect.size.width - p_rect.size.width / 3); wpos.y = CLAMP(wpos.y, srect.position.y, srect.position.y + srect.size.height - p_rect.size.height / 3); } - // OS X native y-coordinate relative to _get_screens_origin() is negative, + // macOS native y-coordinate relative to _get_screens_origin() is negative, // Godot passes a positive value. wpos.y *= -1; wpos += _get_screens_origin(); @@ -329,7 +329,7 @@ Point2i DisplayServerMacOS::_get_screens_origin() const { // Returns the native top-left screen coordinate of the smallest rectangle // that encompasses all screens. Needed in get_screen_position(), // window_get_position, and window_set_position() - // to convert between OS X native screen coordinates and the ones expected by Godot. + // to convert between macOS native screen coordinates and the ones expected by Godot. if (displays_arrangement_dirty) { const_cast<DisplayServerMacOS *>(this)->_update_displays_arrangement(); @@ -342,7 +342,7 @@ Point2i DisplayServerMacOS::_get_native_screen_position(int p_screen) const { NSArray *screenArray = [NSScreen screens]; if ((NSUInteger)p_screen < [screenArray count]) { NSRect nsrect = [[screenArray objectAtIndex:p_screen] frame]; - // Return the top-left corner of the screen, for OS X the y starts at the bottom. + // Return the top-left corner of the screen, for macOS the y starts at the bottom. return Point2i(nsrect.origin.x, nsrect.origin.y + nsrect.size.height) * screen_get_max_scale(); } @@ -2127,7 +2127,7 @@ Point2i DisplayServerMacOS::screen_get_position(int p_screen) const { } Point2i position = _get_native_screen_position(p_screen) - _get_screens_origin(); - // OS X native y-coordinate relative to _get_screens_origin() is negative, + // macOS native y-coordinate relative to _get_screens_origin() is negative, // Godot expects a positive value. position.y *= -1; return position; @@ -2252,7 +2252,7 @@ Rect2i DisplayServerMacOS::screen_get_usable_rect(int p_screen) const { Color DisplayServerMacOS::screen_get_pixel(const Point2i &p_position) const { Point2i position = p_position; - // OS X native y-coordinate relative to _get_screens_origin() is negative, + // macOS native y-coordinate relative to _get_screens_origin() is negative, // Godot passes a positive value. position.y *= -1; position += _get_screens_origin(); @@ -2532,13 +2532,13 @@ Point2i DisplayServerMacOS::window_get_position(WindowID p_window) const { const NSRect nsrect = [wd.window_object convertRectToScreen:contentRect]; Point2i pos; - // Return the position of the top-left corner, for OS X the y starts at the bottom. + // Return the position of the top-left corner, for macOS the y starts at the bottom. const float scale = screen_get_max_scale(); pos.x = nsrect.origin.x; pos.y = (nsrect.origin.y + nsrect.size.height); pos *= scale; pos -= _get_screens_origin(); - // OS X native y-coordinate relative to _get_screens_origin() is negative, + // macOS native y-coordinate relative to _get_screens_origin() is negative, // Godot expects a positive value. pos.y *= -1; return pos; @@ -2553,13 +2553,13 @@ Point2i DisplayServerMacOS::window_get_position_with_decorations(WindowID p_wind const NSRect nsrect = [wd.window_object frame]; Point2i pos; - // Return the position of the top-left corner, for OS X the y starts at the bottom. + // Return the position of the top-left corner, for macOS the y starts at the bottom. const float scale = screen_get_max_scale(); pos.x = nsrect.origin.x; pos.y = (nsrect.origin.y + nsrect.size.height); pos *= scale; pos -= _get_screens_origin(); - // OS X native y-coordinate relative to _get_screens_origin() is negative, + // macOS native y-coordinate relative to _get_screens_origin() is negative, // Godot expects a positive value. pos.y *= -1; return pos; @@ -2576,7 +2576,7 @@ void DisplayServerMacOS::window_set_position(const Point2i &p_position, WindowID } Point2i position = p_position; - // OS X native y-coordinate relative to _get_screens_origin() is negative, + // macOS native y-coordinate relative to _get_screens_origin() is negative, // Godot passes a positive value. position.y *= -1; position += _get_screens_origin(); diff --git a/platform/macos/godot_main_macos.mm b/platform/macos/godot_main_macos.mm index 29125c29a9..e98ab08127 100644 --- a/platform/macos/godot_main_macos.mm +++ b/platform/macos/godot_main_macos.mm @@ -53,21 +53,12 @@ int main(int argc, char **argv) { int first_arg = 1; const char *dbg_arg = "-NSDocumentRevisionsDebugMode"; - printf("arguments\n"); for (int i = 0; i < argc; i++) { if (strcmp(dbg_arg, argv[i]) == 0) { first_arg = i + 2; } - printf("%i: %s\n", i, argv[i]); } -#ifdef DEBUG_ENABLED - // Lets report the path we made current after all that. - char cwd[4096]; - getcwd(cwd, 4096); - printf("Current path: %s\n", cwd); -#endif - OS_MacOS os; Error err; diff --git a/platform/macos/key_mapping_macos.mm b/platform/macos/key_mapping_macos.mm index c3f147e33f..7f64ebb734 100644 --- a/platform/macos/key_mapping_macos.mm +++ b/platform/macos/key_mapping_macos.mm @@ -327,7 +327,7 @@ bool KeyMappingMacOS::is_numpad_key(unsigned int p_key) { return numpad_keys.has(p_key); } -// Translates a OS X keycode to a Godot keycode. +// Translates a macOS keycode to a Godot keycode. Key KeyMappingMacOS::translate_key(unsigned int p_key) { const Key *key = keysym_map.getptr(p_key); if (key) { diff --git a/platform/web/api/web_tools_editor_plugin.cpp b/platform/web/api/web_tools_editor_plugin.cpp index 146a48db81..213204ff33 100644 --- a/platform/web/api/web_tools_editor_plugin.cpp +++ b/platform/web/api/web_tools_editor_plugin.cpp @@ -75,7 +75,7 @@ void WebToolsEditorPlugin::_download_zip() { const String project_name_safe = project_name.to_lower().replace(" ", "_"); const String datetime_safe = Time::get_singleton()->get_datetime_string_from_system(false, true).replace(" ", "_"); - const String output_name = OS::get_singleton()->get_safe_dir_name(vformat("%s_%s.zip")); + const String output_name = OS::get_singleton()->get_safe_dir_name(vformat("%s_%s.zip", project_name_safe, datetime_safe)); const String output_path = String("/tmp").path_join(output_name); zipFile zip = zipOpen2(output_path.utf8().get_data(), APPEND_STATUS_CREATE, nullptr, &io); diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp index 01aca246ca..388a799c1c 100644 --- a/platform/windows/display_server_windows.cpp +++ b/platform/windows/display_server_windows.cpp @@ -3439,9 +3439,6 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA gr_mem = alt_mem; } } - if (wParam == VK_LWIN || wParam == VK_RWIN) { - meta_mem = (uMsg == WM_KEYDOWN || uMsg == WM_SYSKEYDOWN); - } if (windows[window_id].ime_suppress_next_keyup && (uMsg == WM_KEYUP || uMsg == WM_SYSKEYUP)) { windows[window_id].ime_suppress_next_keyup = false; |
