summaryrefslogtreecommitdiffstats
path: root/include/godot_cpp/classes/ref.hpp
diff options
context:
space:
mode:
authorDavid Snopek <dsnopek@gmail.com>2023-05-24 21:17:12 -0500
committerGitHub <noreply@github.com>2023-05-24 21:17:12 -0500
commit8052f818b47c163d3e0a19b13282d909ebfa55f2 (patch)
tree52ec76b9da866251232b46599710a64d54a81dd9 /include/godot_cpp/classes/ref.hpp
parent08bc2ef680cd8b536519d7f59c6f760e96a3d0a8 (diff)
parent431e30bc3273c83315725f56365845f0b89c0524 (diff)
downloadredot-cpp-8052f818b47c163d3e0a19b13282d909ebfa55f2.tar.gz
Merge pull request #1050 from dsnopek/object-correct-class
Ensure GDExtension class is the correct type for the Godot engine class
Diffstat (limited to 'include/godot_cpp/classes/ref.hpp')
-rw-r--r--include/godot_cpp/classes/ref.hpp8
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)))));
}
};