summaryrefslogtreecommitdiff
path: root/core/resource.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/resource.cpp')
-rw-r--r--core/resource.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/core/resource.cpp b/core/resource.cpp
index e0706cf541..672e64b1bb 100644
--- a/core/resource.cpp
+++ b/core/resource.cpp
@@ -156,14 +156,14 @@ void Resource::_resource_path_changed() {
}
-
+
void Resource::set_path(const String& p_path, bool p_take_over) {
if (path_cache==p_path)
return;
-
+
if (path_cache!="") {
-
+
ResourceCache::resources.erase(path_cache);
}
@@ -179,19 +179,19 @@ void Resource::set_path(const String& p_path, bool p_take_over) {
}
path_cache=p_path;
-
+
if (path_cache!="") {
-
+
ResourceCache::resources[path_cache]=this;;
}
_change_notify("resource/path");
_resource_path_changed();
-
+
}
String Resource::get_path() const {
-
+
return path_cache;
}
@@ -342,7 +342,7 @@ Resource::Resource() {
Resource::~Resource() {
-
+
if (path_cache!="")
ResourceCache::resources.erase(path_cache);
if (owners.size()) {
@@ -350,12 +350,12 @@ Resource::~Resource() {
}
}
-HashMap<String,Resource*> ResourceCache::resources;
+HashMap<String,Resource*> ResourceCache::resources;
void ResourceCache::clear() {
if (resources.size())
ERR_PRINT("Resources Still in use at Exit!");
-
+
resources.clear();
}
@@ -374,18 +374,18 @@ void ResourceCache::reload_externals() {
bool ResourceCache::has(const String& p_path) {
GLOBAL_LOCK_FUNCTION
-
+
return resources.has(p_path);
}
Resource *ResourceCache::get(const String& p_path) {
-
+
GLOBAL_LOCK_FUNCTION
-
+
Resource **res = resources.getptr(p_path);
if (!res) {
return NULL;
}
-
+
return *res;
}