diff options
author | Haoyu Qiu <timothyqiu32@gmail.com> | 2020-01-02 16:31:43 +0800 |
---|---|---|
committer | Haoyu Qiu <timothyqiu32@gmail.com> | 2020-01-02 21:37:26 +0800 |
commit | 4d727f1ee6b970298a7c1752ba19b49d7060c405 (patch) | |
tree | 6e0047b351930f36a8ef569b71ff263e3a04f989 /core/method_bind.h | |
parent | 1788b22b118db02ed57487c62157f83ab73b4165 (diff) | |
download | redot-engine-4d727f1ee6b970298a7c1752ba19b49d7060c405.tar.gz |
Allows to doc vararg method return type as void
Diffstat (limited to 'core/method_bind.h')
-rw-r--r-- | core/method_bind.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/core/method_bind.h b/core/method_bind.h index 754d9f70e6..1860d227f7 100644 --- a/core/method_bind.h +++ b/core/method_bind.h @@ -344,7 +344,7 @@ public: return (instance->*call_method)(p_args, p_arg_count, r_error); } - void set_method_info(const MethodInfo &p_info) { + void set_method_info(const MethodInfo &p_info, bool p_return_nil_is_variant) { set_argument_count(p_info.arguments.size()); #ifdef DEBUG_METHODS_ENABLED @@ -364,7 +364,9 @@ public: } argument_types = at; arguments = p_info; - arguments.return_val.usage |= PROPERTY_USAGE_NIL_IS_VARIANT; + if (p_return_nil_is_variant) { + arguments.return_val.usage |= PROPERTY_USAGE_NIL_IS_VARIANT; + } #endif } @@ -387,11 +389,11 @@ public: }; template <class T> -MethodBind *create_vararg_method_bind(Variant (T::*p_method)(const Variant **, int, Variant::CallError &), const MethodInfo &p_info) { +MethodBind *create_vararg_method_bind(Variant (T::*p_method)(const Variant **, int, Variant::CallError &), const MethodInfo &p_info, bool p_return_nil_is_variant) { MethodBindVarArg<T> *a = memnew((MethodBindVarArg<T>)); a->set_method(p_method); - a->set_method_info(p_info); + a->set_method_info(p_info, p_return_nil_is_variant); return a; } |