summaryrefslogtreecommitdiffstats
path: root/core/io/resource.h
diff options
context:
space:
mode:
authorreduz <reduzio@gmail.com>2021-02-11 14:18:45 -0300
committerreduz <reduzio@gmail.com>2021-02-11 15:44:28 -0300
commitf8d03b98e7eeeb726af4f653f1fde8b063cbad14 (patch)
tree69b180a08d668e49aceca16ff9067c70da00f0ea /core/io/resource.h
parente5bb89cdd5e92fa6fdeff78aad08bf0cbfbcc692 (diff)
downloadredot-engine-f8d03b98e7eeeb726af4f653f1fde8b063cbad14.tar.gz
Improve resource load cache
-Added a new method in Resource: reset_state , used for reloading the same resource from disk -Added a new cache mode "replace" in ResourceLoader, which reuses existing loaded sub-resources but resets their data from disk (or replaces them if they chaged type) -Because the correct sub-resource paths are always loaded now, this fixes bugs with subresource folding or subresource ordering when saving.
Diffstat (limited to 'core/io/resource.h')
-rw-r--r--core/io/resource.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/io/resource.h b/core/io/resource.h
index d0cd6ea3ac..ae18ac0c8a 100644
--- a/core/io/resource.h
+++ b/core/io/resource.h
@@ -90,6 +90,8 @@ public:
static Node *(*_get_local_scene_func)(); //used by editor
virtual bool editor_can_reload_from_file();
+ virtual void reset_state(); //for resources that use variable amount of properties, either via _validate_property or _get_property_list, this function needs to be implemented to correctly clear state
+ virtual Error copy_from(const Ref<Resource> &p_resource);
virtual void reload_from_file();
void register_owner(Object *p_owner);