diff options
Diffstat (limited to 'core/object/object.h')
-rw-r--r-- | core/object/object.h | 37 |
1 files changed, 10 insertions, 27 deletions
diff --git a/core/object/object.h b/core/object/object.h index adb50268d2..6d22f320af 100644 --- a/core/object/object.h +++ b/core/object/object.h @@ -86,6 +86,7 @@ enum PropertyHint { PROPERTY_HINT_HIDE_QUATERNION_EDIT, /// Only Node3D::transform should hide the quaternion editor. PROPERTY_HINT_PASSWORD, PROPERTY_HINT_LAYERS_AVOIDANCE, + PROPERTY_HINT_DICTIONARY_TYPE, PROPERTY_HINT_MAX, }; @@ -350,7 +351,10 @@ struct ObjectGDExtension { } void *class_userdata = nullptr; +#ifndef DISABLE_DEPRECATED GDExtensionClassCreateInstance create_instance; +#endif // DISABLE_DEPRECATED + GDExtensionClassCreateInstance2 create_instance2; GDExtensionClassFreeInstance free_instance; GDExtensionClassGetVirtual get_virtual; GDExtensionClassGetVirtualCallData get_virtual_call_data; @@ -384,18 +388,6 @@ struct ObjectGDExtension { * much alone defines the object model. */ -#define REVERSE_GET_PROPERTY_LIST \ -public: \ - _FORCE_INLINE_ bool _is_gpl_reversed() const { return true; }; \ - \ -private: - -#define UNREVERSE_GET_PROPERTY_LIST \ -public: \ - _FORCE_INLINE_ bool _is_gpl_reversed() const { return false; }; \ - \ -private: - #define GDCLASS(m_class, m_inherits) \ private: \ void operator=(const m_class &p_rval) {} \ @@ -507,15 +499,10 @@ protected: m_inherits::_get_property_listv(p_list, p_reversed); \ } \ p_list->push_back(PropertyInfo(Variant::NIL, get_class_static(), PROPERTY_HINT_NONE, get_class_static(), PROPERTY_USAGE_CATEGORY)); \ - if (!_is_gpl_reversed()) { \ - ::ClassDB::get_property_list(#m_class, p_list, true, this); \ - } \ + ::ClassDB::get_property_list(#m_class, p_list, true, this); \ if (m_class::_get_get_property_list() != m_inherits::_get_get_property_list()) { \ _get_property_list(p_list); \ } \ - if (_is_gpl_reversed()) { \ - ::ClassDB::get_property_list(#m_class, p_list, true, this); \ - } \ if (p_reversed) { \ m_inherits::_get_property_listv(p_list, p_reversed); \ } \ @@ -632,6 +619,7 @@ private: int _predelete_ok = 0; ObjectID _instance_id; bool _predelete(); + void _initialize(); void _postinitialize(); bool _can_translate = true; bool _emitting = false; @@ -680,7 +668,7 @@ protected: _FORCE_INLINE_ bool _instance_binding_reference(bool p_reference) { bool can_die = true; if (_instance_bindings) { - _instance_binding_mutex.lock(); + MutexLock instance_binding_lock(_instance_binding_mutex); for (uint32_t i = 0; i < _instance_binding_count; i++) { if (_instance_bindings[i].reference_callback) { if (!_instance_bindings[i].reference_callback(_instance_bindings[i].token, _instance_bindings[i].binding, p_reference)) { @@ -688,7 +676,6 @@ protected: } } } - _instance_binding_mutex.unlock(); } return can_die; } @@ -706,11 +693,7 @@ protected: virtual void _notificationv(int p_notification, bool p_reversed) {} static void _bind_methods(); -#ifndef DISABLE_DEPRECATED - static void _bind_compatibility_methods(); -#else static void _bind_compatibility_methods() {} -#endif bool _set(const StringName &p_name, const Variant &p_property) { return false; }; bool _get(const StringName &p_name, Variant &r_property) const { return false; }; void _get_property_list(List<PropertyInfo> *p_list) const {}; @@ -795,8 +778,6 @@ public: return &ptr; } - bool _is_gpl_reversed() const { return false; } - void detach_from_objectdb(); _FORCE_INLINE_ ObjectID get_instance_id() const { return _instance_id; } @@ -883,7 +864,8 @@ public: argptrs[i] = &args[i]; } Callable::CallError cerr; - return callp(p_method, sizeof...(p_args) == 0 ? nullptr : (const Variant **)argptrs, sizeof...(p_args), cerr); + const Variant ret = callp(p_method, sizeof...(p_args) == 0 ? nullptr : (const Variant **)argptrs, sizeof...(p_args), cerr); + return (cerr.error == Callable::CallError::CALL_OK) ? ret : Variant(); } void notification(int p_notification, bool p_reversed = false); @@ -910,6 +892,7 @@ public: MTVIRTUAL void remove_meta(const StringName &p_name); MTVIRTUAL Variant get_meta(const StringName &p_name, const Variant &p_default = Variant()) const; MTVIRTUAL void get_meta_list(List<StringName> *p_list) const; + MTVIRTUAL void merge_meta_from(const Object *p_src); #ifdef TOOLS_ENABLED void set_edited(bool p_edited); |