You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Add ValidatedCall to MethodBind
* This should optimize GDScript function calling _enormously_. * It also should simplify the GDScript VM considerably. NOTE: GDExtension calling performance has most likely been affected until going via ptrcall is fixed.
This commit is contained in:
@@ -317,6 +317,17 @@ String Variant::get_constructor_argument_name(Variant::Type p_type, int p_constr
|
||||
return construct_data[p_type][p_constructor].arg_names[p_argument];
|
||||
}
|
||||
|
||||
void VariantInternal::refcounted_object_assign(Variant *v, const RefCounted *rc) {
|
||||
if (!rc || !const_cast<RefCounted *>(rc)->init_ref()) {
|
||||
v->_get_obj().obj = nullptr;
|
||||
v->_get_obj().id = ObjectID();
|
||||
return;
|
||||
}
|
||||
|
||||
v->_get_obj().obj = const_cast<RefCounted *>(rc);
|
||||
v->_get_obj().id = rc->get_instance_id();
|
||||
}
|
||||
|
||||
void VariantInternal::object_assign(Variant *v, const Object *o) {
|
||||
if (o) {
|
||||
if (o->is_ref_counted()) {
|
||||
|
||||
Reference in New Issue
Block a user