From d76806d322c4618f703347751f36feb35ef2d9f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 25 Nov 2020 14:08:17 +0100 Subject: Core: Always enable ptrcall, remove PTRCALL_ENABLED define ptrcall is now also used to optimize calls in GDScript, on top of the existing use by the GDNative and Mono modules. It no longer makes sense to make it optional. --- core/variant/method_ptrcall.h | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) (limited to 'core/variant/method_ptrcall.h') diff --git a/core/variant/method_ptrcall.h b/core/variant/method_ptrcall.h index 936de145f8..40fa3543dc 100644 --- a/core/variant/method_ptrcall.h +++ b/core/variant/method_ptrcall.h @@ -36,11 +36,8 @@ #include "core/typedefs.h" #include "core/variant/variant.h" -#ifdef PTRCALL_ENABLED - template -struct PtrToArg { -}; +struct PtrToArg {}; #define MAKE_PTRARG(m_type) \ template <> \ @@ -146,7 +143,7 @@ MAKE_PTRARG(PackedVector3Array); MAKE_PTRARG(PackedColorArray); MAKE_PTRARG_BY_REFERENCE(Variant); -//this is for Object +// This is for Object. template struct PtrToArg { @@ -170,7 +167,7 @@ struct PtrToArg { } }; -//this is for ObjectID +// This is for ObjectID. template <> struct PtrToArg { @@ -183,7 +180,7 @@ struct PtrToArg { } }; -//this is for the special cases used by Variant +// This is for the special cases used by Variant. #define MAKE_VECARG(m_type) \ template <> \ @@ -274,18 +271,11 @@ struct PtrToArg { return ret; \ } \ } -/* -MAKE_VECARG(String); -MAKE_VECARG(uint8_t); -MAKE_VECARG(int); -MAKE_VECARG(float); -MAKE_VECARG(Vector2); -MAKE_VECARG(Vector3); -MAKE_VECARG(Color); -*/ + MAKE_VECARG_ALT(String, StringName); -//for stuff that gets converted to Array vectors +// For stuff that gets converted to Array vectors. + #define MAKE_VECARR(m_type) \ template <> \ struct PtrToArg> { \ @@ -429,6 +419,7 @@ struct PtrToArg> { } } }; + template <> struct PtrToArg &> { _FORCE_INLINE_ static Vector convert(const void *p_ptr) { @@ -450,4 +441,3 @@ struct PtrToArg &> { }; #endif // METHOD_PTRCALL_H -#endif -- cgit v1.2.3