summaryrefslogtreecommitdiff
path: root/core/io
diff options
context:
space:
mode:
Diffstat (limited to 'core/io')
-rw-r--r--core/io/file_access_memory.cpp12
-rw-r--r--core/io/file_access_network.h2
-rw-r--r--core/io/file_access_pack.cpp2
-rw-r--r--core/io/file_access_pack.h31
-rw-r--r--core/io/file_access_zip.h4
-rw-r--r--core/io/ip.cpp4
-rw-r--r--core/io/ip.h2
-rw-r--r--core/io/json.cpp4
-rw-r--r--core/io/json.h2
-rw-r--r--core/io/logger.cpp4
-rw-r--r--core/io/packed_data_container.cpp4
-rw-r--r--core/io/packed_data_container.h2
-rw-r--r--core/io/resource.cpp8
-rw-r--r--core/io/resource.h6
-rw-r--r--core/io/resource_format_binary.cpp8
-rw-r--r--core/io/resource_format_binary.h20
-rw-r--r--core/io/resource_importer.cpp4
-rw-r--r--core/io/resource_importer.h6
-rw-r--r--core/io/resource_loader.cpp6
-rw-r--r--core/io/resource_loader.h6
20 files changed, 67 insertions, 70 deletions
diff --git a/core/io/file_access_memory.cpp b/core/io/file_access_memory.cpp
index 943dc72307..499d001234 100644
--- a/core/io/file_access_memory.cpp
+++ b/core/io/file_access_memory.cpp
@@ -32,13 +32,13 @@
#include "core/config/project_settings.h"
#include "core/io/dir_access.h"
-#include "core/templates/map.h"
+#include "core/templates/rb_map.h"
-static Map<String, Vector<uint8_t>> *files = nullptr;
+static HashMap<String, Vector<uint8_t>> *files = nullptr;
void FileAccessMemory::register_file(String p_name, Vector<uint8_t> p_data) {
if (!files) {
- files = memnew((Map<String, Vector<uint8_t>>));
+ files = memnew((HashMap<String, Vector<uint8_t>>));
}
String name;
@@ -84,11 +84,11 @@ Error FileAccessMemory::_open(const String &p_path, int p_mode_flags) {
String name = fix_path(p_path);
//name = DirAccess::normalize_path(name);
- Map<String, Vector<uint8_t>>::Element *E = files->find(name);
+ HashMap<String, Vector<uint8_t>>::Iterator E = files->find(name);
ERR_FAIL_COND_V_MSG(!E, ERR_FILE_NOT_FOUND, "Can't find file '" + p_path + "'.");
- data = E->get().ptrw();
- length = E->get().size();
+ data = E->value.ptrw();
+ length = E->value.size();
pos = 0;
return OK;
diff --git a/core/io/file_access_network.h b/core/io/file_access_network.h
index 214d391c95..c7431752c0 100644
--- a/core/io/file_access_network.h
+++ b/core/io/file_access_network.h
@@ -52,7 +52,7 @@ class FileAccessNetworkClient {
bool quit = false;
Mutex mutex;
Mutex blockrequest_mutex;
- Map<int, FileAccessNetwork *> accesses;
+ HashMap<int, FileAccessNetwork *> accesses;
Ref<StreamPeerTCP> client;
int32_t last_id = 0;
int32_t lockcount = 0;
diff --git a/core/io/file_access_pack.cpp b/core/io/file_access_pack.cpp
index ba120de68b..89efdc4938 100644
--- a/core/io/file_access_pack.cpp
+++ b/core/io/file_access_pack.cpp
@@ -406,7 +406,7 @@ Error DirAccessPack::list_dir_begin() {
list_dirs.push_back(E.key);
}
- for (Set<String>::Element *E = current->files.front(); E; E = E->next()) {
+ for (RBSet<String>::Element *E = current->files.front(); E; E = E->next()) {
list_files.push_back(E->get());
}
diff --git a/core/io/file_access_pack.h b/core/io/file_access_pack.h
index 17e87c835a..404ad38c96 100644
--- a/core/io/file_access_pack.h
+++ b/core/io/file_access_pack.h
@@ -35,8 +35,8 @@
#include "core/io/file_access.h"
#include "core/string/print_string.h"
#include "core/templates/list.h"
-#include "core/templates/map.h"
-#include "core/templates/set.h"
+#include "core/templates/rb_map.h"
+#include "core/templates/rb_set.h"
// Godot's packed file magic header ("GDPC" in ASCII).
#define PACK_HEADER_MAGIC 0x43504447
@@ -72,23 +72,20 @@ private:
struct PackedDir {
PackedDir *parent = nullptr;
String name;
- Map<String, PackedDir *> subdirs;
- Set<String> files;
+ HashMap<String, PackedDir *> subdirs;
+ RBSet<String> files;
};
struct PathMD5 {
uint64_t a = 0;
uint64_t b = 0;
- bool operator<(const PathMD5 &p_md5) const {
- if (p_md5.a == a) {
- return b < p_md5.b;
- } else {
- return a < p_md5.a;
- }
- }
- bool operator==(const PathMD5 &p_md5) const {
- return a == p_md5.a && b == p_md5.b;
+ bool operator==(const PathMD5 &p_val) const {
+ return (a == p_val.a) && (b == p_val.b);
+ }
+ static uint32_t hash(const PathMD5 &p_val) {
+ uint32_t h = hash_djb2_one_32(p_val.a);
+ return hash_djb2_one_32(p_val.b, h);
}
PathMD5() {}
@@ -99,7 +96,7 @@ private:
}
};
- Map<PathMD5, PackedFile> files;
+ HashMap<PathMD5, PackedFile, PathMD5> files;
Vector<PackSource *> sources;
@@ -186,15 +183,15 @@ public:
Ref<FileAccess> PackedData::try_open_path(const String &p_path) {
PathMD5 pmd5(p_path.md5_buffer());
- Map<PathMD5, PackedFile>::Element *E = files.find(pmd5);
+ HashMap<PathMD5, PackedFile, PathMD5>::Iterator E = files.find(pmd5);
if (!E) {
return nullptr; //not found
}
- if (E->get().offset == 0) {
+ if (E->value.offset == 0) {
return nullptr; //was erased
}
- return E->get().src->get_file(p_path, &E->get());
+ return E->value.src->get_file(p_path, &E->value);
}
bool PackedData::has_path(const String &p_path) {
diff --git a/core/io/file_access_zip.h b/core/io/file_access_zip.h
index ae58d99a66..6ea603546a 100644
--- a/core/io/file_access_zip.h
+++ b/core/io/file_access_zip.h
@@ -34,7 +34,7 @@
#ifdef MINIZIP_ENABLED
#include "core/io/file_access_pack.h"
-#include "core/templates/map.h"
+#include "core/templates/rb_map.h"
#include "thirdparty/minizip/unzip.h"
@@ -55,7 +55,7 @@ private:
};
Vector<Package> packages;
- Map<String, File> files;
+ HashMap<String, File> files;
static ZipArchive *instance;
diff --git a/core/io/ip.cpp b/core/io/ip.cpp
index 5156a5cb99..25e3bef5fc 100644
--- a/core/io/ip.cpp
+++ b/core/io/ip.cpp
@@ -267,7 +267,7 @@ Array IP::_get_local_addresses() const {
Array IP::_get_local_interfaces() const {
Array results;
- Map<String, Interface_Info> interfaces;
+ HashMap<String, Interface_Info> interfaces;
get_local_interfaces(&interfaces);
for (KeyValue<String, Interface_Info> &E : interfaces) {
Interface_Info &c = E.value;
@@ -289,7 +289,7 @@ Array IP::_get_local_interfaces() const {
}
void IP::get_local_addresses(List<IPAddress> *r_addresses) const {
- Map<String, Interface_Info> interfaces;
+ HashMap<String, Interface_Info> interfaces;
get_local_interfaces(&interfaces);
for (const KeyValue<String, Interface_Info> &E : interfaces) {
for (const IPAddress &F : E.value.ip_addresses) {
diff --git a/core/io/ip.h b/core/io/ip.h
index 06ff8a4d70..4d83515e2b 100644
--- a/core/io/ip.h
+++ b/core/io/ip.h
@@ -92,7 +92,7 @@ public:
virtual void _resolve_hostname(List<IPAddress> &r_addresses, const String &p_hostname, Type p_type = TYPE_ANY) const = 0;
Array get_resolve_item_addresses(ResolverID p_id) const;
- virtual void get_local_interfaces(Map<String, Interface_Info> *r_interfaces) const = 0;
+ virtual void get_local_interfaces(HashMap<String, Interface_Info> *r_interfaces) const = 0;
void erase_resolve_item(ResolverID p_id);
void clear_cache(const String &p_hostname = "");
diff --git a/core/io/json.cpp b/core/io/json.cpp
index 4b745dff44..b3a9762e75 100644
--- a/core/io/json.cpp
+++ b/core/io/json.cpp
@@ -55,7 +55,7 @@ String JSON::_make_indent(const String &p_indent, int p_size) {
return indent_text;
}
-String JSON::_stringify(const Variant &p_var, const String &p_indent, int p_cur_indent, bool p_sort_keys, Set<const void *> &p_markers, bool p_full_precision) {
+String JSON::_stringify(const Variant &p_var, const String &p_indent, int p_cur_indent, bool p_sort_keys, RBSet<const void *> &p_markers, bool p_full_precision) {
String colon = ":";
String end_statement = "";
@@ -529,7 +529,7 @@ Error JSON::_parse_string(const String &p_json, Variant &r_ret, String &r_err_st
}
String JSON::stringify(const Variant &p_var, const String &p_indent, bool p_sort_keys, bool p_full_precision) {
- Set<const void *> markers;
+ RBSet<const void *> markers;
return _stringify(p_var, p_indent, 0, p_sort_keys, markers, p_full_precision);
}
diff --git a/core/io/json.h b/core/io/json.h
index ed251938ec..f883d3963a 100644
--- a/core/io/json.h
+++ b/core/io/json.h
@@ -70,7 +70,7 @@ class JSON : public RefCounted {
static const char *tk_name[];
static String _make_indent(const String &p_indent, int p_size);
- static String _stringify(const Variant &p_var, const String &p_indent, int p_cur_indent, bool p_sort_keys, Set<const void *> &p_markers, bool p_full_precision = false);
+ static String _stringify(const Variant &p_var, const String &p_indent, int p_cur_indent, bool p_sort_keys, RBSet<const void *> &p_markers, bool p_full_precision = false);
static Error _get_token(const char32_t *p_str, int &index, int p_len, Token &r_token, int &line, String &r_err_str);
static Error _parse_value(Variant &value, Token &token, const char32_t *p_str, int &index, int p_len, int &line, String &r_err_str);
static Error _parse_array(Array &array, const char32_t *p_str, int &index, int p_len, int &line, String &r_err_str);
diff --git a/core/io/logger.cpp b/core/io/logger.cpp
index c19fc2820b..925bfdbd02 100644
--- a/core/io/logger.cpp
+++ b/core/io/logger.cpp
@@ -128,7 +128,7 @@ void RotatedFileLogger::clear_old_backups() {
da->list_dir_begin();
String f = da->get_next();
- Set<String> backups;
+ RBSet<String> backups;
while (!f.is_empty()) {
if (!da->current_is_dir() && f.begins_with(basename) && f.get_extension() == extension && f != base_path.get_file()) {
backups.insert(f);
@@ -141,7 +141,7 @@ void RotatedFileLogger::clear_old_backups() {
// since backups are appended with timestamp and Set iterates them in sorted order,
// first backups are the oldest
int to_delete = backups.size() - max_backups;
- for (Set<String>::Element *E = backups.front(); E && to_delete > 0; E = E->next(), --to_delete) {
+ for (RBSet<String>::Element *E = backups.front(); E && to_delete > 0; E = E->next(), --to_delete) {
da->remove(E->get());
}
}
diff --git a/core/io/packed_data_container.cpp b/core/io/packed_data_container.cpp
index 027fdd51aa..a456318148 100644
--- a/core/io/packed_data_container.cpp
+++ b/core/io/packed_data_container.cpp
@@ -210,7 +210,7 @@ Variant PackedDataContainer::_key_at_ofs(uint32_t p_ofs, const Variant &p_key, b
}
}
-uint32_t PackedDataContainer::_pack(const Variant &p_data, Vector<uint8_t> &tmpdata, Map<String, uint32_t> &string_cache) {
+uint32_t PackedDataContainer::_pack(const Variant &p_data, Vector<uint8_t> &tmpdata, HashMap<String, uint32_t> &string_cache) {
switch (p_data.get_type()) {
case Variant::STRING: {
String s = p_data;
@@ -321,7 +321,7 @@ uint32_t PackedDataContainer::_pack(const Variant &p_data, Vector<uint8_t> &tmpd
Error PackedDataContainer::pack(const Variant &p_data) {
Vector<uint8_t> tmpdata;
- Map<String, uint32_t> string_cache;
+ HashMap<String, uint32_t> string_cache;
_pack(p_data, tmpdata, string_cache);
datalen = tmpdata.size();
data.resize(tmpdata.size());
diff --git a/core/io/packed_data_container.h b/core/io/packed_data_container.h
index f042b364ee..73c215aed8 100644
--- a/core/io/packed_data_container.h
+++ b/core/io/packed_data_container.h
@@ -50,7 +50,7 @@ class PackedDataContainer : public Resource {
Vector<uint8_t> data;
int datalen = 0;
- uint32_t _pack(const Variant &p_data, Vector<uint8_t> &tmpdata, Map<String, uint32_t> &string_cache);
+ uint32_t _pack(const Variant &p_data, Vector<uint8_t> &tmpdata, HashMap<String, uint32_t> &string_cache);
Variant _iter_init_ofs(const Array &p_iter, uint32_t p_offset);
Variant _iter_next_ofs(const Array &p_iter, uint32_t p_offset);
diff --git a/core/io/resource.cpp b/core/io/resource.cpp
index e81382b72e..4a94c17132 100644
--- a/core/io/resource.cpp
+++ b/core/io/resource.cpp
@@ -193,7 +193,7 @@ void Resource::reload_from_file() {
copy_from(s);
}
-Ref<Resource> Resource::duplicate_for_local_scene(Node *p_for_scene, Map<Ref<Resource>, Ref<Resource>> &remap_cache) {
+Ref<Resource> Resource::duplicate_for_local_scene(Node *p_for_scene, HashMap<Ref<Resource>, Ref<Resource>> &remap_cache) {
List<PropertyInfo> plist;
get_property_list(&plist);
@@ -228,7 +228,7 @@ Ref<Resource> Resource::duplicate_for_local_scene(Node *p_for_scene, Map<Ref<Res
return r;
}
-void Resource::configure_for_local_scene(Node *p_for_scene, Map<Ref<Resource>, Ref<Resource>> &remap_cache) {
+void Resource::configure_for_local_scene(Node *p_for_scene, HashMap<Ref<Resource>, Ref<Resource>> &remap_cache) {
List<PropertyInfo> plist;
get_property_list(&plist);
@@ -317,7 +317,7 @@ void Resource::unregister_owner(Object *p_owner) {
}
void Resource::notify_change_to_owners() {
- for (Set<ObjectID>::Element *E = owners.front(); E; E = E->next()) {
+ for (RBSet<ObjectID>::Element *E = owners.front(); E; E = E->next()) {
Object *obj = ObjectDB::get_instance(E->get());
ERR_CONTINUE_MSG(!obj, "Object was deleted, while still owning a resource."); //wtf
//TODO store string
@@ -532,7 +532,7 @@ void ResourceCache::dump(const char *p_file, bool p_short) {
#ifdef DEBUG_ENABLED
lock.read_lock();
- Map<String, int> type_count;
+ HashMap<String, int> type_count;
Ref<FileAccess> f;
if (p_file) {
diff --git a/core/io/resource.h b/core/io/resource.h
index 43ae104da5..53c828f9cd 100644
--- a/core/io/resource.h
+++ b/core/io/resource.h
@@ -54,7 +54,7 @@ public:
virtual String get_base_extension() const { return "res"; }
private:
- Set<ObjectID> owners;
+ RBSet<ObjectID> owners;
friend class ResBase;
friend class ResourceCache;
@@ -111,8 +111,8 @@ public:
String get_scene_unique_id() const;
virtual Ref<Resource> duplicate(bool p_subresources = false) const;
- Ref<Resource> duplicate_for_local_scene(Node *p_for_scene, Map<Ref<Resource>, Ref<Resource>> &remap_cache);
- void configure_for_local_scene(Node *p_for_scene, Map<Ref<Resource>, Ref<Resource>> &remap_cache);
+ Ref<Resource> duplicate_for_local_scene(Node *p_for_scene, HashMap<Ref<Resource>, Ref<Resource>> &remap_cache);
+ void configure_for_local_scene(Node *p_for_scene, HashMap<Ref<Resource>, Ref<Resource>> &remap_cache);
void set_local_to_scene(bool p_enable);
bool is_local_to_scene() const;
diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp
index 3c854bbbe5..cf87869a32 100644
--- a/core/io/resource_format_binary.cpp
+++ b/core/io/resource_format_binary.cpp
@@ -1130,7 +1130,7 @@ void ResourceFormatLoaderBinary::get_dependencies(const String &p_path, List<Str
loader.get_dependencies(f, p_dependencies, p_add_types);
}
-Error ResourceFormatLoaderBinary::rename_dependencies(const String &p_path, const Map<String, String> &p_map) {
+Error ResourceFormatLoaderBinary::rename_dependencies(const String &p_path, const HashMap<String, String> &p_map) {
Ref<FileAccess> f = FileAccess::open(p_path, FileAccess::READ);
ERR_FAIL_COND_V_MSG(f.is_null(), ERR_CANT_OPEN, "Cannot open file '" + p_path + "'.");
@@ -1384,7 +1384,7 @@ void ResourceFormatSaverBinaryInstance::_pad_buffer(Ref<FileAccess> f, int p_byt
}
}
-void ResourceFormatSaverBinaryInstance::write_variant(Ref<FileAccess> f, const Variant &p_property, Map<Ref<Resource>, int> &resource_map, Map<Ref<Resource>, int> &external_resources, Map<StringName, int> &string_map, const PropertyInfo &p_hint) {
+void ResourceFormatSaverBinaryInstance::write_variant(Ref<FileAccess> f, const Variant &p_property, HashMap<Ref<Resource>, int> &resource_map, HashMap<Ref<Resource>, int> &external_resources, HashMap<StringName, int> &string_map, const PropertyInfo &p_hint) {
switch (p_property.get_type()) {
case Variant::NIL: {
f->store_32(VARIANT_NIL);
@@ -2022,7 +2022,7 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path, const Ref<Re
// save internal resource table
f->store_32(saved_resources.size()); //amount of internal resources
Vector<uint64_t> ofs_pos;
- Set<String> used_unique_ids;
+ RBSet<String> used_unique_ids;
for (Ref<Resource> &r : saved_resources) {
if (r->is_built_in()) {
@@ -2036,7 +2036,7 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path, const Ref<Re
}
}
- Map<Ref<Resource>, int> resource_map;
+ HashMap<Ref<Resource>, int> resource_map;
int res_index = 0;
for (Ref<Resource> &r : saved_resources) {
if (r->is_built_in()) {
diff --git a/core/io/resource_format_binary.h b/core/io/resource_format_binary.h
index 92d4e4eeaa..db29909dd5 100644
--- a/core/io/resource_format_binary.h
+++ b/core/io/resource_format_binary.h
@@ -75,12 +75,12 @@ class ResourceLoaderBinary {
};
Vector<IntResource> internal_resources;
- Map<String, Ref<Resource>> internal_index_cache;
+ HashMap<String, Ref<Resource>> internal_index_cache;
String get_unicode_string();
void _advance_padding(uint32_t p_len);
- Map<String, String> remaps;
+ HashMap<String, String> remaps;
Error error = OK;
ResourceFormatLoader::CacheMode cache_mode = ResourceFormatLoader::CACHE_MODE_REUSE;
@@ -89,7 +89,7 @@ class ResourceLoaderBinary {
Error parse_variant(Variant &r_v);
- Map<String, Ref<Resource>> dependency_cache;
+ HashMap<String, Ref<Resource>> dependency_cache;
public:
void set_local_path(const String &p_local_path);
@@ -97,7 +97,7 @@ public:
Error load();
void set_translation_remapped(bool p_remapped);
- void set_remaps(const Map<String, String> &p_remaps) { remaps = p_remaps; }
+ void set_remaps(const HashMap<String, String> &p_remaps) { remaps = p_remaps; }
void open(Ref<FileAccess> p_f, bool p_no_resources = false, bool p_keep_uuid_paths = false);
String recognize(Ref<FileAccess> p_f);
void get_dependencies(Ref<FileAccess> p_f, List<String> *p_dependencies, bool p_add_types);
@@ -114,7 +114,7 @@ public:
virtual String get_resource_type(const String &p_path) const;
virtual ResourceUID::ID get_resource_uid(const String &p_path) const;
virtual void get_dependencies(const String &p_path, List<String> *p_dependencies, bool p_add_types = false);
- virtual Error rename_dependencies(const String &p_path, const Map<String, String> &p_map);
+ virtual Error rename_dependencies(const String &p_path, const HashMap<String, String> &p_map);
};
class ResourceFormatSaverBinaryInstance {
@@ -127,7 +127,7 @@ class ResourceFormatSaverBinaryInstance {
bool big_endian;
bool takeover_paths;
String magic;
- Set<Ref<Resource>> resource_set;
+ RBSet<Ref<Resource>> resource_set;
struct NonPersistentKey { //for resource properties generated on the fly
Ref<Resource> base;
@@ -135,11 +135,11 @@ class ResourceFormatSaverBinaryInstance {
bool operator<(const NonPersistentKey &p_key) const { return base == p_key.base ? property < p_key.property : base < p_key.base; }
};
- Map<NonPersistentKey, Ref<Resource>> non_persistent_map;
- Map<StringName, int> string_map;
+ RBMap<NonPersistentKey, Ref<Resource>> non_persistent_map;
+ HashMap<StringName, int> string_map;
Vector<StringName> strings;
- Map<Ref<Resource>, int> external_resources;
+ HashMap<Ref<Resource>, int> external_resources;
List<Ref<Resource>> saved_resources;
struct Property {
@@ -168,7 +168,7 @@ public:
RESERVED_FIELDS = 11
};
Error save(const String &p_path, const Ref<Resource> &p_resource, uint32_t p_flags = 0);
- static void write_variant(Ref<FileAccess> f, const Variant &p_property, Map<Ref<Resource>, int> &resource_map, Map<Ref<Resource>, int> &external_resources, Map<StringName, int> &string_map, const PropertyInfo &p_hint = PropertyInfo());
+ static void write_variant(Ref<FileAccess> f, const Variant &p_property, HashMap<Ref<Resource>, int> &resource_map, HashMap<Ref<Resource>, int> &external_resources, HashMap<StringName, int> &string_map, const PropertyInfo &p_hint = PropertyInfo());
};
class ResourceFormatSaverBinary : public ResourceFormatSaver {
diff --git a/core/io/resource_importer.cpp b/core/io/resource_importer.cpp
index 984cf06d2b..5deee9721b 100644
--- a/core/io/resource_importer.cpp
+++ b/core/io/resource_importer.cpp
@@ -139,7 +139,7 @@ Ref<Resource> ResourceFormatImporter::load(const String &p_path, const String &p
}
void ResourceFormatImporter::get_recognized_extensions(List<String> *p_extensions) const {
- Set<String> found;
+ RBSet<String> found;
for (int i = 0; i < importers.size(); i++) {
List<String> local_exts;
@@ -159,7 +159,7 @@ void ResourceFormatImporter::get_recognized_extensions_for_type(const String &p_
return;
}
- Set<String> found;
+ RBSet<String> found;
for (int i = 0; i < importers.size(); i++) {
String res_type = importers[i]->get_resource_type();
diff --git a/core/io/resource_importer.h b/core/io/resource_importer.h
index b3d777847b..0c7909df06 100644
--- a/core/io/resource_importer.h
+++ b/core/io/resource_importer.h
@@ -134,15 +134,15 @@ public:
virtual String get_preset_name(int p_idx) const { return String(); }
virtual void get_import_options(const String &p_path, List<ImportOption> *r_options, int p_preset = 0) const = 0;
- virtual bool get_option_visibility(const String &p_path, const String &p_option, const Map<StringName, Variant> &p_options) const = 0;
+ virtual bool get_option_visibility(const String &p_path, const String &p_option, const HashMap<StringName, Variant> &p_options) const = 0;
virtual String get_option_group_file() const { return String(); }
- virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = nullptr, Variant *r_metadata = nullptr) = 0;
+ virtual Error import(const String &p_source_file, const String &p_save_path, const HashMap<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = nullptr, Variant *r_metadata = nullptr) = 0;
virtual bool can_import_threaded() const { return true; }
virtual void import_threaded_begin() {}
virtual void import_threaded_end() {}
- virtual Error import_group_file(const String &p_group_file, const Map<String, Map<StringName, Variant>> &p_source_file_options, const Map<String, String> &p_base_paths) { return ERR_UNAVAILABLE; }
+ virtual Error import_group_file(const String &p_group_file, const HashMap<String, HashMap<StringName, Variant>> &p_source_file_options, const HashMap<String, String> &p_base_paths) { return ERR_UNAVAILABLE; }
virtual bool are_import_settings_valid(const String &p_path) const { return true; }
virtual String get_import_settings_string() const { return String(); }
};
diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp
index d125dd4e91..9e6330f34b 100644
--- a/core/io/resource_loader.cpp
+++ b/core/io/resource_loader.cpp
@@ -154,7 +154,7 @@ void ResourceFormatLoader::get_dependencies(const String &p_path, List<String> *
}
}
-Error ResourceFormatLoader::rename_dependencies(const String &p_path, const Map<String, String> &p_map) {
+Error ResourceFormatLoader::rename_dependencies(const String &p_path, const HashMap<String, String> &p_map) {
Dictionary deps_dict;
for (KeyValue<String, String> E : p_map) {
deps_dict[E.key] = E.value;
@@ -391,7 +391,7 @@ float ResourceLoader::_dependency_get_progress(const String &p_path) {
int dep_count = load_task.sub_tasks.size();
if (dep_count > 0) {
float dep_progress = 0;
- for (Set<String>::Element *E = load_task.sub_tasks.front(); E; E = E->next()) {
+ for (RBSet<String>::Element *E = load_task.sub_tasks.front(); E; E = E->next()) {
dep_progress += _dependency_get_progress(E->get());
}
dep_progress /= float(dep_count);
@@ -733,7 +733,7 @@ void ResourceLoader::get_dependencies(const String &p_path, List<String> *p_depe
}
}
-Error ResourceLoader::rename_dependencies(const String &p_path, const Map<String, String> &p_map) {
+Error ResourceLoader::rename_dependencies(const String &p_path, const HashMap<String, String> &p_map) {
String local_path = _path_remap(_validate_local_path(p_path));
for (int i = 0; i < loader_count; i++) {
diff --git a/core/io/resource_loader.h b/core/io/resource_loader.h
index ea18ac23fd..e189ad1dff 100644
--- a/core/io/resource_loader.h
+++ b/core/io/resource_loader.h
@@ -70,7 +70,7 @@ public:
virtual String get_resource_type(const String &p_path) const;
virtual ResourceUID::ID get_resource_uid(const String &p_path) const;
virtual void get_dependencies(const String &p_path, List<String> *p_dependencies, bool p_add_types = false);
- virtual Error rename_dependencies(const String &p_path, const Map<String, String> &p_map);
+ virtual Error rename_dependencies(const String &p_path, const HashMap<String, String> &p_map);
virtual bool is_import_valid(const String &p_path) const { return true; }
virtual bool is_imported(const String &p_path) const { return false; }
virtual int get_import_order(const String &p_path) const { return 0; }
@@ -145,7 +145,7 @@ private:
bool start_next = true;
int requests = 0;
int poll_requests = 0;
- Set<String> sub_tasks;
+ RBSet<String> sub_tasks;
};
static void _thread_load_function(void *p_userdata);
@@ -173,7 +173,7 @@ public:
static String get_resource_type(const String &p_path);
static ResourceUID::ID get_resource_uid(const String &p_path);
static void get_dependencies(const String &p_path, List<String> *p_dependencies, bool p_add_types = false);
- static Error rename_dependencies(const String &p_path, const Map<String, String> &p_map);
+ static Error rename_dependencies(const String &p_path, const HashMap<String, String> &p_map);
static bool is_import_valid(const String &p_path);
static String get_import_group_file(const String &p_path);
static bool is_imported(const String &p_path);