diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/error_list.h | 2 | ||||
-rw-r--r-- | core/global_constants.cpp | 1 | ||||
-rw-r--r-- | core/object.h | 5 | ||||
-rw-r--r-- | core/os/dir_access.cpp | 3 | ||||
-rw-r--r-- | core/os/file_access.h | 2 | ||||
-rw-r--r-- | core/resource.cpp | 29 | ||||
-rw-r--r-- | core/resource.h | 1 | ||||
-rw-r--r-- | core/ustring.cpp | 2 |
8 files changed, 37 insertions, 8 deletions
diff --git a/core/error_list.h b/core/error_list.h index 50d248b3d0..9a36b27aab 100644 --- a/core/error_list.h +++ b/core/error_list.h @@ -87,8 +87,6 @@ enum Error { ERR_HELP, ///< user requested help!! ERR_BUG, ///< a bug in the software certainly happened, due to a double check failing or unexpected behavior. ERR_PRINTER_ON_FIRE, /// the parallel port printer is engulfed in flames - ERR_OMFG_THIS_IS_VERY_VERY_BAD, ///< shit happens, has never been used, though - ERR_WTF = ERR_OMFG_THIS_IS_VERY_VERY_BAD ///< short version of the above }; #endif diff --git a/core/global_constants.cpp b/core/global_constants.cpp index 48101c8cf1..fb432b85db 100644 --- a/core/global_constants.cpp +++ b/core/global_constants.cpp @@ -491,7 +491,6 @@ void register_global_constants() { BIND_GLOBAL_ENUM_CONSTANT(ERR_BUSY); BIND_GLOBAL_ENUM_CONSTANT(ERR_HELP); ///< user requested help!! BIND_GLOBAL_ENUM_CONSTANT(ERR_BUG); ///< a bug in the software certainly happened ), due to a double check failing or unexpected behavior. - BIND_GLOBAL_ENUM_CONSTANT(ERR_WTF); BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_NONE); BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_RANGE); diff --git a/core/object.h b/core/object.h index 3ac699f978..0a0c781649 100644 --- a/core/object.h +++ b/core/object.h @@ -1,4 +1,4 @@ -/*************************************************************************/ +/*************************************************************************/ /* object.h */ /*************************************************************************/ /* This file is part of: */ @@ -109,10 +109,11 @@ enum PropertyUsageFlags { PROPERTY_USAGE_SCRIPT_DEFAULT_VALUE = 1 << 17, PROPERTY_USAGE_CLASS_IS_ENUM = 1 << 18, PROPERTY_USAGE_NIL_IS_VARIANT = 1 << 19, + PROPERTY_USAGE_INTERNAL = 1 << 20, PROPERTY_USAGE_DEFAULT = PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_NETWORK, PROPERTY_USAGE_DEFAULT_INTL = PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_NETWORK | PROPERTY_USAGE_INTERNATIONALIZED, - PROPERTY_USAGE_NOEDITOR = PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_NETWORK, + PROPERTY_USAGE_NOEDITOR = PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_NETWORK | PROPERTY_USAGE_INTERNAL, }; #define ADD_SIGNAL(m_signal) ClassDB::add_signal(get_class_static(), m_signal) diff --git a/core/os/dir_access.cpp b/core/os/dir_access.cpp index 6d4b46f4da..e19c8e8ea5 100644 --- a/core/os/dir_access.cpp +++ b/core/os/dir_access.cpp @@ -333,6 +333,9 @@ Error DirAccess::copy(String p_from, String p_to, int chmod_flags) { if (err == OK && chmod_flags != -1) { fdst->close(); err = fdst->_chmod(p_to, chmod_flags); + // If running on a platform with no chmod support (i.e., Windows), don't fail + if (err == ERR_UNAVAILABLE) + err = OK; } memdelete(fsrc); diff --git a/core/os/file_access.h b/core/os/file_access.h index 455dd1ea99..6fda3d9668 100644 --- a/core/os/file_access.h +++ b/core/os/file_access.h @@ -141,7 +141,7 @@ public: virtual Error reopen(const String &p_path, int p_mode_flags); ///< does not change the AccessType - virtual Error _chmod(const String &p_path, int p_mod) { return FAILED; } + virtual Error _chmod(const String &p_path, int p_mod) { return ERR_UNAVAILABLE; } static FileAccess *create(AccessType p_access); /// Create a file access (for the current platform) this is the only portable way of accessing files. static FileAccess *create_for_path(const String &p_path); diff --git a/core/resource.cpp b/core/resource.cpp index 78e20bada4..d339eb78ad 100644 --- a/core/resource.cpp +++ b/core/resource.cpp @@ -184,6 +184,35 @@ Ref<Resource> Resource::duplicate_for_local_scene(Node *p_for_scene, Map<Ref<Res return Ref<Resource>(r); } +void Resource::configure_for_local_scene(Node *p_for_scene, Map<Ref<Resource>, Ref<Resource> > &remap_cache) { + + print_line("configure for local: " + get_class()); + List<PropertyInfo> plist; + get_property_list(&plist); + + local_scene = p_for_scene; + + for (List<PropertyInfo>::Element *E = plist.front(); E; E = E->next()) { + + if (!(E->get().usage & PROPERTY_USAGE_STORAGE)) + continue; + Variant p = get(E->get().name); + if (p.get_type() == Variant::OBJECT) { + + RES sr = p; + if (sr.is_valid()) { + + if (sr->is_local_to_scene()) { + if (!remap_cache.has(sr)) { + sr->configure_for_local_scene(p_for_scene, remap_cache); + remap_cache[sr] = sr; + } + } + } + } + } +} + Ref<Resource> Resource::duplicate(bool p_subresources) const { List<PropertyInfo> plist; diff --git a/core/resource.h b/core/resource.h index 7dc3b67291..19714a68d1 100644 --- a/core/resource.h +++ b/core/resource.h @@ -108,6 +108,7 @@ public: virtual Ref<Resource> duplicate(bool p_subresources = false) const; Ref<Resource> duplicate_for_local_scene(Node *p_for_scene, Map<Ref<Resource>, Ref<Resource> > &remap_cache); + void configure_for_local_scene(Node *p_for_scene, Map<Ref<Resource>, Ref<Resource> > &remap_cache); void set_local_to_scene(bool p_enable); bool is_local_to_scene() const; diff --git a/core/ustring.cpp b/core/ustring.cpp index a86fb46c8a..3a0708851e 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -3380,8 +3380,6 @@ bool String::is_valid_float() const { from++; } - //this was pulled out of my ass, i wonder if it's correct... - bool exponent_found = false; bool period_found = false; bool sign_found = false; |