diff options
author | A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> | 2024-01-30 12:00:36 +0100 |
---|---|---|
committer | A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> | 2024-03-13 22:40:09 +0100 |
commit | 0c19d0f5a0b525c0056253e70d971eefda7a9d28 (patch) | |
tree | 8b829e4ce5c452ee696d1f6a16b9693a166d9704 /core/extension | |
parent | da945ce6266ce27ba63b6b08dc0eb2414594f7cb (diff) | |
download | redot-engine-0c19d0f5a0b525c0056253e70d971eefda7a9d28.tar.gz |
Add extension support for argument count to `ScriptInstance`
Diffstat (limited to 'core/extension')
-rw-r--r-- | core/extension/gdextension_interface.cpp | 2 | ||||
-rw-r--r-- | core/extension/gdextension_interface.h | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/core/extension/gdextension_interface.cpp b/core/extension/gdextension_interface.cpp index ca58d589bd..9b4aa98357 100644 --- a/core/extension/gdextension_interface.cpp +++ b/core/extension/gdextension_interface.cpp @@ -1302,6 +1302,7 @@ static GDExtensionScriptInstancePtr gdextension_script_instance_create(const GDE info_3->get_property_type_func = p_info->get_property_type_func; info_3->validate_property_func = nullptr; info_3->has_method_func = p_info->has_method_func; + info_3->get_method_argument_count_func = nullptr; info_3->call_func = p_info->call_func; info_3->notification_func = nullptr; info_3->to_string_func = p_info->to_string_func; @@ -1341,6 +1342,7 @@ static GDExtensionScriptInstancePtr gdextension_script_instance_create2(const GD info_3->get_property_type_func = p_info->get_property_type_func; info_3->validate_property_func = nullptr; info_3->has_method_func = p_info->has_method_func; + info_3->get_method_argument_count_func = nullptr; info_3->call_func = p_info->call_func; info_3->notification_func = p_info->notification_func; info_3->to_string_func = p_info->to_string_func; diff --git a/core/extension/gdextension_interface.h b/core/extension/gdextension_interface.h index c863507019..e9c570e994 100644 --- a/core/extension/gdextension_interface.h +++ b/core/extension/gdextension_interface.h @@ -535,6 +535,8 @@ typedef void (*GDExtensionScriptInstanceFreeMethodList2)(GDExtensionScriptInstan typedef GDExtensionBool (*GDExtensionScriptInstanceHasMethod)(GDExtensionScriptInstanceDataPtr p_instance, GDExtensionConstStringNamePtr p_name); +typedef GDExtensionInt (*GDExtensionScriptInstanceGetMethodArgumentCount)(GDExtensionScriptInstanceDataPtr p_instance, GDExtensionConstStringNamePtr p_name, GDExtensionBool *r_is_valid); + typedef void (*GDExtensionScriptInstanceCall)(GDExtensionScriptInstanceDataPtr p_self, GDExtensionConstStringNamePtr p_method, const GDExtensionConstVariantPtr *p_args, GDExtensionInt p_argument_count, GDExtensionVariantPtr r_return, GDExtensionCallError *r_error); typedef void (*GDExtensionScriptInstanceNotification)(GDExtensionScriptInstanceDataPtr p_instance, int32_t p_what); // Deprecated. Use GDExtensionScriptInstanceNotification2 instead. typedef void (*GDExtensionScriptInstanceNotification2)(GDExtensionScriptInstanceDataPtr p_instance, int32_t p_what, GDExtensionBool p_reversed); @@ -654,6 +656,8 @@ typedef struct { GDExtensionScriptInstanceHasMethod has_method_func; + GDExtensionScriptInstanceGetMethodArgumentCount get_method_argument_count_func; + GDExtensionScriptInstanceCall call_func; GDExtensionScriptInstanceNotification2 notification_func; |