diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-11-25 15:10:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-25 15:10:32 +0100 |
commit | c5451468cf09cc7d3f9d3018072b41125d921db1 (patch) | |
tree | 787848c9d1d78fc47a9a6cffe1de148c329e84e4 /core/variant/method_ptrcall.h | |
parent | 8c713fa9bf1084ddb9b48802b61f9818d57a622e (diff) | |
parent | d76806d322c4618f703347751f36feb35ef2d9f2 (diff) |
Merge pull request #43854 from akien-mga/ptrcall-always-on
Core: Always enable ptrcall, remove PTRCALL_ENABLED define
Diffstat (limited to 'core/variant/method_ptrcall.h')
-rw-r--r-- | core/variant/method_ptrcall.h | 26 |
1 files changed, 8 insertions, 18 deletions
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 <class T> -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 <class T> struct PtrToArg<T *> { @@ -170,7 +167,7 @@ struct PtrToArg<const T *> { } }; -//this is for ObjectID +// This is for ObjectID. template <> struct PtrToArg<ObjectID> { @@ -183,7 +180,7 @@ struct PtrToArg<ObjectID> { } }; -//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<ObjectID> { 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<Vector<m_type>> { \ @@ -429,6 +419,7 @@ struct PtrToArg<Vector<Face3>> { } } }; + template <> struct PtrToArg<const Vector<Face3> &> { _FORCE_INLINE_ static Vector<Face3> convert(const void *p_ptr) { @@ -450,4 +441,3 @@ struct PtrToArg<const Vector<Face3> &> { }; #endif // METHOD_PTRCALL_H -#endif |