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 --- editor/export/editor_export_platform.cpp | 2 +- editor/export/editor_export_platform.h | 6 +++--- editor/export/editor_export_platform_pc.cpp | 4 ++-- editor/export/editor_export_platform_pc.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'editor') diff --git a/editor/export/editor_export_platform.cpp b/editor/export/editor_export_platform.cpp index 9f64b241c6..856196ce17 100644 --- a/editor/export/editor_export_platform.cpp +++ b/editor/export/editor_export_platform.cpp @@ -428,7 +428,7 @@ void EditorExportPlatform::_edit_filter_list(HashSet &r_list, const Stri _edit_files_with_filter(da, filters, r_list, exclude); } -EditorExportPlatform::FeatureContainers EditorExportPlatform::get_feature_containers(const Ref &p_preset, bool p_debug) { +EditorExportPlatform::FeatureContainers EditorExportPlatform::get_feature_containers(const Ref &p_preset, bool p_debug) const { Ref platform = p_preset->get_platform(); List feature_list; platform->get_platform_features(&feature_list); diff --git a/editor/export/editor_export_platform.h b/editor/export/editor_export_platform.h index 2778a217b0..832a0cf846 100644 --- a/editor/export/editor_export_platform.h +++ b/editor/export/editor_export_platform.h @@ -110,14 +110,14 @@ protected: ~ExportNotifier(); }; - FeatureContainers get_feature_containers(const Ref &p_preset, bool p_debug); + FeatureContainers get_feature_containers(const Ref &p_preset, bool p_debug) const; bool exists_export_template(String template_file_name, String *err) const; String find_export_template(String template_file_name, String *err = nullptr) const; void gen_export_flags(Vector &r_flags, int p_flags); public: - virtual void get_preset_features(const Ref &p_preset, List *r_features) = 0; + virtual void get_preset_features(const Ref &p_preset, List *r_features) const = 0; struct ExportOption { PropertyInfo option; @@ -211,7 +211,7 @@ public: virtual Error export_project(const Ref &p_preset, bool p_debug, const String &p_path, int p_flags = 0) = 0; virtual Error export_pack(const Ref &p_preset, bool p_debug, const String &p_path, int p_flags = 0); virtual Error export_zip(const Ref &p_preset, bool p_debug, const String &p_path, int p_flags = 0); - virtual void get_platform_features(List *r_features) = 0; + virtual void get_platform_features(List *r_features) const = 0; virtual void resolve_platform_feature_priorities(const Ref &p_preset, HashSet &p_features) = 0; virtual String get_debug_protocol() const { return "tcp://"; } diff --git a/editor/export/editor_export_platform_pc.cpp b/editor/export/editor_export_platform_pc.cpp index 9d3146d9e8..665b618f18 100644 --- a/editor/export/editor_export_platform_pc.cpp +++ b/editor/export/editor_export_platform_pc.cpp @@ -32,7 +32,7 @@ #include "core/config/project_settings.h" -void EditorExportPlatformPC::get_preset_features(const Ref &p_preset, List *r_features) { +void EditorExportPlatformPC::get_preset_features(const Ref &p_preset, List *r_features) const { if (p_preset->get("texture_format/s3tc")) { r_features->push_back("s3tc"); } @@ -224,7 +224,7 @@ void EditorExportPlatformPC::set_logo(const Ref &p_logo) { logo = p_logo; } -void EditorExportPlatformPC::get_platform_features(List *r_features) { +void EditorExportPlatformPC::get_platform_features(List *r_features) const { r_features->push_back("pc"); //all pcs support "pc" r_features->push_back("s3tc"); //all pcs support "s3tc" compression r_features->push_back(get_os_name().to_lower()); //OS name is a feature diff --git a/editor/export/editor_export_platform_pc.h b/editor/export/editor_export_platform_pc.h index ae7d6f1082..bdb86e924a 100644 --- a/editor/export/editor_export_platform_pc.h +++ b/editor/export/editor_export_platform_pc.h @@ -44,7 +44,7 @@ private: int chmod_flags = -1; public: - 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; @@ -68,7 +68,7 @@ public: void set_logo(const Ref &p_logo); void add_platform_feature(const String &p_feature); - virtual void get_platform_features(List *r_features) override; + virtual void get_platform_features(List *r_features) const override; virtual void resolve_platform_feature_priorities(const Ref &p_preset, HashSet &p_features) override; int get_chmod_flags() const; -- 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 --- editor/export/editor_export_platform_pc.cpp | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'editor') diff --git a/editor/export/editor_export_platform_pc.cpp b/editor/export/editor_export_platform_pc.cpp index 665b618f18..5e0044f2ae 100644 --- a/editor/export/editor_export_platform_pc.cpp +++ b/editor/export/editor_export_platform_pc.cpp @@ -42,12 +42,9 @@ void EditorExportPlatformPC::get_preset_features(const Ref & if (p_preset->get("texture_format/etc2")) { r_features->push_back("etc2"); } - - if (p_preset->get("binary_format/64_bits")) { - r_features->push_back("64"); - } else { - r_features->push_back("32"); - } + // PC platforms only have one architecture per export, since + // we export a single executable instead of a bundle. + r_features->push_back(p_preset->get("binary_format/architecture")); } void EditorExportPlatformPC::get_export_options(List *r_options) { @@ -57,7 +54,6 @@ void EditorExportPlatformPC::get_export_options(List *r_options) { r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "debug/export_console_script", PROPERTY_HINT_ENUM, "No,Debug Only,Debug and Release"), 1)); - r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "binary_format/64_bits"), true)); r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "binary_format/embed_pck"), false)); r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/bptc"), false)); @@ -84,10 +80,9 @@ bool EditorExportPlatformPC::can_export(const Ref &p_preset, bool valid = false; // Look for export templates (first official, and if defined custom templates). - - bool use64 = p_preset->get("binary_format/64_bits"); - bool dvalid = exists_export_template(get_template_file_name("debug", use64 ? "x86_64" : "x86_32"), &err); - bool rvalid = exists_export_template(get_template_file_name("release", use64 ? "x86_64" : "x86_32"), &err); + String arch = p_preset->get("binary_format/architecture"); + bool dvalid = exists_export_template(get_template_file_name("debug", arch), &err); + bool rvalid = exists_export_template(get_template_file_name("release", arch), &err); if (p_preset->get("custom_template/debug") != "") { dvalid = FileAccess::exists(p_preset->get("custom_template/debug")); @@ -139,7 +134,7 @@ Error EditorExportPlatformPC::prepare_template(const Ref &p_ template_path = template_path.strip_edges(); if (template_path.is_empty()) { - template_path = find_export_template(get_template_file_name(p_debug ? "debug" : "release", p_preset->get("binary_format/64_bits") ? "x86_64" : "x86_32")); + template_path = find_export_template(get_template_file_name(p_debug ? "debug" : "release", p_preset->get("binary_format/architecture"))); } if (!template_path.is_empty() && !FileAccess::exists(template_path)) { @@ -171,7 +166,7 @@ Error EditorExportPlatformPC::export_project_data(const Ref int64_t embedded_size; Error err = save_pack(p_preset, p_debug, pck_path, &so_files, p_preset->get("binary_format/embed_pck"), &embedded_pos, &embedded_size); if (err == OK && p_preset->get("binary_format/embed_pck")) { - if (embedded_size >= 0x100000000 && !p_preset->get("binary_format/64_bits")) { + if (embedded_size >= 0x100000000 && String(p_preset->get("binary_format/architecture")).contains("32")) { add_message(EXPORT_MESSAGE_ERROR, TTR("PCK Embedding"), TTR("On 32-bit exports the embedded PCK cannot be bigger than 4 GiB.")); return ERR_INVALID_PARAMETER; } -- cgit v1.2.3