1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

Replace BIND_VMETHOD by new GDVIRTUAL syntax

* New syntax is type safe.
* New syntax allows for type safe virtuals in native extensions.
* New syntax permits extremely fast calling.

Note: Everything was replaced where possible except for `_gui_input` `_input` and `_unhandled_input`.
These will require API rework on a separate PR as they work different than the rest of the functions.

Added a new method flag METHOD_FLAG_OBJECT_CORE, used internally. Allows to not dump the core virtuals like `_notification` to the json API, since each language will implement those as it is best fits.
This commit is contained in:
reduz
2021-08-21 22:52:44 -03:00
parent 2a5c64f2a1
commit 3682978aee
104 changed files with 1389 additions and 1227 deletions

View File

@@ -70,14 +70,15 @@ const int MAX_FLOAT_CONST_DEFS = sizeof(float_constant_defs) / sizeof(FloatConst
///////////////////
Control *VisualShaderNodePlugin::create_editor(const Ref<Resource> &p_parent_resource, const Ref<VisualShaderNode> &p_node) {
if (get_script_instance()) {
return get_script_instance()->call("_create_editor", p_parent_resource, p_node);
Object *ret;
if (GDVIRTUAL_CALL(_create_editor, p_parent_resource, p_node, ret)) {
return Object::cast_to<Control>(ret);
}
return nullptr;
}
void VisualShaderNodePlugin::_bind_methods() {
BIND_VMETHOD(MethodInfo(Variant::OBJECT, "_create_editor", PropertyInfo(Variant::OBJECT, "parent_resource", PROPERTY_HINT_RESOURCE_TYPE, "Resource"), PropertyInfo(Variant::OBJECT, "for_node", PROPERTY_HINT_RESOURCE_TYPE, "VisualShaderNode")));
GDVIRTUAL_BIND(_create_editor, "parent_resource", "visual_shader_node");
}
///////////////////