diff options
author | Juan Linietsky <reduzio@gmail.com> | 2014-06-27 23:21:45 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2014-06-27 23:21:45 -0300 |
commit | 2af2a84a03fd707cfa4c682aff34d722343d8985 (patch) | |
tree | 50d064e8bba7d5efb5974e3fa3a67e076fb5ef8b /core/resource.cpp | |
parent | 1cc96a4d7440d9e8a20f7dbf17cf5771170de83d (diff) | |
download | redot-engine-2af2a84a03fd707cfa4c682aff34d722343d8985.tar.gz |
Misc Fixes
==========
-NOTIFICATION_WM_QUIT fixed on android (seems tha way this is reported changed in newer sdk)
-WIP implementation of APK Expansion APIs for publishing games larger than 50mb in Play Store
-Feaures in the new tutorials are all present in the sourcecode
-This (hopefully) should get rid of the animation list order getting corrupted
-Improved 3D Scene Importer (Skeletons, Animations and other stuff were not being merged). Anything missing?
-In code editor, the automatic syntax checker will only use file_exists() to check preload() else it might freeze the editor too much while typing if the preload is a big resource
-Fixed bugs in PolygonPathFinder, stil pending to do a node and a demo
Diffstat (limited to 'core/resource.cpp')
-rw-r--r-- | core/resource.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/core/resource.cpp b/core/resource.cpp index f07c37fb06..ccfeaa6bb9 100644 --- a/core/resource.cpp +++ b/core/resource.cpp @@ -157,7 +157,7 @@ void Resource::_resource_path_changed() { } -void Resource::set_path(const String& p_path) { +void Resource::set_path(const String& p_path, bool p_take_over) { if (path_cache==p_path) return; @@ -168,7 +168,16 @@ void Resource::set_path(const String& p_path) { } path_cache=""; - ERR_FAIL_COND( ResourceCache::resources.has( p_path ) ); + if (ResourceCache::resources.has( p_path )) { + if (p_take_over) { + + ResourceCache::resources.get(p_path)->set_name(""); + } else { + ERR_EXPLAIN("Another resource is loaded from path: "+p_path); + ERR_FAIL_COND( ResourceCache::resources.has( p_path ) ); + } + + } path_cache=p_path; if (path_cache!="") { @@ -240,7 +249,7 @@ void Resource::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_path","path"),&Resource::set_path); ObjectTypeDB::bind_method(_MD("get_path"),&Resource::get_path); - ObjectTypeDB::bind_method(_MD("set_name","name"),&Resource::set_name); + ObjectTypeDB::bind_method(_MD("set_name","name","take_over"),&Resource::set_name,DEFVAL(false)); ObjectTypeDB::bind_method(_MD("get_name"),&Resource::get_name); ObjectTypeDB::bind_method(_MD("get_rid"),&Resource::get_rid); ObjectTypeDB::bind_method(_MD("set_import_metadata","metadata"),&Resource::set_import_metadata); |