diff options
| author | David Snopek <dsnopek@gmail.com> | 2023-02-17 10:49:09 -0600 |
|---|---|---|
| committer | David Snopek <dsnopek@gmail.com> | 2023-05-16 15:18:48 -0500 |
| commit | 431e30bc3273c83315725f56365845f0b89c0524 (patch) | |
| tree | e0fa53d1327a6816665513568676110444ef30b4 /include/godot_cpp/classes | |
| parent | 1c18413de00f1a6265b2b6c30175b2f6a434b574 (diff) | |
| download | redot-cpp-431e30bc3273c83315725f56365845f0b89c0524.tar.gz | |
Ensure GDExtension class is the correct type for the Godot engine class
Diffstat (limited to 'include/godot_cpp/classes')
| -rw-r--r-- | include/godot_cpp/classes/ref.hpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/include/godot_cpp/classes/ref.hpp b/include/godot_cpp/classes/ref.hpp index 301f847..5c10e59 100644 --- a/include/godot_cpp/classes/ref.hpp +++ b/include/godot_cpp/classes/ref.hpp @@ -242,9 +242,7 @@ struct PtrToArg<Ref<T>> { _FORCE_INLINE_ static Ref<T> convert(const void *p_ptr) { // Important: p_ptr is T*, not Ref<T>*, since Object* is what engine gives to ptrcall. ERR_FAIL_NULL_V(p_ptr, Ref<T>()); - return Ref<T>(reinterpret_cast<T *>(godot::internal::gdextension_interface_object_get_instance_binding( - reinterpret_cast<GDExtensionObjectPtr>(const_cast<void *>(p_ptr)), - godot::internal::token, &T::___binding_callbacks))); + return Ref<T>(reinterpret_cast<T *>(godot::internal::get_object_instance_binding(reinterpret_cast<GDExtensionObjectPtr>(const_cast<void *>(p_ptr))))); } typedef Ref<T> EncodeT; @@ -267,9 +265,7 @@ struct PtrToArg<const Ref<T> &> { _FORCE_INLINE_ static Ref<T> convert(const void *p_ptr) { ERR_FAIL_NULL_V(p_ptr, Ref<T>()); - return Ref<T>(reinterpret_cast<T *>(godot::internal::gdextension_interface_object_get_instance_binding( - reinterpret_cast<GDExtensionObjectPtr>(const_cast<void *>(p_ptr)), - godot::internal::token, &T::___binding_callbacks))); + return Ref<T>(reinterpret_cast<T *>(godot::internal::get_object_instance_binding(reinterpret_cast<GDExtensionObjectPtr>(const_cast<void *>(p_ptr))))); } }; |
