From d6225b1e0004c57cc50452ddb5d512fd6556a523 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Wed, 22 Jun 2016 23:12:20 -0300 Subject: Improved binding system (ObjectTypeDB::bind_method) to be friendlier to statically typed languages, should help in the Mono integration. Disabled by default. --- core/math/bsp_tree.h | 27 ++++++++++++++++++++++++++- core/math/face3.h | 2 ++ 2 files changed, 28 insertions(+), 1 deletion(-) (limited to 'core/math') diff --git a/core/math/bsp_tree.h b/core/math/bsp_tree.h index 2bfc26b51e..6c36d80e3e 100644 --- a/core/math/bsp_tree.h +++ b/core/math/bsp_tree.h @@ -34,8 +34,8 @@ #include "face3.h" #include "vector.h" #include "dvector.h" - #include "variant.h" +#include "method_ptrcall.h" /** @author Juan Linietsky */ @@ -138,4 +138,29 @@ bool BSP_Tree::convex_is_inside(const T& p_convex) const { } +#ifdef PTRCALL_ENABLED + + +template<> +struct PtrToArg { + _FORCE_INLINE_ static BSP_Tree convert(const void* p_ptr) { + BSP_Tree s( Variant( *reinterpret_cast(p_ptr) ) ); + return s; + } + _FORCE_INLINE_ static void encode(BSP_Tree p_val,void* p_ptr) { + Dictionary *d = reinterpret_cast(p_ptr); + *d=Variant(p_val); + } +}; + +template<> +struct PtrToArg { + _FORCE_INLINE_ static BSP_Tree convert(const void* p_ptr) { + BSP_Tree s( Variant( *reinterpret_cast(p_ptr) ) ); + return s; + } +}; + +#endif + #endif diff --git a/core/math/face3.h b/core/math/face3.h index bc34be9935..3a81da74db 100644 --- a/core/math/face3.h +++ b/core/math/face3.h @@ -264,4 +264,6 @@ bool Face3::intersects_aabb2(const AABB& p_aabb) const { } +//this sucks... + #endif // FACE3_H -- cgit v1.2.3