diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2021-07-24 17:18:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-24 17:18:12 +0200 |
commit | 2b1e6e303ed6b0e2ca408f2156b745e711c2bab7 (patch) | |
tree | 0ec902365a812d3cd8c449cd3983df48e10feb1a /core/io/resource_format_binary.h | |
parent | 96d7bc62af25b85b8b9cc091eeea1e7a784ba624 (diff) | |
parent | 32b43cfeb38dc83ba8024acec32bdfc706c86a46 (diff) | |
download | redot-engine-2b1e6e303ed6b0e2ca408f2156b745e711c2bab7.tar.gz |
Merge pull request #50786 from reduz/implement-resource-uids
Implement Resource UIDs
Diffstat (limited to 'core/io/resource_format_binary.h')
-rw-r--r-- | core/io/resource_format_binary.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/core/io/resource_format_binary.h b/core/io/resource_format_binary.h index e3dcf44492..ac964d2053 100644 --- a/core/io/resource_format_binary.h +++ b/core/io/resource_format_binary.h @@ -47,6 +47,8 @@ class ResourceLoaderBinary { uint64_t importmd_ofs = 0; + ResourceUID::ID uid = ResourceUID::INVALID_ID; + Vector<char> str_buf; List<RES> resource_cache; @@ -57,10 +59,12 @@ class ResourceLoaderBinary { struct ExtResource { String path; String type; + ResourceUID::ID uid = ResourceUID::INVALID_ID; RES cache; }; bool using_named_scene_ids = false; + bool using_uids = false; bool use_sub_threads = false; float *progress = nullptr; Vector<ExtResource> external_resources; @@ -94,7 +98,7 @@ public: void set_translation_remapped(bool p_remapped); void set_remaps(const Map<String, String> &p_remaps) { remaps = p_remaps; } - void open(FileAccess *p_f); + void open(FileAccess *p_f, bool p_no_resources = false, bool p_keep_uuid_paths = false); String recognize(FileAccess *p_f); void get_dependencies(FileAccess *p_f, List<String> *p_dependencies, bool p_add_types); @@ -109,6 +113,7 @@ public: virtual void get_recognized_extensions(List<String> *p_extensions) const; virtual bool handles_type(const String &p_type) const; 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); }; @@ -157,7 +162,8 @@ class ResourceFormatSaverBinaryInstance { public: enum { - FORMAT_FLAG_NAMED_SCENE_IDS = 1 + FORMAT_FLAG_NAMED_SCENE_IDS = 1, + FORMAT_FLAG_UIDS = 2, }; Error save(const String &p_path, const RES &p_resource, uint32_t p_flags = 0); static void write_variant(FileAccess *f, const Variant &p_property, Map<RES, int> &resource_map, Map<RES, int> &external_resources, Map<StringName, int> &string_map, const PropertyInfo &p_hint = PropertyInfo()); |