summaryrefslogtreecommitdiff
path: root/core/io
diff options
context:
space:
mode:
Diffstat (limited to 'core/io')
-rw-r--r--core/io/image_loader.h1
-rw-r--r--core/io/resource_importer.cpp9
2 files changed, 10 insertions, 0 deletions
diff --git a/core/io/image_loader.h b/core/io/image_loader.h
index cb64d2310e..bf78005e40 100644
--- a/core/io/image_loader.h
+++ b/core/io/image_loader.h
@@ -52,6 +52,7 @@ public:
enum LoaderFlags {
FLAG_NONE = 0,
FLAG_FORCE_LINEAR = 1,
+ FLAG_CONVERT_COLORS = 2,
};
virtual ~ImageFormatLoader() {}
diff --git a/core/io/resource_importer.cpp b/core/io/resource_importer.cpp
index aa7f96a047..d923522317 100644
--- a/core/io/resource_importer.cpp
+++ b/core/io/resource_importer.cpp
@@ -108,6 +108,15 @@ Error ResourceFormatImporter::_get_path_and_type(const String &p_path, PathAndTy
}
}
+#ifdef TOOLS_ENABLED
+ if (r_path_and_type.metadata && !r_path_and_type.path.is_empty()) {
+ Dictionary metadata = r_path_and_type.metadata;
+ if (metadata.has("has_editor_variant")) {
+ r_path_and_type.path = r_path_and_type.path.get_basename() + ".editor." + r_path_and_type.path.get_extension();
+ }
+ }
+#endif
+
if (r_path_and_type.path.is_empty() || r_path_and_type.type.is_empty()) {
return ERR_FILE_CORRUPT;
}