aboutsummaryrefslogtreecommitdiff
path: root/core/method_bind.h
diff options
context:
space:
mode:
authorIgnacio Etcheverry2017-08-20 17:45:01 +0200
committerIgnacio Etcheverry2017-08-20 22:07:43 +0200
commit32dd9a9f668db31e348c5ef5bc181cdb91c07299 (patch)
tree66d9628611d85ca80f314ee9a65777880ee5ef11 /core/method_bind.h
parentf6c39830cb7cf0d664bdfa25642b333a1249b96f (diff)
downloadgodot-32dd9a9f668db31e348c5ef5bc181cdb91c07299.tar.gz
godot-32dd9a9f668db31e348c5ef5bc181cdb91c07299.tar.zst
godot-32dd9a9f668db31e348c5ef5bc181cdb91c07299.zip
Diffstat (limited to 'core/method_bind.h')
-rw-r--r--core/method_bind.h26
1 files changed, 25 insertions, 1 deletions
diff --git a/core/method_bind.h b/core/method_bind.h
index 9bf032373..157a67ca2 100644
--- a/core/method_bind.h
+++ b/core/method_bind.h
@@ -124,6 +124,9 @@ struct VariantCaster<const T &> {
#endif
+// Object enum casts must go here
+VARIANT_ENUM_CAST(Object::ConnectFlags);
+
#define CHECK_ARG(m_arg) \
if ((m_arg - 1) < p_arg_count) { \
Variant::Type argtype = get_argument_type(m_arg - 1); \
@@ -148,14 +151,35 @@ struct VariantCaster<const T &> {
VARIANT_ENUM_CAST(Vector3::Axis);
VARIANT_ENUM_CAST(Error);
-VARIANT_ENUM_CAST(wchar_t);
VARIANT_ENUM_CAST(Margin);
VARIANT_ENUM_CAST(Corner);
VARIANT_ENUM_CAST(Orientation);
VARIANT_ENUM_CAST(HAlign);
+VARIANT_ENUM_CAST(VAlign);
+VARIANT_ENUM_CAST(PropertyHint);
+VARIANT_ENUM_CAST(PropertyUsageFlags);
+VARIANT_ENUM_CAST(MethodFlags);
VARIANT_ENUM_CAST(Variant::Type);
VARIANT_ENUM_CAST(Variant::Operator);
+template <>
+struct VariantCaster<wchar_t> {
+ static _FORCE_INLINE_ wchar_t cast(const Variant &p_variant) {
+ return (wchar_t)p_variant.operator int();
+ }
+};
+#ifdef PTRCALL_ENABLED
+template <>
+struct PtrToArg<wchar_t> {
+ _FORCE_INLINE_ static wchar_t convert(const void *p_ptr) {
+ return wchar_t(*reinterpret_cast<const int *>(p_ptr));
+ }
+ _FORCE_INLINE_ static void encode(wchar_t p_val, const void *p_ptr) {
+ *(int *)p_ptr = p_val;
+ }
+};
+#endif
+
class MethodBind {
int method_id;