From 44d62a9f4b6ac892b1fb9b8998be4162409952e3 Mon Sep 17 00:00:00 2001 From: reduz Date: Mon, 23 Aug 2021 14:53:27 -0300 Subject: Implement NativeExtension pointer arguments * Allows calling into native extensions directly with a pointer * Makes it easier to implement some APIs more efficiently * Appears with a "*" in the documentation for the argument. * Implementing the pointer handling is entirely up to the implementation, although the extension API provides some hint. * AudioStream has been implemented as an example, allowing to create NativeExtension based AudioStreams. --- core/object/make_virtuals.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'core/object/make_virtuals.py') diff --git a/core/object/make_virtuals.py b/core/object/make_virtuals.py index af90593140..65a421cfb2 100644 --- a/core/object/make_virtuals.py +++ b/core/object/make_virtuals.py @@ -2,7 +2,7 @@ proto = """ #define GDVIRTUAL$VER($RET m_name $ARG) \\ StringName _gdvirtual_##m_name##_sn = #m_name;\\ GDNativeExtensionClassCallVirtual _gdvirtual_##m_name = (_get_extension() && _get_extension()->get_virtual) ? _get_extension()->get_virtual(_get_extension()->class_userdata, #m_name) : (GDNativeExtensionClassCallVirtual) nullptr;\\ -bool _gdvirtual_##m_name##_call($CALLARGS) $CONST { \\ +_FORCE_INLINE_ bool _gdvirtual_##m_name##_call($CALLARGS) $CONST { \\ ScriptInstance *script_instance = ((Object*)(this))->get_script_instance();\\ if (script_instance) {\\ Callable::CallError ce; \\ @@ -23,7 +23,7 @@ bool _gdvirtual_##m_name##_call($CALLARGS) $CONST { \\ \\ return false;\\ }\\ -bool _gdvirtual_##m_name##_overriden() const { \\ +_FORCE_INLINE_ bool _gdvirtual_##m_name##_overriden() const { \\ ScriptInstance *script_instance = ((Object*)(this))->get_script_instance();\\ if (script_instance) {\\ return script_instance->has_method(_gdvirtual_##m_name##_sn);\\ @@ -42,7 +42,6 @@ _FORCE_INLINE_ static MethodInfo _gdvirtual_##m_name##_get_method_info() { \\ return method_info;\\ } - """ -- cgit v1.2.3