diff options
author | reduz <reduzio@gmail.com> | 2022-02-12 10:57:51 +0100 |
---|---|---|
committer | reduz <reduzio@gmail.com> | 2022-02-12 10:57:51 +0100 |
commit | 97feafd0ea67580c91c699ed58d771cc80842e32 (patch) | |
tree | bdb947819a945667296cbe1b85143f36fc371911 /core/io/resource_format_binary.cpp | |
parent | b99fad040d77719f5852e644a85a1488b65d7811 (diff) | |
download | redot-engine-97feafd0ea67580c91c699ed58d771cc80842e32.tar.gz |
Fix resource reuse in binary loader
* Reuse was not setting the internal index.
* Supersedes #52599, without re-reading all properties.
Diffstat (limited to 'core/io/resource_format_binary.cpp')
-rw-r--r-- | core/io/resource_format_binary.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index 8588bab0be..ed58b4be7b 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -678,11 +678,13 @@ Error ResourceLoaderBinary::load() { internal_resources.write[i].path = path; // Update path. } - if (cache_mode == ResourceFormatLoader::CACHE_MODE_REUSE) { - if (ResourceCache::has(path)) { + if (cache_mode == ResourceFormatLoader::CACHE_MODE_REUSE && ResourceCache::has(path)) { + RES cached = ResourceCache::get(path); + if (cached.is_valid()) { //already loaded, don't do anything stage++; error = OK; + internal_index_cache[path] = cached; continue; } } |