1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-14 13:41:12 +00:00

Check if the required texture format is imported in the export dialog

This commit is contained in:
Aaron Franke
2023-06-19 20:03:51 -05:00
parent 217a20a8a0
commit 1a70d82606
5 changed files with 107 additions and 13 deletions

View File

@@ -32,6 +32,7 @@
#include "core/config/project_settings.h"
#include "core/io/config_file.h"
#include "editor/import/resource_importer_texture_settings.h"
EditorExport *EditorExport::singleton = nullptr;
@@ -136,20 +137,16 @@ void EditorExport::add_export_preset(const Ref<EditorExportPreset> &p_preset, in
}
String EditorExportPlatform::test_etc2() const {
const bool etc2_supported = GLOBAL_GET("rendering/textures/vram_compression/import_etc2_astc");
if (!etc2_supported) {
return TTR("Target platform requires 'ETC2/ASTC' texture compression. Enable 'Import ETC2 ASTC' in Project Settings.");
if (!ResourceImporterTextureSettings::should_import_etc2_astc()) {
return TTR("Target platform requires 'ETC2/ASTC' texture compression. Enable 'Import ETC2 ASTC' in Project Settings.") + "\n";
}
return String();
}
String EditorExportPlatform::test_bc() const {
const bool bc_supported = GLOBAL_GET("rendering/textures/vram_compression/import_s3tc_bptc");
if (!bc_supported) {
return TTR("Target platform requires 'S3TC/BPTC' texture compression. Enable 'Import S3TC BPTC' in Project Settings.");
if (!ResourceImporterTextureSettings::should_import_s3tc_bptc()) {
return TTR("Target platform requires 'S3TC/BPTC' texture compression. Enable 'Import S3TC BPTC' in Project Settings.") + "\n";
}
return String();