summaryrefslogtreecommitdiff
path: root/platform/uwp/export/export_plugin.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-07-30 11:22:25 +0200
committerGitHub <noreply@github.com>2022-07-30 11:22:25 +0200
commit3e5ad8213f8163cca25224a61797b89b86736b2f (patch)
tree34c68a210f4eaa946e9b78d0e114f88de12de99e /platform/uwp/export/export_plugin.cpp
parent162186cfe8b26fdb0f969b5066f176c40aacd01b (diff)
parent17c4cd6412e3491f33713c63e4d3cc80c959319f (diff)
Merge pull request #63563 from aaronfranke/export-arch
Diffstat (limited to 'platform/uwp/export/export_plugin.cpp')
-rw-r--r--platform/uwp/export/export_plugin.cpp67
1 files changed, 24 insertions, 43 deletions
diff --git a/platform/uwp/export/export_plugin.cpp b/platform/uwp/export/export_plugin.cpp
index 19b43d50be..a99776497b 100644
--- a/platform/uwp/export/export_plugin.cpp
+++ b/platform/uwp/export/export_plugin.cpp
@@ -49,27 +49,17 @@ Ref<Texture2D> EditorExportPlatformUWP::get_logo() const {
return logo;
}
-void EditorExportPlatformUWP::get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features) {
+void EditorExportPlatformUWP::get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features) const {
r_features->push_back("s3tc");
r_features->push_back("etc");
- switch ((int)p_preset->get("architecture/target")) {
- case EditorExportPlatformUWP::ARM: {
- r_features->push_back("arm");
- } break;
- case EditorExportPlatformUWP::X86: {
- r_features->push_back("32");
- } break;
- case EditorExportPlatformUWP::X64: {
- r_features->push_back("64");
- } break;
- }
+ r_features->push_back(p_preset->get("binary_format/architecture"));
}
void EditorExportPlatformUWP::get_export_options(List<ExportOption> *r_options) {
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"), ""));
- r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "architecture/target", PROPERTY_HINT_ENUM, "arm,x86,x64"), 1));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "binary_format/architecture", PROPERTY_HINT_ENUM, "x86_64,x86_32,arm32"), "x86_64"));
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "command_line/extra_args"), ""));
@@ -143,23 +133,18 @@ bool EditorExportPlatformUWP::can_export(const Ref<EditorExportPreset> &p_preset
bool valid = false;
// Look for export templates (first official, and if defined custom templates).
-
- Platform arch = (Platform)(int)(p_preset->get("architecture/target"));
- String platform_infix;
- switch (arch) {
- case EditorExportPlatformUWP::ARM: {
- platform_infix = "arm";
- } break;
- case EditorExportPlatformUWP::X86: {
- platform_infix = "x86";
- } break;
- case EditorExportPlatformUWP::X64: {
- platform_infix = "x64";
- } break;
+ String arch = p_preset->get("binary_format/architecture");
+ String arch_infix;
+ if (arch == "arm32") {
+ arch_infix = "arm";
+ } else if (arch == "x86_32") {
+ arch_infix = "x86";
+ } else if (arch == "x86_64") {
+ arch_infix = "x64";
}
- bool dvalid = exists_export_template("uwp_" + platform_infix + "_debug.zip", &err);
- bool rvalid = exists_export_template("uwp_" + platform_infix + "_release.zip", &err);
+ bool dvalid = exists_export_template("uwp_" + arch_infix + "_debug.zip", &err);
+ bool rvalid = exists_export_template("uwp_" + arch_infix + "_release.zip", &err);
if (p_preset->get("custom_template/debug") != "") {
dvalid = FileAccess::exists(p_preset->get("custom_template/debug"));
@@ -263,25 +248,21 @@ Error EditorExportPlatformUWP::export_project(const Ref<EditorExportPreset> &p_p
src_appx = src_appx.strip_edges();
- Platform arch = (Platform)(int)p_preset->get("architecture/target");
+ String arch = p_preset->get("binary_format/architecture");
if (src_appx.is_empty()) {
- String err, infix;
- switch (arch) {
- case ARM: {
- infix = "_arm_";
- } break;
- case X86: {
- infix = "_x86_";
- } break;
- case X64: {
- infix = "_x64_";
- } break;
+ String err, arch_infix;
+ if (arch == "arm32") {
+ arch_infix = "arm";
+ } else if (arch == "x86_32") {
+ arch_infix = "x86";
+ } else if (arch == "x86_64") {
+ arch_infix = "x64";
}
if (p_debug) {
- src_appx = find_export_template("uwp" + infix + "debug.zip", &err);
+ src_appx = find_export_template("uwp_" + arch_infix + "_debug.zip", &err);
} else {
- src_appx = find_export_template("uwp" + infix + "release.zip", &err);
+ src_appx = find_export_template("uwp_" + arch_infix + "_release.zip", &err);
}
if (src_appx.is_empty()) {
EditorNode::add_io_error(err);
@@ -494,7 +475,7 @@ Error EditorExportPlatformUWP::export_project(const Ref<EditorExportPreset> &p_p
return OK;
}
-void EditorExportPlatformUWP::get_platform_features(List<String> *r_features) {
+void EditorExportPlatformUWP::get_platform_features(List<String> *r_features) const {
r_features->push_back("pc");
r_features->push_back("uwp");
}