diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-09-26 12:45:42 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-09-26 12:45:42 +0200 |
commit | 2912cb99756dede609548503eeb3f6f1a2f2dfbf (patch) | |
tree | b1c092f0ae2943ae5cfa1161f1442d2cbd91102f /core/io/file_access_pack.cpp | |
parent | 991e6c92abd26435169ad7ea0df2622685cac6d1 (diff) | |
parent | d3be030ea6f3e295603ccf6cc9080a1d32051332 (diff) | |
download | redot-engine-2912cb99756dede609548503eeb3f6f1a2f2dfbf.tar.gz |
Merge pull request #97118 from mihe/patch-exports
Add ability to export patch packs
Diffstat (limited to 'core/io/file_access_pack.cpp')
-rw-r--r-- | core/io/file_access_pack.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/core/io/file_access_pack.cpp b/core/io/file_access_pack.cpp index eec27ce0aa..1340382eaa 100644 --- a/core/io/file_access_pack.cpp +++ b/core/io/file_access_pack.cpp @@ -102,6 +102,22 @@ void PackedData::add_pack_source(PackSource *p_source) { } } +uint8_t *PackedData::get_file_hash(const String &p_path) { + PathMD5 pmd5(p_path.md5_buffer()); + HashMap<PathMD5, PackedFile, PathMD5>::Iterator E = files.find(pmd5); + if (!E || E->value.offset == 0) { + return nullptr; + } + + return E->value.md5; +} + +void PackedData::clear() { + files.clear(); + _free_packed_dirs(root); + root = memnew(PackedDir); +} + PackedData *PackedData::singleton = nullptr; PackedData::PackedData() { |