diff options
Diffstat (limited to 'platform/ios')
-rw-r--r-- | platform/ios/README.md | 2 | ||||
-rw-r--r-- | platform/ios/device_metrics.m | 242 | ||||
-rw-r--r-- | platform/ios/display_server_ios.mm | 25 | ||||
-rw-r--r-- | platform/ios/export/export_plugin.cpp | 39 | ||||
-rw-r--r-- | platform/ios/export/export_plugin.h | 1 | ||||
-rw-r--r-- | platform/ios/logo.png | bin | 1297 -> 0 bytes | |||
-rw-r--r-- | platform/ios/logo.svg | 1 |
7 files changed, 180 insertions, 130 deletions
diff --git a/platform/ios/README.md b/platform/ios/README.md index 82c275ad31..0e1d6802cb 100644 --- a/platform/ios/README.md +++ b/platform/ios/README.md @@ -8,7 +8,7 @@ project template used for packaging the iOS export templates. ## Documentation -- [Compiling for iOS](https://docs.godotengine.org/en/latest/development/compiling/compiling_for_ios.html) +- [Compiling for iOS](https://docs.godotengine.org/en/latest/contributing/development/compiling/compiling_for_ios.html) - Instructions on building this platform port from source. - [Exporting for iOS](https://docs.godotengine.org/en/latest/tutorials/export/exporting_for_ios.html) - Instructions on using the compiled export templates to export a project. diff --git a/platform/ios/device_metrics.m b/platform/ios/device_metrics.m index b51f45c602..d6f5ec8e42 100644 --- a/platform/ios/device_metrics.m +++ b/platform/ios/device_metrics.m @@ -35,117 +35,159 @@ + (NSDictionary *)dpiList { return @{ @[ - @"iPad1,1", - @"iPad2,1", - @"iPad2,2", - @"iPad2,3", - @"iPad2,4", + @"iPad1,1", // iPad 1th Gen + @"iPad1,2", // iPad 1th Gen (3G) + @"iPad2,1", // iPad 2nd Gen + @"iPad2,2", // iPad 2nd Gen (GSM) + @"iPad2,3", // iPad 2nd Gen (CDMA) + @"iPad2,4", // iPad 2nd Gen ] : @132, @[ - @"iPhone1,1", - @"iPhone1,2", - @"iPhone2,1", - @"iPad2,5", - @"iPad2,6", - @"iPad2,7", - @"iPod1,1", - @"iPod2,1", - @"iPod3,1", + @"iPhone1,1", // iPhone 1st Gen + @"iPhone1,2", // iPhone 3G + @"iPhone2,1", // iPhone 3GS + @"iPad2,5", // iPad mini + @"iPad2,6", // iPad mini (GSM+LTE) + @"iPad2,7", // iPad mini (CDMA+LTE) + @"iPod1,1", // iPod 1st Gen + @"iPod2,1", // iPod 2nd Gen + @"iPod3,1", // iPod 3rd Gen ] : @163, @[ - @"iPad3,1", - @"iPad3,2", - @"iPad3,3", - @"iPad3,4", - @"iPad3,5", - @"iPad3,6", - @"iPad4,1", - @"iPad4,2", - @"iPad4,3", - @"iPad5,3", - @"iPad5,4", - @"iPad6,3", - @"iPad6,4", - @"iPad6,7", - @"iPad6,8", - @"iPad6,11", - @"iPad6,12", - @"iPad7,1", - @"iPad7,2", - @"iPad7,3", - @"iPad7,4", - @"iPad7,5", - @"iPad7,6", - @"iPad7,11", - @"iPad7,12", - @"iPad8,1", - @"iPad8,2", - @"iPad8,3", - @"iPad8,4", - @"iPad8,5", - @"iPad8,6", - @"iPad8,7", - @"iPad8,8", - @"iPad8,9", - @"iPad8,10", - @"iPad8,11", - @"iPad8,12", - @"iPad11,3", - @"iPad11,4", + @"iPad3,1", // iPad 3rd Gen + @"iPad3,2", // iPad 3rd Gen (CDMA) + @"iPad3,3", // iPad 3rd Gen (GSM) + @"iPad3,4", // iPad 4th Gen + @"iPad3,5", // iPad 4th Gen (GSM+LTE) + @"iPad3,6", // iPad 4th Gen (CDMA+LTE) + @"iPad4,1", // iPad Air (WiFi) + @"iPad4,2", // iPad Air (GSM+CDMA) + @"iPad4,3", // iPad Air (China) + @"iPad4,7", // iPad mini 3 (WiFi) + @"iPad4,8", // iPad mini 3 (GSM+CDMA) + @"iPad4,9", // iPad Mini 3 (China) + @"iPad6,3", // iPad Pro (9.7 inch, WiFi) + @"iPad6,4", // iPad Pro (9.7 inch, WiFi+LTE) + @"iPad6,7", // iPad Pro (12.9 inch, WiFi) + @"iPad6,8", // iPad Pro (12.9 inch, WiFi+LTE) + @"iPad6,11", // iPad 5th Gen (2017) + @"iPad6,12", // iPad 5th Gen (2017) + @"iPad7,1", // iPad Pro 2nd Gen (WiFi) + @"iPad7,2", // iPad Pro 2nd Gen (WiFi+Cellular) + @"iPad7,3", // iPad Pro 10.5-inch 2nd Gen + @"iPad7,4", // iPad Pro 10.5-inch 2nd Gen + @"iPad7,5", // iPad 6th Gen (WiFi) + @"iPad7,6", // iPad 6th Gen (WiFi+Cellular) + @"iPad7,11", // iPad 7th Gen 10.2-inch (WiFi) + @"iPad7,12", // iPad 7th Gen 10.2-inch (WiFi+Cellular) + @"iPad8,1", // iPad Pro 11 inch 3rd Gen (WiFi) + @"iPad8,2", // iPad Pro 11 inch 3rd Gen (1TB, WiFi) + @"iPad8,3", // iPad Pro 11 inch 3rd Gen (WiFi+Cellular) + @"iPad8,4", // iPad Pro 11 inch 3rd Gen (1TB, WiFi+Cellular) + @"iPad8,5", // iPad Pro 12.9 inch 3rd Gen (WiFi) + @"iPad8,6", // iPad Pro 12.9 inch 3rd Gen (1TB, WiFi) + @"iPad8,7", // iPad Pro 12.9 inch 3rd Gen (WiFi+Cellular) + @"iPad8,8", // iPad Pro 12.9 inch 3rd Gen (1TB, WiFi+Cellular) + @"iPad8,9", // iPad Pro 11 inch 4th Gen (WiFi) + @"iPad8,10", // iPad Pro 11 inch 4th Gen (WiFi+Cellular) + @"iPad8,11", // iPad Pro 12.9 inch 4th Gen (WiFi) + @"iPad8,12", // iPad Pro 12.9 inch 4th Gen (WiFi+Cellular) + @"iPad11,3", // iPad Air 3rd Gen (WiFi) + @"iPad11,4", // iPad Air 3rd Gen + @"iPad11,6", // iPad 8th Gen (WiFi) + @"iPad11,7", // iPad 8th Gen (WiFi+Cellular) + @"iPad12,1", // iPad 9th Gen (WiFi) + @"iPad12,2", // iPad 9th Gen (WiFi+Cellular) + @"iPad13,1", // iPad Air 4th Gen (WiFi) + @"iPad13,2", // iPad Air 4th Gen (WiFi+Cellular) + @"iPad13,4", // iPad Pro 11 inch 5th Gen + @"iPad13,5", // iPad Pro 11 inch 5th Gen + @"iPad13,6", // iPad Pro 11 inch 5th Gen + @"iPad13,7", // iPad Pro 11 inch 5th Gen + @"iPad13,8", // iPad Pro 12.9 inch 5th Gen + @"iPad13,9", // iPad Pro 12.9 inch 5th Gen + @"iPad13,10", // iPad Pro 12.9 inch 5th Gen + @"iPad13,11", // iPad Pro 12.9 inch 5th Gen + @"iPad13,16", // iPad Air 5th Gen (WiFi) + @"iPad13,17", // iPad Air 5th Gen (WiFi+Cellular) + @"iPad13,18", // iPad 10th Gen + @"iPad13,19", // iPad 10th Gen + @"iPad14,3", // iPad Pro 11 inch 6th Gen + @"iPad14,4", // iPad Pro 11 inch 6th Gen + @"iPad14,5", // iPad Pro 12.9 inch 6th Gen + @"iPad14,6", // iPad Pro 12.9 inch 6th Gen ] : @264, @[ - @"iPhone3,1", - @"iPhone3,2", - @"iPhone3,3", - @"iPhone4,1", - @"iPhone5,1", - @"iPhone5,2", - @"iPhone5,3", - @"iPhone5,4", - @"iPhone6,1", - @"iPhone6,2", - @"iPhone7,2", - @"iPhone8,1", - @"iPhone8,4", - @"iPhone9,1", - @"iPhone9,3", - @"iPhone10,1", - @"iPhone10,4", - @"iPhone11,8", - @"iPhone12,1", - @"iPhone12,8", - @"iPad4,4", - @"iPad4,5", - @"iPad4,6", - @"iPad4,7", - @"iPad4,8", - @"iPad4,9", - @"iPad5,1", - @"iPad5,2", - @"iPad11,1", - @"iPad11,2", - @"iPod4,1", - @"iPod5,1", - @"iPod7,1", - @"iPod9,1", + @"iPhone3,1", // iPhone 4 + @"iPhone3,2", // iPhone 4 (GSM) + @"iPhone3,3", // iPhone 4 (CDMA) + @"iPhone4,1", // iPhone 4S + @"iPhone5,1", // iPhone 5 (GSM) + @"iPhone5,2", // iPhone 5 (GSM+CDMA) + @"iPhone5,3", // iPhone 5C (GSM) + @"iPhone5,4", // iPhone 5C (Global) + @"iPhone6,1", // iPhone 5S (GSM) + @"iPhone6,2", // iPhone 5S (Global) + @"iPhone7,2", // iPhone 6 + @"iPhone8,1", // iPhone 6s + @"iPhone8,4", // iPhone SE (GSM) + @"iPhone9,1", // iPhone 7 + @"iPhone9,3", // iPhone 7 + @"iPhone10,1", // iPhone 8 + @"iPhone10,4", // iPhone 8 + @"iPhone11,8", // iPhone XR + @"iPhone12,1", // iPhone 11 + @"iPhone12,8", // iPhone SE 2nd gen + @"iPhone14,6", // iPhone SE 3rd gen + @"iPad4,4", // iPad mini Retina (WiFi) + @"iPad4,5", // iPad mini Retina (GSM+CDMA) + @"iPad4,6", // iPad mini Retina (China) + @"iPad5,1", // iPad mini 4th Gen (WiFi) + @"iPad5,2", // iPad mini 4th Gen + @"iPad5,3", // iPad Air 2 (WiFi) + @"iPad5,4", // iPad Air 2 + @"iPad11,1", // iPad mini 5th Gen (WiFi) + @"iPad11,2", // iPad mini 5th Gen + @"iPad14,1", // iPad mini 6th Gen (WiFi) + @"iPad14,2", // iPad mini 6th Gen + @"iPod4,1", // iPod 4th Gen + @"iPod5,1", // iPod 5th Gen + @"iPod7,1", // iPod 6th Gen + @"iPod9,1", // iPod 7th Gen ] : @326, @[ - @"iPhone7,1", - @"iPhone8,2", - @"iPhone9,2", - @"iPhone9,4", - @"iPhone10,2", - @"iPhone10,5", + @"iPhone7,1", // iPhone 6 Plus + @"iPhone8,2", // iPhone 6s Plus + @"iPhone9,2", // iPhone 7 Plus + @"iPhone9,4", // iPhone 7 Plus + @"iPhone10,2", // iPhone 8 Plus + @"iPhone10,5", // iPhone 8 Plus ] : @401, @[ - @"iPhone10,3", - @"iPhone10,6", - @"iPhone11,2", - @"iPhone11,4", - @"iPhone11,6", - @"iPhone12,3", - @"iPhone12,5", + @"iPhone10,3", // iPhone X Global + @"iPhone10,6", // iPhone X GSM + @"iPhone11,2", // iPhone XS + @"iPhone11,4", // iPhone XS Max + @"iPhone11,6", // iPhone XS Max Global + @"iPhone12,3", // iPhone 11 Pro + @"iPhone12,5", // iPhone 11 Pro Max + @"iPhone13,4", // iPhone 12 Pro Max + @"iPhone14,3", // iPhone 13 Pro Max + @"iPhone14,8", // iPhone 14 Plus ] : @458, + @[ + @"iPhone13,2", // iPhone 12 + @"iPhone13,3", // iPhone 12 Pro + @"iPhone14,2", // iPhone 13 Pro + @"iPhone14,5", // iPhone 13 + @"iPhone14,7", // iPhone 14 + @"iPhone15,2", // iPhone 14 Pro + @"iPhone15,3", // iPhone 14 Pro Max + ] : @460, + @[ + @"iPhone13,1", // iPhone 12 Mini + @"iPhone14,4", // iPhone 13 Mini + ] : @476 }; } diff --git a/platform/ios/display_server_ios.mm b/platform/ios/display_server_ios.mm index bea88a7f9b..86ea602a98 100644 --- a/platform/ios/display_server_ios.mm +++ b/platform/ios/display_server_ios.mm @@ -56,16 +56,9 @@ DisplayServerIOS::DisplayServerIOS(const String &p_rendering_driver, WindowMode tts = [[TTS_IOS alloc] init]; #if defined(GLES3_ENABLED) - // FIXME: Add support for both OpenGL and Vulkan when OpenGL is implemented - // again, - // Note that we should be checking "opengl3" as the driver, might never enable this seeing OpenGL is deprecated on iOS - // We are hardcoding the rendering_driver to "vulkan" down below - if (rendering_driver == "opengl3") { bool gl_initialization_error = false; - // FIXME: Add Vulkan support via MoltenVK. Add fallback code back? - if (RasterizerGLES3::is_viable() == OK) { RasterizerGLES3::register_config(); RasterizerGLES3::make_current(); @@ -74,22 +67,10 @@ DisplayServerIOS::DisplayServerIOS(const String &p_rendering_driver, WindowMode } if (gl_initialization_error) { - OS::get_singleton()->alert("Your device does not support any of the supported OpenGL versions.", "Unable to initialize video driver"); - // return ERR_UNAVAILABLE; + OS::get_singleton()->alert( + "Your device seems not to support the required OpenGL ES 3.0 version.\n\n", + "Unable to initialize OpenGL video driver"); } - - // rendering_server = memnew(RenderingServerDefault); - // // FIXME: Reimplement threaded rendering - // if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) { - // rendering_server = memnew(RenderingServerWrapMT(rendering_server, - // false)); - // } - // rendering_server->init(); - // rendering_server->cursor_set_visible(false, 0); - - // reset this to what it should be, it will have been set to 0 after - // rendering_server->init() is called - // RasterizerStorageGLES3system_fbo = gl_view_base_fb; } #endif diff --git a/platform/ios/export/export_plugin.cpp b/platform/ios/export/export_plugin.cpp index 49b4852cbf..87b599bc81 100644 --- a/platform/ios/export/export_plugin.cpp +++ b/platform/ios/export/export_plugin.cpp @@ -32,6 +32,13 @@ #include "core/string/translation.h" #include "editor/editor_node.h" +#include "editor/editor_scale.h" +#include "platform/ios/logo_svg.gen.h" + +#include "modules/modules_enabled.gen.h" // For svg. +#ifdef MODULE_SVG_ENABLED +#include "modules/svg/image_loader_svg.h" +#endif void EditorExportPlatformIOS::get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features) const { // Vulkan and OpenGL ES 3.0 both mandate ETC2 support. @@ -1565,7 +1572,7 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p int ret = unzGoToFirstFile(src_pkg_zip); Vector<uint8_t> project_file_data; while (ret == UNZ_OK) { -#if defined(MACOS_ENABLED) || defined(X11_ENABLED) +#if defined(MACOS_ENABLED) || defined(LINUXBSD_ENABLED) bool is_execute = false; #endif @@ -1598,7 +1605,7 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p continue; //ignore! } found_library = true; -#if defined(MACOS_ENABLED) || defined(X11_ENABLED) +#if defined(MACOS_ENABLED) || defined(LINUXBSD_ENABLED) is_execute = true; #endif file = file.replace(library_to_use, binary_name + ".xcframework"); @@ -1641,7 +1648,7 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p f->store_buffer(data.ptr(), data.size()); } -#if defined(MACOS_ENABLED) || defined(X11_ENABLED) +#if defined(MACOS_ENABLED) || defined(LINUXBSD_ENABLED) if (is_execute) { // we need execute rights on this file chmod(file.utf8().get_data(), 0755); @@ -1799,7 +1806,10 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p ERR_FAIL_COND_V(dylibs_dir.is_null(), ERR_CANT_OPEN); CodesignData codesign_data(p_preset, p_debug); err = _walk_dir_recursive(dylibs_dir, _codesign, &codesign_data); - ERR_FAIL_COND_V(err, err); + if (err != OK) { + add_message(EXPORT_MESSAGE_ERROR, TTR("Code Signing"), TTR("Code signing failed, see editor log for details.")); + return err; + } } if (ep.step("Making .xcarchive", 3)) { @@ -1825,6 +1835,10 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p err = OS::get_singleton()->execute("xcodebuild", archive_args, &archive_str, nullptr, true); ERR_FAIL_COND_V(err, err); print_line("xcodebuild (.xcarchive):\n" + archive_str); + if (!archive_str.contains("** ARCHIVE SUCCEEDED **")) { + add_message(EXPORT_MESSAGE_ERROR, TTR("Xcode Build"), TTR("Xcode project build failed, see editor log for details.")); + return FAILED; + } if (ep.step("Making .ipa", 4)) { return ERR_SKIP; @@ -1841,9 +1855,14 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p String export_str; err = OS::get_singleton()->execute("xcodebuild", export_args, &export_str, nullptr, true); ERR_FAIL_COND_V(err, err); + print_line("xcodebuild (.ipa):\n" + export_str); + if (!export_str.contains("** EXPORT SUCCEEDED **")) { + add_message(EXPORT_MESSAGE_ERROR, TTR("Xcode Build"), TTR(".ipa export failed, see editor log for details.")); + return FAILED; + } #else - print_line(".ipa can only be built on macOS. Leaving Xcode project without building the package."); + add_message(EXPORT_MESSAGE_WARNING, TTR("Xcode Build"), TTR(".ipa can only be built on macOS. Leaving Xcode project without building the package.")); #endif return OK; @@ -1914,7 +1933,15 @@ bool EditorExportPlatformIOS::has_valid_project_configuration(const Ref<EditorEx } EditorExportPlatformIOS::EditorExportPlatformIOS() { - logo = ImageTexture::create_from_image(memnew(Image(_ios_logo))); +#ifdef MODULE_SVG_ENABLED + Ref<Image> img = memnew(Image); + const bool upsample = !Math::is_equal_approx(Math::round(EDSCALE), EDSCALE); + + ImageLoaderSVG img_loader; + img_loader.create_image_from_string(img, _ios_logo_svg, EDSCALE, upsample, false); + logo = ImageTexture::create_from_image(img); +#endif + plugins_changed.set(); #ifndef ANDROID_ENABLED check_for_changes_thread.start(_check_for_changes_poll_thread, this); diff --git a/platform/ios/export/export_plugin.h b/platform/ios/export/export_plugin.h index deadec4b43..628dae2e6f 100644 --- a/platform/ios/export/export_plugin.h +++ b/platform/ios/export/export_plugin.h @@ -43,7 +43,6 @@ #include "editor/editor_settings.h" #include "editor/export/editor_export_platform.h" #include "main/splash.gen.h" -#include "platform/ios/logo.gen.h" #include "string.h" #include "godot_plugin_config.h" diff --git a/platform/ios/logo.png b/platform/ios/logo.png Binary files differdeleted file mode 100644 index 966d8aa70a..0000000000 --- a/platform/ios/logo.png +++ /dev/null diff --git a/platform/ios/logo.svg b/platform/ios/logo.svg new file mode 100644 index 0000000000..47a72bcf49 --- /dev/null +++ b/platform/ios/logo.svg @@ -0,0 +1 @@ +<svg height="32" width="32" xmlns="http://www.w3.org/2000/svg"><path d="M1 23.27h2.504V12.61H1zm1.247-12.057c.784 0 1.398-.603 1.398-1.358 0-.764-.614-1.367-1.398-1.367-.774 0-1.388.603-1.388 1.367 0 .755.614 1.358 1.388 1.358zm9.594-2.695c-4.233 0-6.888 2.886-6.888 7.502s2.654 7.492 6.888 7.492c4.224 0 6.88-2.876 6.88-7.492s-2.656-7.502-6.88-7.502zm0 2.212c2.585 0 4.234 2.052 4.234 5.29 0 3.228-1.649 5.28-4.234 5.28-2.594 0-4.233-2.052-4.233-5.28 0-3.238 1.639-5.29 4.233-5.29zm7.936 8.458c.11 2.675 2.303 4.324 5.641 4.324 3.51 0 5.723-1.73 5.723-4.485 0-2.162-1.247-3.379-4.194-4.053l-1.67-.382c-1.78-.422-2.513-.985-2.513-1.95 0-1.208 1.106-2.012 2.745-2.012 1.66 0 2.796.814 2.916 2.172H30.9c-.06-2.554-2.172-4.284-5.37-4.284-3.158 0-5.4 1.74-5.4 4.314 0 2.072 1.267 3.36 3.942 3.973l1.88.442c1.83.433 2.575 1.036 2.575 2.082 0 1.207-1.217 2.072-2.967 2.072-1.77 0-3.107-.875-3.268-2.213h-2.514z" fill="#bfbfbf"/></svg> |