diff options
| author | Juan Linietsky | 2016-05-27 14:18:40 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2016-05-27 14:19:11 -0300 |
| commit | 8be2fabbe5cd846bac5e5a38e55f3fb70e73f2da (patch) | |
| tree | a3e932282cdafdd13c4f02bdf21f72f9846adcbe /core/resource.cpp | |
| parent | eb7227a20b27e91c6e2adfb1ded738f2dd7e453b (diff) | |
| download | godot-8be2fabbe5cd846bac5e5a38e55f3fb70e73f2da.tar.gz godot-8be2fabbe5cd846bac5e5a38e55f3fb70e73f2da.tar.zst godot-8be2fabbe5cd846bac5e5a38e55f3fb70e73f2da.zip | |
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 672e64b1b..b7a5bad4b 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!="") |
