summaryrefslogtreecommitdiff
path: root/core/io/resource_importer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/io/resource_importer.cpp')
-rw-r--r--core/io/resource_importer.cpp32
1 files changed, 0 insertions, 32 deletions
diff --git a/core/io/resource_importer.cpp b/core/io/resource_importer.cpp
index 9e22bdced7..c2e27bc9c2 100644
--- a/core/io/resource_importer.cpp
+++ b/core/io/resource_importer.cpp
@@ -38,7 +38,6 @@ bool ResourceFormatImporter::SortImporterByName::operator()(const Ref<ResourceIm
}
Error ResourceFormatImporter::_get_path_and_type(const String &p_path, PathAndType &r_path_and_type, bool *r_valid) const {
-
Error err;
FileAccess *f = FileAccess::open(p_path + ".import", FileAccess::READ, &err);
@@ -64,7 +63,6 @@ Error ResourceFormatImporter::_get_path_and_type(const String &p_path, PathAndTy
String error_text;
bool path_found = false; //first match must have priority
while (true) {
-
assign = Variant();
next_tag.fields.clear();
next_tag.name = String();
@@ -118,12 +116,10 @@ Error ResourceFormatImporter::_get_path_and_type(const String &p_path, PathAndTy
}
RES ResourceFormatImporter::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress, bool p_no_cache) {
-
PathAndType pat;
Error err = _get_path_and_type(p_path, pat);
if (err != OK) {
-
if (r_error)
*r_error = err;
@@ -143,7 +139,6 @@ RES ResourceFormatImporter::load(const String &p_path, const String &p_original_
}
void ResourceFormatImporter::get_recognized_extensions(List<String> *p_extensions) const {
-
Set<String> found;
for (int i = 0; i < importers.size(); i++) {
@@ -159,7 +154,6 @@ void ResourceFormatImporter::get_recognized_extensions(List<String> *p_extension
}
void ResourceFormatImporter::get_recognized_extensions_for_type(const String &p_type, List<String> *p_extensions) const {
-
if (p_type == "") {
get_recognized_extensions(p_extensions);
return;
@@ -187,26 +181,21 @@ void ResourceFormatImporter::get_recognized_extensions_for_type(const String &p_
}
bool ResourceFormatImporter::exists(const String &p_path) const {
-
return FileAccess::exists(p_path + ".import");
}
bool ResourceFormatImporter::recognize_path(const String &p_path, const String &p_for_type) const {
-
return FileAccess::exists(p_path + ".import");
}
bool ResourceFormatImporter::can_be_imported(const String &p_path) const {
-
return ResourceFormatLoader::recognize_path(p_path);
}
int ResourceFormatImporter::get_import_order(const String &p_path) const {
-
Ref<ResourceImporter> importer;
if (FileAccess::exists(p_path + ".import")) {
-
PathAndType pat;
Error err = _get_path_and_type(p_path, pat);
@@ -214,7 +203,6 @@ int ResourceFormatImporter::get_import_order(const String &p_path) const {
importer = get_importer_by_name(pat.importer);
}
} else {
-
importer = get_importer_by_extension(p_path.get_extension().to_lower());
}
@@ -225,9 +213,7 @@ int ResourceFormatImporter::get_import_order(const String &p_path) const {
}
bool ResourceFormatImporter::handles_type(const String &p_type) const {
-
for (int i = 0; i < importers.size(); i++) {
-
String res_type = importers[i]->get_resource_type();
if (res_type == String())
continue;
@@ -239,12 +225,10 @@ bool ResourceFormatImporter::handles_type(const String &p_type) const {
}
String ResourceFormatImporter::get_internal_resource_path(const String &p_path) const {
-
PathAndType pat;
Error err = _get_path_and_type(p_path, pat);
if (err != OK) {
-
return String();
}
@@ -252,7 +236,6 @@ String ResourceFormatImporter::get_internal_resource_path(const String &p_path)
}
void ResourceFormatImporter::get_internal_resource_path_list(const String &p_path, List<String> *r_paths) {
-
Error err;
FileAccess *f = FileAccess::open(p_path + ".import", FileAccess::READ, &err);
@@ -269,7 +252,6 @@ void ResourceFormatImporter::get_internal_resource_path_list(const String &p_pat
int lines = 0;
String error_text;
while (true) {
-
assign = Variant();
next_tag.fields.clear();
next_tag.name = String();
@@ -298,7 +280,6 @@ void ResourceFormatImporter::get_internal_resource_path_list(const String &p_pat
}
String ResourceFormatImporter::get_import_group_file(const String &p_path) const {
-
bool valid = true;
PathAndType pat;
_get_path_and_type(p_path, pat, &valid);
@@ -306,7 +287,6 @@ String ResourceFormatImporter::get_import_group_file(const String &p_path) const
}
bool ResourceFormatImporter::is_import_valid(const String &p_path) const {
-
bool valid = true;
PathAndType pat;
_get_path_and_type(p_path, pat, &valid);
@@ -314,12 +294,10 @@ bool ResourceFormatImporter::is_import_valid(const String &p_path) const {
}
String ResourceFormatImporter::get_resource_type(const String &p_path) const {
-
PathAndType pat;
Error err = _get_path_and_type(p_path, pat);
if (err != OK) {
-
return "";
}
@@ -331,7 +309,6 @@ Variant ResourceFormatImporter::get_resource_metadata(const String &p_path) cons
Error err = _get_path_and_type(p_path, pat);
if (err != OK) {
-
return Variant();
}
@@ -339,12 +316,10 @@ Variant ResourceFormatImporter::get_resource_metadata(const String &p_path) cons
}
void ResourceFormatImporter::get_dependencies(const String &p_path, List<String> *p_dependencies, bool p_add_types) {
-
PathAndType pat;
Error err = _get_path_and_type(p_path, pat);
if (err != OK) {
-
return;
}
@@ -352,7 +327,6 @@ void ResourceFormatImporter::get_dependencies(const String &p_path, List<String>
}
Ref<ResourceImporter> ResourceFormatImporter::get_importer_by_name(const String &p_name) const {
-
for (int i = 0; i < importers.size(); i++) {
if (importers[i]->get_importer_name() == p_name) {
return importers[i];
@@ -363,7 +337,6 @@ Ref<ResourceImporter> ResourceFormatImporter::get_importer_by_name(const String
}
void ResourceFormatImporter::get_importers_for_extension(const String &p_extension, List<Ref<ResourceImporter>> *r_importers) {
-
for (int i = 0; i < importers.size(); i++) {
List<String> local_exts;
importers[i]->get_recognized_extensions(&local_exts);
@@ -376,12 +349,10 @@ void ResourceFormatImporter::get_importers_for_extension(const String &p_extensi
}
Ref<ResourceImporter> ResourceFormatImporter::get_importer_by_extension(const String &p_extension) const {
-
Ref<ResourceImporter> importer;
float priority = 0;
for (int i = 0; i < importers.size(); i++) {
-
List<String> local_exts;
importers[i]->get_recognized_extensions(&local_exts);
for (List<String>::Element *F = local_exts.front(); F; F = F->next()) {
@@ -396,12 +367,10 @@ Ref<ResourceImporter> ResourceFormatImporter::get_importer_by_extension(const St
}
String ResourceFormatImporter::get_import_base_path(const String &p_for_file) const {
-
return "res://.import/" + p_for_file.get_file() + "-" + p_for_file.md5_text();
}
bool ResourceFormatImporter::are_import_settings_valid(const String &p_path) const {
-
bool valid = true;
PathAndType pat;
_get_path_and_type(p_path, pat, &valid);
@@ -422,7 +391,6 @@ bool ResourceFormatImporter::are_import_settings_valid(const String &p_path) con
}
String ResourceFormatImporter::get_import_settings_hash() const {
-
Vector<Ref<ResourceImporter>> sorted_importers = importers;
sorted_importers.sort_custom<SortImporterByName>();