mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Enhance cache modes in resource loading
- Unify documentation, hoping to clear misconcepctions about about propagation of the cache mode across dependant loads. - Clarify in docs that `CACHE_MODE_REPLACE` now also works on the main resource (from #87008). - Add two recursive modes, counterparts of `CACHE_MODE_REPLACE` and `CACHE_MODE_IGNORE`, since it seems some need them (see #59669, #82830). - Let resources, even loaded with one of the ignore-cache modes, get a path, which is useful for tools.
This commit is contained in:
parent
bb6b06c813
commit
5e144022e7
15 changed files with 104 additions and 28 deletions
|
@ -2854,6 +2854,7 @@ Ref<Resource> ResourceFormatLoaderCSharpScript::load(const String &p_path, const
|
|||
Ref<Resource> existing = ResourceCache::get_ref(p_path);
|
||||
switch (p_cache_mode) {
|
||||
case ResourceFormatLoader::CACHE_MODE_IGNORE:
|
||||
case ResourceFormatLoader::CACHE_MODE_IGNORE_DEEP:
|
||||
break;
|
||||
case ResourceFormatLoader::CACHE_MODE_REUSE:
|
||||
if (existing.is_null()) {
|
||||
|
@ -2863,6 +2864,7 @@ Ref<Resource> ResourceFormatLoaderCSharpScript::load(const String &p_path, const
|
|||
}
|
||||
break;
|
||||
case ResourceFormatLoader::CACHE_MODE_REPLACE:
|
||||
case ResourceFormatLoader::CACHE_MODE_REPLACE_DEEP:
|
||||
scr->set_path(p_original_path, true);
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue