From a10b4bdb810592c222119dc6d63802ad8d87a7c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 14 Feb 2024 14:50:14 +0100 Subject: [PATCH] Export: Unify settings for PC texture formats S3TC and BPTC should always be used together, and likewise for ETC2 and ASTC. --- editor/export/editor_export_platform_pc.cpp | 27 +++++++++++-------- .../EditorExportPlatformLinuxBSD.xml | 11 +++----- .../EditorExportPlatformWindows.xml | 11 +++----- 3 files changed, 24 insertions(+), 25 deletions(-) diff --git a/editor/export/editor_export_platform_pc.cpp b/editor/export/editor_export_platform_pc.cpp index 613a1372ead..413db1595b3 100644 --- a/editor/export/editor_export_platform_pc.cpp +++ b/editor/export/editor_export_platform_pc.cpp @@ -34,14 +34,13 @@ #include "scene/resources/image_texture.h" void EditorExportPlatformPC::get_preset_features(const Ref &p_preset, List *r_features) const { - if (p_preset->get("texture_format/bptc")) { + if (p_preset->get("texture_format/s3tc_bptc")) { + r_features->push_back("s3tc"); r_features->push_back("bptc"); } - if (p_preset->get("texture_format/s3tc")) { - r_features->push_back("s3tc"); - } - if (p_preset->get("texture_format/etc2")) { + if (p_preset->get("texture_format/etc2_astc")) { r_features->push_back("etc2"); + r_features->push_back("astc"); } // PC platforms only have one architecture per export, since // we export a single executable instead of a bundle. @@ -57,9 +56,8 @@ void EditorExportPlatformPC::get_export_options(List *r_options) c r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "binary_format/embed_pck"), false)); - r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/bptc"), true)); - r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/s3tc"), true)); - r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/etc2"), false)); + r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/s3tc_bptc"), true)); + r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/etc2_astc"), false)); } String EditorExportPlatformPC::get_name() const { @@ -99,6 +97,14 @@ bool EditorExportPlatformPC::has_valid_export_configuration(const Refget("texture_format/s3tc_bptc"); + bool uses_etc2_astc = p_preset->get("texture_format/etc2_astc"); + + if (!uses_s3tc_bptc && !uses_etc2_astc) { + valid = false; + err += TTR("A texture format must be selected to export the project. Please select at least one texture format."); + } + if (!err.is_empty()) { r_error = err; } @@ -233,9 +239,8 @@ void EditorExportPlatformPC::set_logo(const Ref &p_logo) { } 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 + r_features->push_back("pc"); // Identify PC platforms as such. + r_features->push_back(get_os_name().to_lower()); // OS name is a feature. } void EditorExportPlatformPC::resolve_platform_feature_priorities(const Ref &p_preset, HashSet &p_features) { diff --git a/platform/linuxbsd/doc_classes/EditorExportPlatformLinuxBSD.xml b/platform/linuxbsd/doc_classes/EditorExportPlatformLinuxBSD.xml index 6034f414e22..a44c86202e2 100644 --- a/platform/linuxbsd/doc_classes/EditorExportPlatformLinuxBSD.xml +++ b/platform/linuxbsd/doc_classes/EditorExportPlatformLinuxBSD.xml @@ -57,14 +57,11 @@ - [code]{exe_name}[/code] - Name of application executable. - [code]{cmd_args}[/code] - Array of the command line argument for the application. - - If [code]true[/code], project textures are exported in the BPTC format. + + If [code]true[/code], project textures are exported in the ETC2/ASTC format. - - If [code]true[/code], project textures are exported in the ETC2 format. - - - If [code]true[/code], project textures are exported in the S3TC format. + + If [code]true[/code], project textures are exported in the S3TC/BPTC format. diff --git a/platform/windows/doc_classes/EditorExportPlatformWindows.xml b/platform/windows/doc_classes/EditorExportPlatformWindows.xml index 1d845d7b2f2..71c94cc1c41 100644 --- a/platform/windows/doc_classes/EditorExportPlatformWindows.xml +++ b/platform/windows/doc_classes/EditorExportPlatformWindows.xml @@ -123,14 +123,11 @@ - [code]{exe_name}[/code] - Name of application executable. - [code]{cmd_args}[/code] - Array of the command line argument for the application. - - If [code]true[/code], project textures are exported in the BPTC format. + + If [code]true[/code], project textures are exported in the ETC2/ASTC format. - - If [code]true[/code], project textures are exported in the ETC2 format. - - - If [code]true[/code], project textures are exported in the S3TC format. + + If [code]true[/code], project textures are exported in the S3TC/BPTC format.