feat: modules moved and engine moved to submodule
This commit is contained in:
parent
dfb5e645cd
commit
c33d2130cc
5136 changed files with 225275 additions and 64485 deletions
|
|
@ -115,10 +115,19 @@ TypedArray<Dictionary> convert_property_list(const List<PropertyInfo> *p_list) {
|
|||
return va;
|
||||
}
|
||||
|
||||
TypedArray<Dictionary> convert_property_list(const Vector<PropertyInfo> &p_vector) {
|
||||
TypedArray<Dictionary> va;
|
||||
for (const PropertyInfo &E : p_vector) {
|
||||
va.push_back(Dictionary(E));
|
||||
}
|
||||
|
||||
return va;
|
||||
}
|
||||
|
||||
MethodInfo::operator Dictionary() const {
|
||||
Dictionary d;
|
||||
d["name"] = name;
|
||||
d["args"] = convert_property_list(&arguments);
|
||||
d["args"] = convert_property_list(arguments);
|
||||
Array da;
|
||||
for (int i = 0; i < default_arguments.size(); i++) {
|
||||
da.push_back(default_arguments[i]);
|
||||
|
|
@ -240,21 +249,15 @@ void Object::cancel_free() {
|
|||
}
|
||||
|
||||
void Object::_initialize() {
|
||||
_class_name_ptr = _get_class_namev(); // Set the direct pointer, which is much faster to obtain, but can only happen after _initialize.
|
||||
// Cache the class name in the object for quick reference.
|
||||
_class_name_ptr = _get_class_namev();
|
||||
_initialize_classv();
|
||||
_class_name_ptr = nullptr; // May have been called from a constructor.
|
||||
}
|
||||
|
||||
void Object::_postinitialize() {
|
||||
notification(NOTIFICATION_POSTINITIALIZE);
|
||||
}
|
||||
|
||||
void Object::get_valid_parents_static(List<String> *p_parents) {
|
||||
}
|
||||
|
||||
void Object::_get_valid_parents_static(List<String> *p_parents) {
|
||||
}
|
||||
|
||||
void Object::set(const StringName &p_name, const Variant &p_value, bool *r_valid) {
|
||||
#ifdef TOOLS_ENABLED
|
||||
|
||||
|
|
@ -902,18 +905,14 @@ Variant Object::call_const(const StringName &p_method, const Variant **p_args, i
|
|||
return ret;
|
||||
}
|
||||
|
||||
void Object::notification(int p_notification, bool p_reversed) {
|
||||
if (p_reversed) {
|
||||
if (script_instance) {
|
||||
script_instance->notification(p_notification, p_reversed);
|
||||
}
|
||||
} else {
|
||||
_notificationv(p_notification, p_reversed);
|
||||
}
|
||||
void Object::_notification_forward(int p_notification) {
|
||||
// Notify classes starting with Object and ending with most derived subclass.
|
||||
// e.g. Object -> Node -> Node3D
|
||||
_notification_forwardv(p_notification);
|
||||
|
||||
if (_extension) {
|
||||
if (_extension->notification2) {
|
||||
_extension->notification2(_extension_instance, p_notification, static_cast<GDExtensionBool>(p_reversed));
|
||||
_extension->notification2(_extension_instance, p_notification, static_cast<GDExtensionBool>(false));
|
||||
#ifndef DISABLE_DEPRECATED
|
||||
} else if (_extension->notification) {
|
||||
_extension->notification(_extension_instance, p_notification);
|
||||
|
|
@ -921,13 +920,29 @@ void Object::notification(int p_notification, bool p_reversed) {
|
|||
}
|
||||
}
|
||||
|
||||
if (p_reversed) {
|
||||
_notificationv(p_notification, p_reversed);
|
||||
} else {
|
||||
if (script_instance) {
|
||||
script_instance->notification(p_notification, p_reversed);
|
||||
if (script_instance) {
|
||||
script_instance->notification(p_notification, false);
|
||||
}
|
||||
}
|
||||
|
||||
void Object::_notification_backward(int p_notification) {
|
||||
if (script_instance) {
|
||||
script_instance->notification(p_notification, true);
|
||||
}
|
||||
|
||||
if (_extension) {
|
||||
if (_extension->notification2) {
|
||||
_extension->notification2(_extension_instance, p_notification, static_cast<GDExtensionBool>(true));
|
||||
#ifndef DISABLE_DEPRECATED
|
||||
} else if (_extension->notification) {
|
||||
_extension->notification(_extension_instance, p_notification);
|
||||
#endif // DISABLE_DEPRECATED
|
||||
}
|
||||
}
|
||||
|
||||
// Notify classes starting with most derived subclass and ending in Object.
|
||||
// e.g. Node3D -> Node -> Object
|
||||
_notification_backwardv(p_notification);
|
||||
}
|
||||
|
||||
String Object::to_string() {
|
||||
|
|
@ -1080,8 +1095,8 @@ TypedArray<Dictionary> Object::_get_method_list_bind() const {
|
|||
get_method_list(&ml);
|
||||
TypedArray<Dictionary> ret;
|
||||
|
||||
for (List<MethodInfo>::Element *E = ml.front(); E; E = E->next()) {
|
||||
Dictionary d = E->get();
|
||||
for (const MethodInfo &mi : ml) {
|
||||
Dictionary d = mi;
|
||||
//va.push_back(d);
|
||||
ret.push_back(d);
|
||||
}
|
||||
|
|
@ -1575,7 +1590,7 @@ void Object::initialize_class() {
|
|||
if (initialized) {
|
||||
return;
|
||||
}
|
||||
ClassDB::_add_class<Object>();
|
||||
_add_class_to_classdb(get_class_static(), StringName());
|
||||
_bind_methods();
|
||||
_bind_compatibility_methods();
|
||||
initialized = true;
|
||||
|
|
@ -1640,12 +1655,10 @@ void Object::_clear_internal_resource_paths(const Variant &p_var) {
|
|||
} break;
|
||||
case Variant::DICTIONARY: {
|
||||
Dictionary d = p_var;
|
||||
List<Variant> keys;
|
||||
d.get_key_list(&keys);
|
||||
|
||||
for (const Variant &E : keys) {
|
||||
_clear_internal_resource_paths(E);
|
||||
_clear_internal_resource_paths(d[E]);
|
||||
for (const KeyValue<Variant, Variant> &kv : d) {
|
||||
_clear_internal_resource_paths(kv.key);
|
||||
_clear_internal_resource_paths(kv.value);
|
||||
}
|
||||
} break;
|
||||
default: {
|
||||
|
|
@ -1653,9 +1666,20 @@ void Object::_clear_internal_resource_paths(const Variant &p_var) {
|
|||
}
|
||||
}
|
||||
|
||||
void Object::_add_class_to_classdb(const StringName &p_class, const StringName &p_inherits) {
|
||||
ClassDB::_add_class(p_class, p_inherits);
|
||||
}
|
||||
|
||||
void Object::_get_property_list_from_classdb(const StringName &p_class, List<PropertyInfo> *p_list, bool p_no_inheritance, const Object *p_validator) {
|
||||
ClassDB::get_property_list(p_class, p_list, p_no_inheritance, p_validator);
|
||||
}
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
void Object::editor_set_section_unfold(const String &p_section, bool p_unfolded) {
|
||||
set_edited(true);
|
||||
void Object::editor_set_section_unfold(const String &p_section, bool p_unfolded, bool p_initializing) {
|
||||
if (!p_initializing) {
|
||||
set_edited(true);
|
||||
}
|
||||
|
||||
if (p_unfolded) {
|
||||
editor_section_folding.insert(p_section);
|
||||
} else {
|
||||
|
|
@ -1878,7 +1902,7 @@ Variant::Type Object::get_static_property_type(const StringName &p_property, boo
|
|||
}
|
||||
|
||||
Variant::Type Object::get_static_property_type_indexed(const Vector<StringName> &p_path, bool *r_valid) const {
|
||||
if (p_path.size() == 0) {
|
||||
if (p_path.is_empty()) {
|
||||
if (r_valid) {
|
||||
*r_valid = false;
|
||||
}
|
||||
|
|
@ -1945,6 +1969,20 @@ uint32_t Object::get_edited_version() const {
|
|||
}
|
||||
#endif
|
||||
|
||||
const StringName &Object::get_class_name() const {
|
||||
if (_extension) {
|
||||
// Can't put inside the unlikely as constructor can run it.
|
||||
return _extension->class_name;
|
||||
}
|
||||
|
||||
if (unlikely(!_class_name_ptr)) {
|
||||
// While class is initializing / deinitializing, constructors and destructors
|
||||
// need access to the proper class at the proper stage.
|
||||
return *_get_class_namev();
|
||||
}
|
||||
return *_class_name_ptr;
|
||||
}
|
||||
|
||||
StringName Object::get_class_name_for_extension(const GDExtension *p_library) const {
|
||||
#ifdef TOOLS_ENABLED
|
||||
// If this is the library this extension comes from and it's a placeholder, we
|
||||
|
|
@ -2092,7 +2130,6 @@ void Object::clear_internal_extension() {
|
|||
// Clear the virtual methods.
|
||||
while (virtual_method_list) {
|
||||
(*virtual_method_list->method) = nullptr;
|
||||
(*virtual_method_list->initialized) = false;
|
||||
virtual_method_list = virtual_method_list->next;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue