You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-10 13:00:37 +00:00
Enable type information on release
This is needed for GDScript (and potentially other scripting languages) to properly identify type errors and avoid mismatch between release and debug versions. This increases the release bynary size by about 889 KiB.
This commit is contained in:
@@ -34,12 +34,13 @@
|
||||
|
||||
#include "method_bind.h"
|
||||
|
||||
#ifdef DEBUG_METHODS_ENABLED
|
||||
PropertyInfo MethodBind::get_argument_info(int p_argument) const {
|
||||
ERR_FAIL_INDEX_V(p_argument, get_argument_count(), PropertyInfo());
|
||||
|
||||
PropertyInfo info = _gen_argument_type_info(p_argument);
|
||||
#ifdef DEBUG_METHODS_ENABLED
|
||||
info.name = p_argument < arg_names.size() ? String(arg_names[p_argument]) : String("arg" + itos(p_argument));
|
||||
#endif
|
||||
return info;
|
||||
}
|
||||
|
||||
@@ -47,7 +48,6 @@ PropertyInfo MethodBind::get_return_info() const {
|
||||
return _gen_argument_type_info(-1);
|
||||
}
|
||||
|
||||
#endif
|
||||
void MethodBind::_set_const(bool p_const) {
|
||||
_const = p_const;
|
||||
}
|
||||
@@ -78,7 +78,6 @@ void MethodBind::set_default_arguments(const Vector<Variant> &p_defargs) {
|
||||
default_argument_count = default_arguments.size();
|
||||
}
|
||||
|
||||
#ifdef DEBUG_METHODS_ENABLED
|
||||
void MethodBind::_generate_argument_types(int p_count) {
|
||||
set_argument_count(p_count);
|
||||
|
||||
@@ -92,25 +91,19 @@ void MethodBind::_generate_argument_types(int p_count) {
|
||||
argument_types = argt;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
MethodBind::MethodBind() {
|
||||
static int last_id = 0;
|
||||
method_id = last_id++;
|
||||
hint_flags = METHOD_FLAGS_DEFAULT;
|
||||
argument_count = 0;
|
||||
default_argument_count = 0;
|
||||
#ifdef DEBUG_METHODS_ENABLED
|
||||
argument_types = nullptr;
|
||||
#endif
|
||||
_const = false;
|
||||
_returns = false;
|
||||
}
|
||||
|
||||
MethodBind::~MethodBind() {
|
||||
#ifdef DEBUG_METHODS_ENABLED
|
||||
if (argument_types) {
|
||||
memdelete_arr(argument_types);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user