File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -229,9 +229,9 @@ class Ref {
229229template <class T >
230230struct PtrToArg <Ref<T>> {
231231 _FORCE_INLINE_ static Ref<T> convert (const void *p_ptr) {
232- // Important: p_ptr is T*, not Ref<T>*, since Object* is what engine gives to ptrcall.
232+ GDExtensionRefPtr ref = (GDExtensionRefPtr)p_ptr;
233233 ERR_FAIL_NULL_V (p_ptr, Ref<T>());
234- return Ref<T>(reinterpret_cast <T *>(godot::internal::get_object_instance_binding (reinterpret_cast <GDExtensionObjectPtr>( const_cast < void *>(p_ptr) ))));
234+ return Ref<T>(reinterpret_cast <T *>(godot::internal::get_object_instance_binding (godot::internal::gdextension_interface_ref_get_object (ref ))));
235235 }
236236
237237 typedef Ref<T> EncodeT;
@@ -253,8 +253,9 @@ struct PtrToArg<const Ref<T> &> {
253253 typedef Ref<T> EncodeT;
254254
255255 _FORCE_INLINE_ static Ref<T> convert (const void *p_ptr) {
256+ GDExtensionRefPtr ref = const_cast <GDExtensionRefPtr>(p_ptr);
256257 ERR_FAIL_NULL_V (p_ptr, Ref<T>());
257- return Ref<T>(reinterpret_cast <T *>(godot::internal::get_object_instance_binding (reinterpret_cast <GDExtensionObjectPtr>( const_cast < void *>(p_ptr) ))));
258+ return Ref<T>(reinterpret_cast <T *>(godot::internal::get_object_instance_binding (godot::internal::gdextension_interface_ref_get_object (ref ))));
258259 }
259260};
260261
Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ MAKE_PTRARG_BY_REFERENCE(Variant);
169169template <class T >
170170struct PtrToArg <T *> {
171171 _FORCE_INLINE_ static T *convert (const void *p_ptr) {
172- return reinterpret_cast <T *>(godot::internal::get_object_instance_binding (reinterpret_cast <GDExtensionObjectPtr>(const_cast <void *>(p_ptr))));
172+ return reinterpret_cast <T *>(godot::internal::get_object_instance_binding (* reinterpret_cast <GDExtensionObjectPtr * >(const_cast <void *>(p_ptr))));
173173 }
174174 typedef Object *EncodeT;
175175 _FORCE_INLINE_ static void encode (T *p_var, void *p_ptr) {
@@ -180,7 +180,7 @@ struct PtrToArg<T *> {
180180template <class T >
181181struct PtrToArg <const T *> {
182182 _FORCE_INLINE_ static const T *convert (const void *p_ptr) {
183- return reinterpret_cast <const T *>(godot::internal::get_object_instance_binding (reinterpret_cast <GDExtensionObjectPtr>(const_cast <void *>(p_ptr))));
183+ return reinterpret_cast <const T *>(godot::internal::get_object_instance_binding (* reinterpret_cast <GDExtensionObjectPtr * >(const_cast <void *>(p_ptr))));
184184 }
185185 typedef const Object *EncodeT;
186186 _FORCE_INLINE_ static void encode (T *p_var, void *p_ptr) {
You can’t perform that action at this time.
0 commit comments