diff options
| author | Juan Linietsky <reduzio@gmail.com> | 2016-06-22 23:12:20 -0300 |
|---|---|---|
| committer | Juan Linietsky <reduzio@gmail.com> | 2016-06-22 23:13:41 -0300 |
| commit | d6225b1e0004c57cc50452ddb5d512fd6556a523 (patch) | |
| tree | eeb6169dcc735c6b66052581b81bb5a71b466509 /core/math/bsp_tree.h | |
| parent | 842e7bfc2f81cda73fd9f16a1ade323a1a5d0292 (diff) | |
| download | redot-engine-d6225b1e0004c57cc50452ddb5d512fd6556a523.tar.gz | |
Improved binding system (ObjectTypeDB::bind_method) to be friendlier to statically typed languages, should help in the Mono integration.
Disabled by default.
Diffstat (limited to 'core/math/bsp_tree.h')
| -rw-r--r-- | core/math/bsp_tree.h | 27 |
1 files changed, 26 insertions, 1 deletions
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 <reduzio@gmail.com> */ @@ -138,4 +138,29 @@ bool BSP_Tree::convex_is_inside(const T& p_convex) const { } +#ifdef PTRCALL_ENABLED + + +template<> +struct PtrToArg<BSP_Tree> { + _FORCE_INLINE_ static BSP_Tree convert(const void* p_ptr) { + BSP_Tree s( Variant( *reinterpret_cast<const Dictionary*>(p_ptr) ) ); + return s; + } + _FORCE_INLINE_ static void encode(BSP_Tree p_val,void* p_ptr) { + Dictionary *d = reinterpret_cast<Dictionary*>(p_ptr); + *d=Variant(p_val); + } +}; + +template<> +struct PtrToArg<const BSP_Tree&> { + _FORCE_INLINE_ static BSP_Tree convert(const void* p_ptr) { + BSP_Tree s( Variant( *reinterpret_cast<const Dictionary*>(p_ptr) ) ); + return s; + } +}; + +#endif + #endif |
