Merge pull request #81026 from Razoric480/raz/use_resource_cache
[3.x] Make binary resource loader utilize loaded external resources
This commit is contained in:
commit
47e64671f6
1 changed files with 12 additions and 1 deletions
|
@ -339,7 +339,18 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
|
||||||
path = ProjectSettings::get_singleton()->localize_path(res_path.get_base_dir().plus_file(path));
|
path = ProjectSettings::get_singleton()->localize_path(res_path.get_base_dir().plus_file(path));
|
||||||
}
|
}
|
||||||
|
|
||||||
RES res = ResourceLoader::load(path, exttype, no_subresource_cache);
|
RES res;
|
||||||
|
|
||||||
|
for (List<RES>::Element *E = resource_cache.front(); E; E = E->next()) {
|
||||||
|
if (E->get()->get_path() == path) {
|
||||||
|
res = E->get();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (res.is_null()) {
|
||||||
|
res = ResourceLoader::load(path, exttype, no_subresource_cache);
|
||||||
|
}
|
||||||
|
|
||||||
if (res.is_null()) {
|
if (res.is_null()) {
|
||||||
WARN_PRINT(String("Couldn't load resource: " + path).utf8().get_data());
|
WARN_PRINT(String("Couldn't load resource: " + path).utf8().get_data());
|
||||||
|
|
Loading…
Reference in a new issue