Merge pull request #677 from lukas-toenne/fix_object_ptr_args
Fixed pointer indirection in the PtrToArg template for Object arguments.pull/798/head
commit
8d4de1b537
|
@ -240,7 +240,7 @@ public:
|
||||||
template <class T>
|
template <class T>
|
||||||
struct PtrToArg<Ref<T>> {
|
struct PtrToArg<Ref<T>> {
|
||||||
_FORCE_INLINE_ static Ref<T> convert(const void *p_ptr) {
|
_FORCE_INLINE_ static Ref<T> convert(const void *p_ptr) {
|
||||||
return Ref<T>(godot::internal::gdn_interface->object_get_instance_binding((void *)p_ptr, godot::internal::token, &T::___binding_callbacks));
|
return Ref<T>(reinterpret_cast<T*>(godot::internal::gdn_interface->object_get_instance_binding(*(const GDNativeObjectPtr *)p_ptr, godot::internal::token, &T::___binding_callbacks)));
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef Ref<T> EncodeT;
|
typedef Ref<T> EncodeT;
|
||||||
|
@ -255,7 +255,7 @@ struct PtrToArg<const Ref<T> &> {
|
||||||
typedef Ref<T> EncodeT;
|
typedef Ref<T> EncodeT;
|
||||||
|
|
||||||
_FORCE_INLINE_ static Ref<T> convert(const void *p_ptr) {
|
_FORCE_INLINE_ static Ref<T> convert(const void *p_ptr) {
|
||||||
return Ref<T>(godot::internal::gdn_interface->object_get_instance_binding((void *)p_ptr, godot::internal::token, &T::___binding_callbacks));
|
return Ref<T>(reinterpret_cast<T*>(godot::internal::gdn_interface->object_get_instance_binding(*(const GDNativeObjectPtr *)p_ptr, godot::internal::token, &T::___binding_callbacks)));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -168,7 +168,7 @@ MAKE_PTRARG_BY_REFERENCE(Variant);
|
||||||
template <class T>
|
template <class T>
|
||||||
struct PtrToArg<T *> {
|
struct PtrToArg<T *> {
|
||||||
_FORCE_INLINE_ static T *convert(const void *p_ptr) {
|
_FORCE_INLINE_ static T *convert(const void *p_ptr) {
|
||||||
return reinterpret_cast<T *>(godot::internal::gdn_interface->object_get_instance_binding((void *)p_ptr, godot::internal::token, &T::___binding_callbacks));
|
return reinterpret_cast<T *>(godot::internal::gdn_interface->object_get_instance_binding(*(const GDNativeObjectPtr *)p_ptr, godot::internal::token, &T::___binding_callbacks));
|
||||||
}
|
}
|
||||||
typedef Object *EncodeT;
|
typedef Object *EncodeT;
|
||||||
_FORCE_INLINE_ static void encode(T *p_var, void *p_ptr) {
|
_FORCE_INLINE_ static void encode(T *p_var, void *p_ptr) {
|
||||||
|
@ -179,7 +179,7 @@ struct PtrToArg<T *> {
|
||||||
template <class T>
|
template <class T>
|
||||||
struct PtrToArg<const T *> {
|
struct PtrToArg<const T *> {
|
||||||
_FORCE_INLINE_ static const T *convert(const void *p_ptr) {
|
_FORCE_INLINE_ static const T *convert(const void *p_ptr) {
|
||||||
return reinterpret_cast<const T *>(godot::internal::gdn_interface->object_get_instance_binding((void *)p_ptr, godot::internal::token, &T::___binding_callbacks));
|
return reinterpret_cast<const T *>(godot::internal::gdn_interface->object_get_instance_binding(*(const GDNativeObjectPtr *)p_ptr, godot::internal::token, &T::___binding_callbacks));
|
||||||
}
|
}
|
||||||
typedef const Object *EncodeT;
|
typedef const Object *EncodeT;
|
||||||
_FORCE_INLINE_ static void encode(T *p_var, void *p_ptr) {
|
_FORCE_INLINE_ static void encode(T *p_var, void *p_ptr) {
|
||||||
|
|
Loading…
Reference in New Issue