summaryrefslogtreecommitdiff
path: root/platform/javascript/export/export.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'platform/javascript/export/export.cpp')
-rw-r--r--platform/javascript/export/export.cpp33
1 files changed, 19 insertions, 14 deletions
diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp
index 2da6ea6670..5704433650 100644
--- a/platform/javascript/export/export.cpp
+++ b/platform/javascript/export/export.cpp
@@ -104,22 +104,24 @@ void EditorExportPlatformJavaScript::_fix_html(Vector<uint8_t> &p_html, const Re
void EditorExportPlatformJavaScript::get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features) {
- if (p_preset->get("texture_format/s3tc")) {
+ if (p_preset->get("vram_texture_compression/for_desktop")) {
r_features->push_back("s3tc");
}
- if (p_preset->get("texture_format/etc")) {
- r_features->push_back("etc");
- }
- if (p_preset->get("texture_format/etc2")) {
- r_features->push_back("etc2");
+
+ if (p_preset->get("vram_texture_compression/for_mobile")) {
+ String driver = ProjectSettings::get_singleton()->get("rendering/quality/driver/driver_name");
+ if (driver == "GLES2") {
+ r_features->push_back("etc");
+ } else if (driver == "GLES3") {
+ r_features->push_back("etc2");
+ }
}
}
void EditorExportPlatformJavaScript::get_export_options(List<ExportOption> *r_options) {
- r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/s3tc"), true));
- r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/etc"), false));
- r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/etc2"), true));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "vram_texture_compression/for_desktop"), true)); // S3TC
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "vram_texture_compression/for_mobile"), false)); // ETC or ETC2, depending on renderer
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "html/custom_html_shell", PROPERTY_HINT_FILE, "*.html"), ""));
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "html/head_include", PROPERTY_HINT_MULTILINE_TEXT), ""));
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "custom_template/release", PROPERTY_HINT_GLOBAL_FILE, "*.zip"), ""));
@@ -167,16 +169,19 @@ bool EditorExportPlatformJavaScript::can_export(const Ref<EditorExportPreset> &p
}
}
- String etc_error = test_etc2();
- if (etc_error != String()) {
- valid = false;
- err += etc_error;
+ r_missing_templates = !valid;
+
+ if (p_preset->get("vram_texture_compression/for_mobile")) {
+ String etc_error = test_etc2();
+ if (etc_error != String()) {
+ valid = false;
+ err += etc_error;
+ }
}
if (!err.empty())
r_error = err;
- r_missing_templates = !valid;
return valid;
}