summaryrefslogtreecommitdiffstats
path: root/core/io/resource_format_binary.cpp
diff options
context:
space:
mode:
authorreduz <reduzio@gmail.com>2022-02-12 10:57:51 +0100
committerreduz <reduzio@gmail.com>2022-02-12 10:57:51 +0100
commit97feafd0ea67580c91c699ed58d771cc80842e32 (patch)
treebdb947819a945667296cbe1b85143f36fc371911 /core/io/resource_format_binary.cpp
parentb99fad040d77719f5852e644a85a1488b65d7811 (diff)
downloadredot-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.cpp6
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;
}
}