From a0072ba39fb19158564322ae3f4595512a0c34dc Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Wed, 27 Jul 2022 17:34:12 -0500 Subject: Make some editor export methods const --- platform/macos/export/export_plugin.cpp | 2 +- platform/macos/export/export_plugin.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'platform/macos/export') diff --git a/platform/macos/export/export_plugin.cpp b/platform/macos/export/export_plugin.cpp index fd0781ac50..209a3dee5b 100644 --- a/platform/macos/export/export_plugin.cpp +++ b/platform/macos/export/export_plugin.cpp @@ -37,7 +37,7 @@ #include "modules/modules_enabled.gen.h" // For regex. -void EditorExportPlatformMacOS::get_preset_features(const Ref &p_preset, List *r_features) { +void EditorExportPlatformMacOS::get_preset_features(const Ref &p_preset, List *r_features) const { if (p_preset->get("texture_format/s3tc")) { r_features->push_back("s3tc"); } diff --git a/platform/macos/export/export_plugin.h b/platform/macos/export/export_plugin.h index 4f4b17594c..21bc380d55 100644 --- a/platform/macos/export/export_plugin.h +++ b/platform/macos/export/export_plugin.h @@ -99,7 +99,7 @@ class EditorExportPlatformMacOS : public EditorExportPlatform { } protected: - virtual void get_preset_features(const Ref &p_preset, List *r_features) override; + virtual void get_preset_features(const Ref &p_preset, List *r_features) const override; virtual void get_export_options(List *r_options) override; virtual bool get_export_option_visibility(const String &p_option, const HashMap &p_options) const override; @@ -121,7 +121,7 @@ public: virtual bool can_export(const Ref &p_preset, String &r_error, bool &r_missing_templates) const override; - virtual void get_platform_features(List *r_features) override { + virtual void get_platform_features(List *r_features) const override { r_features->push_back("pc"); r_features->push_back("s3tc"); r_features->push_back("macos"); -- cgit v1.2.3 From 17c4cd6412e3491f33713c63e4d3cc80c959319f Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Wed, 27 Jul 2022 17:48:34 -0500 Subject: Update export dialog to handle many architectures --- platform/macos/export/export_plugin.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'platform/macos/export') diff --git a/platform/macos/export/export_plugin.cpp b/platform/macos/export/export_plugin.cpp index 209a3dee5b..9fd0db4f18 100644 --- a/platform/macos/export/export_plugin.cpp +++ b/platform/macos/export/export_plugin.cpp @@ -47,8 +47,7 @@ void EditorExportPlatformMacOS::get_preset_features(const Refget("texture_format/etc2")) { r_features->push_back("etc2"); } - - r_features->push_back("64"); + r_features->push_back(p_preset->get("binary_format/architecture")); } bool EditorExportPlatformMacOS::get_export_option_visibility(const String &p_option, const HashMap &p_options) const { @@ -69,6 +68,7 @@ bool EditorExportPlatformMacOS::get_export_option_visibility(const String &p_opt } void EditorExportPlatformMacOS::get_export_options(List *r_options) { + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "binary_format/architecture", PROPERTY_HINT_ENUM, "universal,x86_64,arm64", PROPERTY_USAGE_STORAGE), "universal")); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "custom_template/debug", PROPERTY_HINT_GLOBAL_FILE, "*.zip"), "")); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "custom_template/release", PROPERTY_HINT_GLOBAL_FILE, "*.zip"), "")); @@ -766,7 +766,8 @@ Error EditorExportPlatformMacOS::export_project(const Ref &p int ret = unzGoToFirstFile(src_pkg_zip); - String binary_to_use = "godot_macos_" + String(p_debug ? "debug" : "release") + ".universal"; + String architecture = p_preset->get("binary_format/architecture"); + String binary_to_use = "godot_macos_" + String(p_debug ? "debug" : "release") + "." + architecture; String pkg_name; if (String(ProjectSettings::get_singleton()->get("application/config/name")) != "") { @@ -1064,19 +1065,19 @@ Error EditorExportPlatformMacOS::export_project(const Ref &p } if (data.size() > 0) { - if (file.find("/data.mono.macos.release_debug.universal/") != -1) { + if (file.find("/data.mono.macos.release_debug." + architecture + "/") != -1) { if (!p_debug) { ret = unzGoToNextFile(src_pkg_zip); continue; // skip } - file = file.replace("/data.mono.macos.release_debug.universal/", "/GodotSharp/"); + file = file.replace("/data.mono.macos.release_debug." + architecture + "/", "/GodotSharp/"); } - if (file.find("/data.mono.macos.release.universal/") != -1) { + if (file.find("/data.mono.macos.release." + architecture + "/") != -1) { if (p_debug) { ret = unzGoToNextFile(src_pkg_zip); continue; // skip } - file = file.replace("/data.mono.macos.release.universal/", "/GodotSharp/"); + file = file.replace("/data.mono.macos.release." + architecture + "/", "/GodotSharp/"); } if (file.ends_with(".dylib")) { -- cgit v1.2.3