Properly set up virtual calls for extensions
This commit is contained in:
parent
fcfea84d5e
commit
3b593b596e
|
@ -154,6 +154,7 @@ void NativeExtension::_register_extension_class(const GDNativeExtensionClassLibr
|
|||
extension->native_extension.create_instance = p_extension_funcs->create_instance_func;
|
||||
extension->native_extension.set_object_instance = p_extension_funcs->object_instance_func;
|
||||
extension->native_extension.free_instance = p_extension_funcs->free_instance_func;
|
||||
extension->native_extension.get_virtual = p_extension_funcs->get_virtual_func;
|
||||
|
||||
ClassDB::register_extension_class(&extension->native_extension);
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
proto = """
|
||||
#define GDVIRTUAL$VER($RET m_name $ARG) \\
|
||||
GDNativeExtensionClassCallVirtual _gdvirtual_##m_name = (_get_extension() && _get_extension()->get_virtual) ? _get_extension()->get_virtual(_get_extension()->class_userdata, #m_name) : (GDNativeExtensionClassCallVirtual) nullptr;\\
|
||||
StringName _gdvirtual_##m_name##_sn = #m_name;\\
|
||||
bool _gdvirtual_##m_name##_call($CALLARGS) $CONST { \\
|
||||
GDNativeExtensionClassCallVirtual _gdvirtual_##m_name = (_get_extension() && _get_extension()->get_virtual) ? _get_extension()->get_virtual(_get_extension()->class_userdata, #m_name) : (GDNativeExtensionClassCallVirtual) nullptr;\\
|
||||
ScriptInstance *script_instance = ((Object*)(this))->get_script_instance();\\
|
||||
if (script_instance) {\\
|
||||
Callable::CallError ce; \\
|
||||
|
|
Loading…
Reference in New Issue