diff options
Diffstat (limited to 'core/io')
-rw-r--r-- | core/io/resource_import.cpp | 36 | ||||
-rw-r--r-- | core/io/resource_import.h | 4 |
2 files changed, 20 insertions, 20 deletions
diff --git a/core/io/resource_import.cpp b/core/io/resource_import.cpp index 58de944e6c..cfe6655504 100644 --- a/core/io/resource_import.cpp +++ b/core/io/resource_import.cpp @@ -138,9 +138,9 @@ void ResourceFormatImporter::get_recognized_extensions(List<String> *p_extension Set<String> found; - for (Set<Ref<ResourceImporter> >::Element *E = importers.front(); E; E = E->next()) { + for (int i = 0; i < importers.size(); i++) { List<String> local_exts; - E->get()->get_recognized_extensions(&local_exts); + importers[i]->get_recognized_extensions(&local_exts); for (List<String>::Element *F = local_exts.front(); F; F = F->next()) { if (!found.has(F->get())) { p_extensions->push_back(F->get()); @@ -158,8 +158,8 @@ void ResourceFormatImporter::get_recognized_extensions_for_type(const String &p_ Set<String> found; - for (Set<Ref<ResourceImporter> >::Element *E = importers.front(); E; E = E->next()) { - String res_type = E->get()->get_resource_type(); + for (int i = 0; i < importers.size(); i++) { + String res_type = importers[i]->get_resource_type(); if (res_type == String()) continue; @@ -167,7 +167,7 @@ void ResourceFormatImporter::get_recognized_extensions_for_type(const String &p_ continue; List<String> local_exts; - E->get()->get_recognized_extensions(&local_exts); + importers[i]->get_recognized_extensions(&local_exts); for (List<String>::Element *F = local_exts.front(); F; F = F->next()) { if (!found.has(F->get())) { p_extensions->push_back(F->get()); @@ -212,9 +212,9 @@ int ResourceFormatImporter::get_import_order(const String &p_path) const { bool ResourceFormatImporter::handles_type(const String &p_type) const { - for (Set<Ref<ResourceImporter> >::Element *E = importers.front(); E; E = E->next()) { + for (int i = 0; i < importers.size(); i++) { - String res_type = E->get()->get_resource_type(); + String res_type = importers[i]->get_resource_type(); if (res_type == String()) continue; if (ClassDB::is_parent_class(res_type, p_type)) @@ -319,9 +319,9 @@ void ResourceFormatImporter::get_dependencies(const String &p_path, List<String> Ref<ResourceImporter> ResourceFormatImporter::get_importer_by_name(const String &p_name) const { - for (Set<Ref<ResourceImporter> >::Element *E = importers.front(); E; E = E->next()) { - if (E->get()->get_importer_name() == p_name) { - return E->get(); + for (int i = 0; i < importers.size(); i++) { + if (importers[i]->get_importer_name() == p_name) { + return importers[i]; } } @@ -330,12 +330,12 @@ 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 (Set<Ref<ResourceImporter> >::Element *E = importers.front(); E; E = E->next()) { + for (int i = 0; i < importers.size(); i++) { List<String> local_exts; - E->get()->get_recognized_extensions(&local_exts); + importers[i]->get_recognized_extensions(&local_exts); for (List<String>::Element *F = local_exts.front(); F; F = F->next()) { if (p_extension.to_lower() == F->get()) { - r_importers->push_back(E->get()); + r_importers->push_back(importers[i]); } } } @@ -346,14 +346,14 @@ Ref<ResourceImporter> ResourceFormatImporter::get_importer_by_extension(const St Ref<ResourceImporter> importer; float priority = 0; - for (Set<Ref<ResourceImporter> >::Element *E = importers.front(); E; E = E->next()) { + for (int i = 0; i < importers.size(); i++) { List<String> local_exts; - E->get()->get_recognized_extensions(&local_exts); + importers[i]->get_recognized_extensions(&local_exts); for (List<String>::Element *F = local_exts.front(); F; F = F->next()) { - if (p_extension.to_lower() == F->get() && E->get()->get_priority() > priority) { - importer = E->get(); - priority = E->get()->get_priority(); + if (p_extension.to_lower() == F->get() && importers[i]->get_priority() > priority) { + importer = importers[i]; + priority = importers[i]->get_priority(); } } } diff --git a/core/io/resource_import.h b/core/io/resource_import.h index 1b681bd97a..80e0743eda 100644 --- a/core/io/resource_import.h +++ b/core/io/resource_import.h @@ -46,7 +46,7 @@ class ResourceFormatImporter : public ResourceFormatLoader { static ResourceFormatImporter *singleton; - Set<Ref<ResourceImporter> > importers; + Vector<Ref<ResourceImporter> > importers; public: static ResourceFormatImporter *get_singleton() { return singleton; } @@ -65,7 +65,7 @@ public: String get_internal_resource_path(const String &p_path) const; void get_internal_resource_path_list(const String &p_path, List<String> *r_paths); - void add_importer(const Ref<ResourceImporter> &p_importer) { importers.insert(p_importer); } + void add_importer(const Ref<ResourceImporter> &p_importer) { importers.push_back(p_importer); } void remove_importer(const Ref<ResourceImporter> &p_importer) { importers.erase(p_importer); } Ref<ResourceImporter> get_importer_by_name(const String &p_name) const; Ref<ResourceImporter> get_importer_by_extension(const String &p_extension) const; |