diff options
Diffstat (limited to 'core/resource.cpp')
-rw-r--r-- | core/resource.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/core/resource.cpp b/core/resource.cpp index 672e64b1bb..b7a5bad4b8 100644 --- a/core/resource.cpp +++ b/core/resource.cpp @@ -330,6 +330,31 @@ Ref<ResourceImportMetadata> Resource::get_import_metadata() const { } +#ifdef TOOLS_ENABLED + +uint32_t Resource::hash_edited_version() const { + + uint32_t hash = hash_djb2_one_32(get_edited_version()); + + List<PropertyInfo> plist; + get_property_list(&plist); + + for (List<PropertyInfo>::Element *E=plist.front();E;E=E->next()) { + + if (E->get().type==Variant::OBJECT && E->get().hint==PROPERTY_HINT_RESOURCE_TYPE) { + RES res = get(E->get().name); + if (res.is_valid()) { + hash = hash_djb2_one_32(res->hash_edited_version(),hash); + } + } + } + + return hash; + +} + +#endif + Resource::Resource() { @@ -341,6 +366,8 @@ Resource::Resource() { } + + Resource::~Resource() { if (path_cache!="") |