diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-09-09 16:52:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-09 16:52:32 +0200 |
commit | 24ce46e2a17558cfdfbfab8c8109b6630a19287f (patch) | |
tree | 17b36ea833b7f88f46c75fe44fa875e9b0ac1ed2 /core | |
parent | 82031fa231506ef036ccd06e740a7ca2ceca20d0 (diff) | |
parent | 817d4db21f183d4e1bdb5c1101f221aa3ed10da0 (diff) |
Merge pull request #64938 from YuriSizov/editor-scaled-icons
Diffstat (limited to 'core')
-rw-r--r-- | core/io/image_loader.h | 1 | ||||
-rw-r--r-- | core/io/resource_importer.cpp | 9 |
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; } |