diff options
122 files changed, 2509 insertions, 570 deletions
diff --git a/SConstruct b/SConstruct index bc89aa7540..f2f1ea57f3 100644 --- a/SConstruct +++ b/SConstruct @@ -367,13 +367,13 @@ if selected_platform in platform_list: if (config.can_build(selected_platform)): config.configure(env) env.module_list.append(x) - try: - doc_classes = config.get_doc_classes() - doc_path = config.get_doc_path() - for c in doc_classes: - env.doc_class_path[c]="modules/"+x+"/"+doc_path - except: - pass + try: + doc_classes = config.get_doc_classes() + doc_path = config.get_doc_path() + for c in doc_classes: + env.doc_class_path[c]="modules/"+x+"/"+doc_path + except: + pass sys.path.remove(tmppath) diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index d0acd04497..cfd7677d6b 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -33,6 +33,7 @@ #include "geometry.h" #include "io/file_access_compressed.h" #include "io/file_access_encrypted.h" +#include "io/json.h" #include "io/marshalls.h" #include "os/keyboard.h" #include "os/os.h" @@ -440,8 +441,8 @@ bool _OS::is_vsync_enabled() const { return OS::get_singleton()->is_vsync_enabled(); } -OS::PowerState _OS::get_power_state() { - return OS::get_singleton()->get_power_state(); +_OS::PowerState _OS::get_power_state() { + return _OS::PowerState(OS::get_singleton()->get_power_state()); } int _OS::get_power_seconds_left() { @@ -1142,11 +1143,11 @@ void _OS::_bind_methods() { BIND_ENUM_CONSTANT(SYSTEM_DIR_PICTURES); BIND_ENUM_CONSTANT(SYSTEM_DIR_RINGTONES); - BIND_ENUM_CONSTANT(OS::POWERSTATE_UNKNOWN); - BIND_ENUM_CONSTANT(OS::POWERSTATE_ON_BATTERY); - BIND_ENUM_CONSTANT(OS::POWERSTATE_NO_BATTERY); - BIND_ENUM_CONSTANT(OS::POWERSTATE_CHARGING); - BIND_ENUM_CONSTANT(OS::POWERSTATE_CHARGED); + BIND_ENUM_CONSTANT(POWERSTATE_UNKNOWN); + BIND_ENUM_CONSTANT(POWERSTATE_ON_BATTERY); + BIND_ENUM_CONSTANT(POWERSTATE_NO_BATTERY); + BIND_ENUM_CONSTANT(POWERSTATE_CHARGING); + BIND_ENUM_CONSTANT(POWERSTATE_CHARGED); } _OS::_OS() { @@ -2600,3 +2601,76 @@ _Engine *_Engine::singleton = NULL; _Engine::_Engine() { singleton = this; } + +void JSONParseResult::_bind_methods() { + ClassDB::bind_method(D_METHOD("get_error"), &JSONParseResult::get_error); + ClassDB::bind_method(D_METHOD("get_error_string"), &JSONParseResult::get_error_string); + ClassDB::bind_method(D_METHOD("get_error_line"), &JSONParseResult::get_error_line); + ClassDB::bind_method(D_METHOD("get_result"), &JSONParseResult::get_result); + + ClassDB::bind_method(D_METHOD("set_error", "error"), &JSONParseResult::set_error); + ClassDB::bind_method(D_METHOD("set_error_string", "error_string"), &JSONParseResult::set_error_string); + ClassDB::bind_method(D_METHOD("set_error_line", "error_line"), &JSONParseResult::set_error_line); + ClassDB::bind_method(D_METHOD("set_result", "result"), &JSONParseResult::set_result); + + ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT, "error", PROPERTY_HINT_NONE, "Error", PROPERTY_USAGE_CLASS_IS_ENUM), "set_error", "get_error"); + ADD_PROPERTYNZ(PropertyInfo(Variant::STRING, "error_string"), "set_error_string", "get_error_string"); + ADD_PROPERTYNZ(PropertyInfo(Variant::INT, "error_line"), "set_error_line", "get_error_line"); + ADD_PROPERTYNZ(PropertyInfo(Variant::NIL, "result", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NIL_IS_VARIANT), "set_result", "get_result"); +} + +void JSONParseResult::set_error(Error p_error) { + error = p_error; +} + +Error JSONParseResult::get_error() const { + return error; +} + +void JSONParseResult::set_error_string(const String &p_error_string) { + error_string = p_error_string; +} + +String JSONParseResult::get_error_string() const { + return error_string; +} + +void JSONParseResult::set_error_line(int p_error_line) { + error_line = p_error_line; +} + +int JSONParseResult::get_error_line() const { + return error_line; +} + +void JSONParseResult::set_result(const Variant &p_result) { + result = p_result; +} + +Variant JSONParseResult::get_result() const { + return result; +} + +void _JSON::_bind_methods() { + ClassDB::bind_method(D_METHOD("print", "value"), &_JSON::print); + ClassDB::bind_method(D_METHOD("parse", "json"), &_JSON::parse); +} + +String _JSON::print(const Variant &p_value) { + return JSON::print(p_value); +} + +Ref<JSONParseResult> _JSON::parse(const String &p_json) { + Ref<JSONParseResult> result; + result.instance(); + + result->error = JSON::parse(p_json, result->result, result->error_string, result->error_line); + + return result; +} + +_JSON *_JSON::singleton = NULL; + +_JSON::_JSON() { + singleton = this; +} diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index 0578c2b80f..721acf657f 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -97,6 +97,14 @@ protected: static _OS *singleton; public: + enum PowerState { + POWERSTATE_UNKNOWN, /**< cannot determine power status */ + POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */ + POWERSTATE_NO_BATTERY, /**< Plugged in, no battery available */ + POWERSTATE_CHARGING, /**< Plugged in, charging battery */ + POWERSTATE_CHARGED /**< Plugged in, battery charged */ + }; + enum Weekday { DAY_SUNDAY, DAY_MONDAY, @@ -303,7 +311,7 @@ public: void set_use_vsync(bool p_enable); bool is_vsync_enabled() const; - OS::PowerState get_power_state(); + PowerState get_power_state(); int get_power_seconds_left(); int get_power_percent_left(); @@ -312,6 +320,7 @@ public: _OS(); }; +VARIANT_ENUM_CAST(_OS::PowerState); VARIANT_ENUM_CAST(_OS::Weekday); VARIANT_ENUM_CAST(_OS::Month); VARIANT_ENUM_CAST(_OS::SystemDir); @@ -660,4 +669,50 @@ public: _Engine(); }; +class _JSON; + +class JSONParseResult : public Reference { + GDCLASS(JSONParseResult, Reference) + + friend class _JSON; + + Error error; + String error_string; + int error_line; + + Variant result; + +protected: + static void _bind_methods(); + +public: + void set_error(Error p_error); + Error get_error() const; + + void set_error_string(const String &p_error_string); + String get_error_string() const; + + void set_error_line(int p_error_line); + int get_error_line() const; + + void set_result(const Variant &p_result); + Variant get_result() const; +}; + +class _JSON : public Object { + GDCLASS(_JSON, Object) + +protected: + static void _bind_methods(); + static _JSON *singleton; + +public: + static _JSON *get_singleton() { return singleton; } + + String print(const Variant &p_value); + Ref<JSONParseResult> parse(const String &p_json); + + _JSON(); +}; + #endif // CORE_BIND_H diff --git a/core/color.cpp b/core/color.cpp index 259a4988b1..dd8b13c047 100644 --- a/core/color.cpp +++ b/core/color.cpp @@ -400,3 +400,122 @@ Color::operator String() const { return rtos(r) + ", " + rtos(g) + ", " + rtos(b) + ", " + rtos(a); } + +Color Color::operator+(const Color &p_color) const { + + return Color( + CLAMP(r + p_color.r, 0.0, 1.0), + CLAMP(g + p_color.g, 0.0, 1.0), + CLAMP(b + p_color.b, 0.0, 1.0), + CLAMP(a + p_color.a, 0.0, 1.0)); +} + +void Color::operator+=(const Color &p_color) { + + r = CLAMP(r + p_color.r, 0.0, 1.0); + g = CLAMP(g + p_color.g, 0.0, 1.0); + b = CLAMP(b + p_color.b, 0.0, 1.0); + a = CLAMP(a + p_color.a, 0.0, 1.0); +} + +Color Color::operator-(const Color &p_color) const { + + return Color( + CLAMP(r - p_color.r, 0.0, 1.0), + CLAMP(g - p_color.g, 0.0, 1.0), + CLAMP(b - p_color.b, 0.0, 1.0), + CLAMP(a - p_color.a, 0.0, 1.0)); +} + +void Color::operator-=(const Color &p_color) { + + r = CLAMP(r - p_color.r, 0.0, 1.0); + g = CLAMP(g - p_color.g, 0.0, 1.0); + b = CLAMP(b - p_color.b, 0.0, 1.0); + a = CLAMP(a - p_color.a, 0.0, 1.0); +} + +Color Color::operator*(const Color &p_color) const { + + return Color( + CLAMP(r * p_color.r, 0.0, 1.0), + CLAMP(g * p_color.g, 0.0, 1.0), + CLAMP(b * p_color.b, 0.0, 1.0), + CLAMP(a * p_color.a, 0.0, 1.0)); +} + +Color Color::operator*(const real_t &rvalue) const { + + return Color( + CLAMP(r * rvalue, 0.0, 1.0), + CLAMP(g * rvalue, 0.0, 1.0), + CLAMP(b * rvalue, 0.0, 1.0), + CLAMP(a * rvalue, 0.0, 1.0)); +} + +void Color::operator*=(const Color &p_color) { + + r = CLAMP(r * p_color.r, 0.0, 1.0); + g = CLAMP(g * p_color.g, 0.0, 1.0); + b = CLAMP(b * p_color.b, 0.0, 1.0); + a = CLAMP(a * p_color.a, 0.0, 1.0); +} + +void Color::operator*=(const real_t &rvalue) { + + r = CLAMP(r * rvalue, 0.0, 1.0); + g = CLAMP(g * rvalue, 0.0, 1.0); + b = CLAMP(b * rvalue, 0.0, 1.0); + a = CLAMP(a * rvalue, 0.0, 1.0); +}; + +Color Color::operator/(const Color &p_color) const { + + return Color( + p_color.r == 0 ? 1 : CLAMP(r / p_color.r, 0.0, 1.0), + p_color.g == 0 ? 1 : CLAMP(g / p_color.g, 0.0, 1.0), + p_color.b == 0 ? 1 : CLAMP(b / p_color.b, 0.0, 1.0), + p_color.a == 0 ? 1 : CLAMP(a / p_color.a, 0.0, 1.0)); +} + +Color Color::operator/(const real_t &rvalue) const { + + if (rvalue == 0) return Color(1.0, 1.0, 1.0, 1.0); + return Color( + CLAMP(r / rvalue, 0.0, 1.0), + CLAMP(g / rvalue, 0.0, 1.0), + CLAMP(b / rvalue, 0.0, 1.0), + CLAMP(a / rvalue, 0.0, 1.0)); +} + +void Color::operator/=(const Color &p_color) { + + r = p_color.r == 0 ? 1 : CLAMP(r / p_color.r, 0.0, 1.0); + g = p_color.g == 0 ? 1 : CLAMP(g / p_color.g, 0.0, 1.0); + b = p_color.b == 0 ? 1 : CLAMP(b / p_color.b, 0.0, 1.0); + a = p_color.a == 0 ? 1 : CLAMP(a / p_color.a, 0.0, 1.0); +} + +void Color::operator/=(const real_t &rvalue) { + + if (rvalue == 0) { + r = 1.0; + g = 1.0; + b = 1.0; + a = 1.0; + } else { + r = CLAMP(r / rvalue, 0.0, 1.0); + g = CLAMP(g / rvalue, 0.0, 1.0); + b = CLAMP(b / rvalue, 0.0, 1.0); + a = CLAMP(a / rvalue, 0.0, 1.0); + } +}; + +Color Color::operator-() const { + + return Color( + CLAMP(1.0 - r, 0.0, 1.0), + CLAMP(1.0 - g, 0.0, 1.0), + CLAMP(1.0 - b, 0.0, 1.0), + CLAMP(1.0 - a, 0.0, 1.0)); +} diff --git a/core/color.h b/core/color.h index d3d5db09f9..972b6a1b33 100644 --- a/core/color.h +++ b/core/color.h @@ -67,6 +67,23 @@ struct Color { return components[idx]; } + Color operator+(const Color &p_color) const; + void operator+=(const Color &p_color); + + Color operator-() const; + Color operator-(const Color &p_color) const; + void operator-=(const Color &p_color); + + Color operator*(const Color &p_color) const; + Color operator*(const real_t &rvalue) const; + void operator*=(const Color &p_color); + void operator*=(const real_t &rvalue); + + Color operator/(const Color &p_color) const; + Color operator/(const real_t &rvalue) const; + void operator/=(const Color &p_color); + void operator/=(const real_t &rvalue); + void invert(); void contrast(); Color inverted() const; diff --git a/core/object.cpp b/core/object.cpp index 23e32a214a..b1770f1d7a 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -277,32 +277,32 @@ MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyIn MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name) : name(p_name), flags(METHOD_FLAG_NORMAL), + return_val(p_ret), id(0) { - return_val = p_ret; } MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1) : name(p_name), + return_val(p_ret), flags(METHOD_FLAG_NORMAL), id(0) { - return_val = p_ret; arguments.push_back(p_param1); } MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2) : name(p_name), + return_val(p_ret), flags(METHOD_FLAG_NORMAL), id(0) { - return_val = p_ret; arguments.push_back(p_param1); arguments.push_back(p_param2); } MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3) : name(p_name), + return_val(p_ret), flags(METHOD_FLAG_NORMAL), id(0) { - return_val = p_ret; arguments.push_back(p_param1); arguments.push_back(p_param2); arguments.push_back(p_param3); @@ -310,9 +310,9 @@ MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const Pr MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4) : name(p_name), + return_val(p_ret), flags(METHOD_FLAG_NORMAL), id(0) { - return_val = p_ret; arguments.push_back(p_param1); arguments.push_back(p_param2); arguments.push_back(p_param3); @@ -321,9 +321,9 @@ MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const Pr MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4, const PropertyInfo &p_param5) : name(p_name), + return_val(p_ret), flags(METHOD_FLAG_NORMAL), id(0) { - return_val = p_ret; arguments.push_back(p_param1); arguments.push_back(p_param2); arguments.push_back(p_param3); diff --git a/core/object.h b/core/object.h index 644e2b8270..3070439138 100644 --- a/core/object.h +++ b/core/object.h @@ -148,6 +148,7 @@ struct PropertyInfo { hint(PROPERTY_HINT_NONE), usage(PROPERTY_USAGE_DEFAULT) { } + PropertyInfo(Variant::Type p_type, const String p_name, PropertyHint p_hint = PROPERTY_HINT_NONE, const String &p_hint_string = "", uint32_t p_usage = PROPERTY_USAGE_DEFAULT, const StringName &p_class_name = StringName()) : type(p_type), name(p_name), @@ -161,12 +162,12 @@ struct PropertyInfo { class_name = p_class_name; } } + PropertyInfo(const StringName &p_class_name) : type(Variant::OBJECT), + class_name(p_class_name), hint(PROPERTY_HINT_NONE), usage(PROPERTY_USAGE_DEFAULT) { - - class_name = p_class_name; } bool operator<(const PropertyInfo &p_info) const { diff --git a/core/os/dir_access.cpp b/core/os/dir_access.cpp index f24d6d16ca..1437e7cdfc 100644 --- a/core/os/dir_access.cpp +++ b/core/os/dir_access.cpp @@ -292,7 +292,7 @@ String DirAccess::get_full_path(const String &p_path, AccessType p_access) { return full; } -Error DirAccess::copy(String p_from, String p_to) { +Error DirAccess::copy(String p_from, String p_to, int chmod_flags) { //printf("copy %s -> %s\n",p_from.ascii().get_data(),p_to.ascii().get_data()); Error err; @@ -329,6 +329,11 @@ Error DirAccess::copy(String p_from, String p_to) { fdst->store_8(fsrc->get_8()); } + if (err == OK && chmod_flags != -1) { + fdst->close(); + err = fdst->_chmod(p_to, chmod_flags); + } + memdelete(fsrc); memdelete(fdst); diff --git a/core/os/dir_access.h b/core/os/dir_access.h index 6ad8b4c49b..7fa3ce5cf1 100644 --- a/core/os/dir_access.h +++ b/core/os/dir_access.h @@ -89,7 +89,7 @@ public: static bool exists(String p_dir); virtual size_t get_space_left() = 0; - virtual Error copy(String p_from, String p_to); + virtual Error copy(String p_from, String p_to, int chmod_flags = -1); virtual Error rename(String p_from, String p_to) = 0; virtual Error remove(String p_name) = 0; diff --git a/core/os/file_access.h b/core/os/file_access.h index 8e5728f525..151c41c263 100644 --- a/core/os/file_access.h +++ b/core/os/file_access.h @@ -140,6 +140,8 @@ public: virtual Error reopen(const String &p_path, int p_mode_flags); ///< does not change the AccessType + virtual Error _chmod(const String &p_path, int p_mod) {} + static FileAccess *create(AccessType p_access); /// Create a file access (for the current platform) this is the only portable way of accessing files. static FileAccess *create_for_path(const String &p_path); static FileAccess *open(const String &p_path, int p_mode_flags, Error *r_error = NULL); /// Create a file access (for the current platform) this is the only portable way of accessing files. diff --git a/core/project_settings.cpp b/core/project_settings.cpp index 72d40b42c3..7ea0d563a6 100644 --- a/core/project_settings.cpp +++ b/core/project_settings.cpp @@ -307,8 +307,8 @@ Error ProjectSettings::setup(const String &p_path, const String &p_main_pack) { if (exec_path != "") { bool found = false; - // get our filename without our path (note, not using exec_path.get_basename anymore because not all file systems have dots in their file names!) - String filebase_name = exec_path.get_file(); + // get our filename without our path (note, using exec_path.get_file before get_basename anymore because not all file systems have dots in their file names!) + String filebase_name = exec_path.get_file().get_basename(); // try to open at the location of executable String datapack_name = exec_path.get_base_dir().plus_file(filebase_name) + ".pck"; diff --git a/core/register_core_types.cpp b/core/register_core_types.cpp index 27c31127a4..0e34a3eea5 100644 --- a/core/register_core_types.cpp +++ b/core/register_core_types.cpp @@ -68,6 +68,7 @@ static _Engine *_engine = NULL; static _ClassDB *_classdb = NULL; static _Marshalls *_marshalls = NULL; static TranslationLoaderPO *resource_format_po = NULL; +static _JSON *_json = NULL; static IP *ip = NULL; @@ -162,6 +163,8 @@ void register_core_types() { ClassDB::register_class<AStar>(); ClassDB::register_class<EncodedObjectAsID>(); + ClassDB::register_class<JSONParseResult>(); + ip = IP::create(); _geometry = memnew(_Geometry); @@ -172,6 +175,7 @@ void register_core_types() { _engine = memnew(_Engine); _classdb = memnew(_ClassDB); _marshalls = memnew(_Marshalls); + _json = memnew(_JSON); } void register_core_settings() { @@ -193,6 +197,7 @@ void register_core_singletons() { ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("TranslationServer", TranslationServer::get_singleton())); ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("Input", Input::get_singleton())); ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("InputMap", InputMap::get_singleton())); + ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("JSON", _JSON::get_singleton())); } void unregister_core_types() { @@ -203,6 +208,7 @@ void unregister_core_types() { memdelete(_engine); memdelete(_classdb); memdelete(_marshalls); + memdelete(_json); memdelete(_geometry); diff --git a/core/undo_redo.cpp b/core/undo_redo.cpp index 4760047959..27fc73ec63 100644 --- a/core/undo_redo.cpp +++ b/core/undo_redo.cpp @@ -503,6 +503,10 @@ void UndoRedo::_bind_methods() { ClassDB::bind_method(D_METHOD("clear_history"), &UndoRedo::clear_history); ClassDB::bind_method(D_METHOD("get_current_action_name"), &UndoRedo::get_current_action_name); ClassDB::bind_method(D_METHOD("get_version"), &UndoRedo::get_version); + ClassDB::bind_method(D_METHOD("set_max_steps", "max_steps"), &UndoRedo::set_max_steps); + ClassDB::bind_method(D_METHOD("get_max_steps"), &UndoRedo::get_max_steps); + ClassDB::bind_method(D_METHOD("redo"), &UndoRedo::redo); + ClassDB::bind_method(D_METHOD("undo"), &UndoRedo::undo); BIND_ENUM_CONSTANT(MERGE_DISABLE); BIND_ENUM_CONSTANT(MERGE_ENDS); diff --git a/core/variant_op.cpp b/core/variant_op.cpp index b6e114b853..a11169eb8f 100644 --- a/core/variant_op.cpp +++ b/core/variant_op.cpp @@ -493,7 +493,7 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, const Variant & DEFAULT_OP_FAIL(BASIS); DEFAULT_OP_FAIL(TRANSFORM); - DEFAULT_OP_FAIL(COLOR); + DEFAULT_OP_LOCALMEM(+, COLOR, Color); DEFAULT_OP_FAIL(NODE_PATH); DEFAULT_OP_FAIL(_RID); @@ -549,7 +549,7 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, const Variant & DEFAULT_OP_FAIL(BASIS); DEFAULT_OP_FAIL(TRANSFORM); - DEFAULT_OP_FAIL(COLOR); + DEFAULT_OP_LOCALMEM(-, COLOR, Color); DEFAULT_OP_FAIL(NODE_PATH); DEFAULT_OP_FAIL(_RID); @@ -645,7 +645,7 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, const Variant & r_valid = false; return; } break; - DEFAULT_OP_FAIL(COLOR); + DEFAULT_OP_LOCALMEM_NUM(*, COLOR, Color); DEFAULT_OP_FAIL(NODE_PATH); DEFAULT_OP_FAIL(_RID); @@ -717,7 +717,7 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, const Variant & DEFAULT_OP_FAIL(BASIS); DEFAULT_OP_FAIL(TRANSFORM); - DEFAULT_OP_FAIL(COLOR); + DEFAULT_OP_LOCALMEM_NUM(/, COLOR, Color); DEFAULT_OP_FAIL(NODE_PATH); DEFAULT_OP_FAIL(_RID); @@ -797,7 +797,7 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, const Variant & DEFAULT_OP_FAIL(BASIS); DEFAULT_OP_FAIL(TRANSFORM); - DEFAULT_OP_FAIL(COLOR); + DEFAULT_OP_LOCALMEM_NEG(COLOR, Color); DEFAULT_OP_FAIL(NODE_PATH); DEFAULT_OP_FAIL(_RID); diff --git a/doc/classes/@GDScript.xml b/doc/classes/@GDScript.xml index 52df939fc5..7b120afa51 100644 --- a/doc/classes/@GDScript.xml +++ b/doc/classes/@GDScript.xml @@ -82,7 +82,7 @@ Returns the arc sine of 's' in radians. Use to get the angle of sine 's'. [codeblock] # s is 0.523599 or 30 degrees if converted with rad2deg(s) - s = asin(0.5) + s = asin(0.5) [/codeblock] </description> </method> @@ -92,6 +92,14 @@ <argument index="0" name="condition" type="bool"> </argument> <description> + Assert that the condition is true. If the condition is false a fatal error is generated and the program is halted. Useful for debugging to make sure a value is always true. + [codeblock] + # Speed should always be between 0 and 20 + speed = -10 + assert(speed < 20) # Is true and program continues + assert(speed >= 0) # Is false and program stops + assert(speed >= 0 && speed < 20) # Or combined + [/codeblock] </description> </method> <method name="atan"> @@ -100,6 +108,11 @@ <argument index="0" name="s" type="float"> </argument> <description> + Returns the arc tangent of 's' in radians. Use it to get the angle from an angle's tangent in trigonometry: [code]atan(tan(angle)) == angle[/code]. + The method cannot know in which quadrant the angle should fall. See [method atan2] if you always want an exact angle. + [codeblock] + a = atan(0.5) # a is 0.463648 + [/codeblock] </description> </method> <method name="atan2"> @@ -110,10 +123,9 @@ <argument index="1" name="y" type="float"> </argument> <description> - Returns the arc tangent of y/x in radians. Use to get the angle of tangent y/x. To compute the value, the function takes into account the sign of both arguments in order to determine the quadrant. + Returns the arc tangent of y/x in radians. Use to get the angle of tangent y/x. To compute the value, the method takes into account the sign of both arguments in order to determine the quadrant. [codeblock] - # a is 3.141593 - a = atan(0,-1) + a = atan(0,-1) # a is 3.141593 [/codeblock] </description> </method> @@ -134,10 +146,8 @@ <description> Rounds 's' upward, returning the smallest integral value that is not less than 's'. [codeblock] - # i is 2 - i = ceil(1.45) - # i is 2 - i = ceil(1.001) + i = ceil(1.45) # i is 2 + i = ceil(1.001) # i is 2 [/codeblock] </description> </method> @@ -303,7 +313,10 @@ <argument index="0" name="s" type="float"> </argument> <description> - Returns [b]e[/b] raised to the power of 's'. [b]e[/b] sometimes called "Euler's number" is a mathematical constant whose value is approximately 2.71828. + Raises the Euler's constant [b]e[/b] to the power of 's' and returns it. [b] has an approximate value of 2.71828. + [codeblock] + a = exp(2) # approximately 7.39 + [/codeblock] </description> </method> <method name="floor"> @@ -312,7 +325,13 @@ <argument index="0" name="s" type="float"> </argument> <description> - Returns the largest integer value (rounded down) that is less than or equal to 's'. + Rounds 's' to the closest smaller integer and returns it. + [codeblock] + # a is 2 + a = floor(2.99) + # a is -3 + a = floor(-2.99) + [/codeblock] </description> </method> <method name="fmod"> @@ -338,6 +357,26 @@ <argument index="1" name="y" type="float"> </argument> <description> + Returns the floating-point remainder of x/y that wraps equally in positive and negative. + [codeblock] + var i = -10; + while i < 0: + prints(i, fposmod(i, 10)) + i += 1 + [/codeblock] + Produces: + [codeblock] + -10 10 + -9 1 + -8 2 + -7 3 + -6 4 + -5 5 + -4 6 + -3 7 + -2 8 + -1 9 + [/codeblock] </description> </method> <method name="funcref"> @@ -348,6 +387,14 @@ <argument index="1" name="funcname" type="String"> </argument> <description> + Returns a reference to the specified function 'funcname' in the 'instance' node. As functions aren't first-class objects in GDscript, use 'funcref' to store a function in a variable and call it later. + [codeblock] + func foo(): + return("bar") + + a = funcref(self, "foo") + print(a.call_func()) # prints bar + [/codeblock] </description> </method> <method name="hash"> @@ -358,8 +405,7 @@ <description> Returns the integer hash of the variable passed. [codeblock] - # print 177670 - print(hash("a")) + print(hash("a")) # prints 177670 [/codeblock] </description> </method> @@ -396,9 +442,8 @@ func _ready(): var id = get_instance_id() var inst = instance_from_id(id) - print(inst.foo) + print(inst.foo) # prints bar [/codeblock] - Prints "bar" </description> </method> <method name="inverse_lerp"> @@ -413,7 +458,7 @@ <description> Returns a normalized value considering the given range. [codeblock] - inverse_lerp(3, 5, 4) # return 0.5 + inverse_lerp(3, 5, 4) # returns 0.5 [/codeblock] </description> </method> @@ -444,9 +489,8 @@ Returns length of Variant 'var'. Length is the character count of String, element count of Array, size of Dictionary, etc. Note: Generates a fatal error if Variant can not provide a length. [codeblock] a = [1, 2, 3, 4] - print(len(a)) + len(a) # returns 4 [/codeblock] - Prints 4 </description> </method> <method name="lerp"> @@ -460,6 +504,9 @@ </argument> <description> Linear interpolates between two values by a normalized value. + [codeblock] + lerp(1, 3, 0.5) # returns 2 + [/codeblock] </description> </method> <method name="linear2db"> @@ -492,8 +539,7 @@ <description> Natural logarithm. The amount of time needed to reach a certain level of continuous growth. Note: This is not the same as the log funcation on your calculator which is a base 10 logarithm. [codeblock] - # a is 2.302585 - a = log(10) + log(10) # returns 2.302585 [/codeblock] </description> </method> @@ -507,10 +553,8 @@ <description> Returns the maximum of two values. [codeblock] - # a is 2 - a = max(1,2) - # a is -3.99 - a = max(-3.99, -4) + max(1,2) # returns 2 + max(-3.99, -4) # returns -3.99 [/codeblock] </description> </method> @@ -524,10 +568,8 @@ <description> Returns the minimum of two values. [codeblock] - # a is 1 - a = min(1,2) - # a is -4 - a = min(-3.99, -4) + min(1,2) # returns 1 + min(-3.99, -4) # returns -4 [/codeblock] </description> </method> @@ -537,14 +579,11 @@ <argument index="0" name="val" type="int"> </argument> <description> - Returns the nearest larger power of 2 for an integer. + Returns the nearest larger power of 2 for integer 'val'. [codeblock] - # a is 4 - a = nearest_po2(3) - # a is 4 - a = nearest_po2(4) - # a is 8 - a = nearest_po2(5) + nearest_po2(3) # returns 4 + nearest_po2(4) # returns 4 + nearest_po2(5) # returns 8 [/codeblock] </description> </method> @@ -559,7 +598,7 @@ [codeblock] p = parse_json('["a", "b", "c"]') if typeof(p) == TYPE_ARRAY: - print(p[0]) + print(p[0]) # prints a else: print("unexpected results") [/codeblock] @@ -575,8 +614,7 @@ <description> Returns the result of 'x' raised to the power of 'y'. [codeblock] - # a is 32 - a = pow(2,5) + pow(2,5) # returns 32 [/codeblock] </description> </method> @@ -590,6 +628,7 @@ [codeblock] # load a scene called main located in the root of the project directory var main = preload("res://main.tscn") + [/codeblock] </description> </method> <method name="print" qualifiers="vararg"> @@ -599,9 +638,8 @@ Converts one or more arguments to strings in the best way possible and prints them to the console. [codeblock] a = [1,2,3] - print("a","b",a) + print("a","b",a) # prints ab[1, 2, 3] [/codeblock] - Prints ab[1, 2, 3] </description> </method> <method name="print_stack"> @@ -609,6 +647,10 @@ </return> <description> Print a stack track at code location, only works when running with debugger turned on. + Output in the console would look something like this: + [codeblock] + Frame 0 - res://test.gd:16 in function '_process' + [/codeblock] </description> </method> <method name="printerr" qualifiers="vararg"> @@ -616,6 +658,9 @@ </return> <description> Print one or more arguments to strings in the best way possible to standard error line. + [codeblock] + printerr("prints to stderr") + [/codeblock] </description> </method> <method name="printraw" qualifiers="vararg"> @@ -623,6 +668,11 @@ </return> <description> Print one or more arguments to strings in the best way possible to console. No newline is added at the end. + [codeblock] + printraw("A") + printraw("B") + # prints AB + [/codeblock] </description> </method> <method name="prints" qualifiers="vararg"> @@ -630,6 +680,9 @@ </return> <description> Print one or more arguments to the console with a space between each argument. + [codeblock] + prints("A", "B", "C") # prints A B C + [/codeblock] </description> </method> <method name="printt" qualifiers="vararg"> @@ -637,6 +690,9 @@ </return> <description> Print one or more arguments to the console with a tab between each argument. + [codeblock] + printt("A", "B", "C") # prints A B C + [/codeblock] </description> </method> <method name="rad2deg"> @@ -646,6 +702,9 @@ </argument> <description> Convert from radians to degrees. + [codeblock] + rad2deg(0.523599) # returns 30 + [/codeblock] </description> </method> <method name="rand_range"> @@ -657,6 +716,9 @@ </argument> <description> Random range, any floating point value between 'from' and 'to'. + [codeblock] + prints(rand_range(0, 1), rand_range(0, 1)) # prints 0.135591 0.405263 + [/codeblock] </description> </method> <method name="rand_seed"> @@ -673,13 +735,21 @@ </return> <description> Return a random floating point value between 0 and 1. + [codeblock] + randf() # returns 0.375671 + [/codeblock] </description> </method> <method name="randi"> <return type="int"> </return> <description> - Return a random 32 bits integer value. To obtain a random value between 0 to N (where N is smaller than 2^32 - 1), you can use remainder. For example, to get a random integer between 0 and 19 inclusive, you can use randi() % 20. + Return a random 32 bit integer. Use remainder to obtain a random value between 0 and N (where N is smaller than 2^32 -1). + [codeblock] + randi() % 20 # returns random number between 0 and 19 + randi() % 100 # returns random number between 0 and 99 + randi() % 100 + 1 # returns random number between 1 and 100 + [/codeblock] </description> </method> <method name="randomize"> @@ -687,6 +757,10 @@ </return> <description> Randomize the seed (or the internal state) of the random number generator. Current implementation reseeds using a number based on time. + [codeblock] + func _ready(): + randomize() + [/codeblock] </description> </method> <method name="range" qualifiers="vararg"> @@ -694,6 +768,29 @@ </return> <description> Return an array with the given range. Range can be 1 argument N (0 to N-1), two arguments (initial, final-1) or three arguments (initial, final-1, increment). + [codeblock] + for i in range(4): + print(i) + for i in range(2, 5): + print(i) + for i in range(0, 6, 2): + print(i) + [/codeblock] + Output: + [codeblock] + 0 + 1 + 2 + 3 + + 2 + 3 + 4 + + 0 + 2 + 4 + [/codeblock] </description> </method> <method name="range_lerp"> @@ -723,6 +820,9 @@ </argument> <description> Returns the integral value that is nearest to s, with halfway cases rounded away from zero. + [codeblock] + round(2.6) # returns 3 + [/codeblock] </description> </method> <method name="seed"> @@ -732,6 +832,10 @@ </argument> <description> Set seed for the random number generator. + [codeblock] + my_seed = "Godot Rocks" + seed(my_seed.hash()) + [/codeblock] </description> </method> <method name="sign"> @@ -740,7 +844,11 @@ <argument index="0" name="s" type="float"> </argument> <description> - Return sign (-1 or +1). + Return sign of 's' -1 or 1. + [codeblock] + sign(-6) # returns -1 + sign(6) # returns 1 + [/codeblock] </description> </method> <method name="sin"> @@ -749,7 +857,10 @@ <argument index="0" name="s" type="float"> </argument> <description> - Returns the sine of an angle of s radians. + Return the sine of angle 's' in radians. + [codeblock] + sin(0.523599) # returns 0.5 + [/codeblock] </description> </method> <method name="sinh"> @@ -758,7 +869,11 @@ <argument index="0" name="s" type="float"> </argument> <description> - Returns the hyperbolic sine of s. + Return the hyperbolic sine of 's'. + [codeblock] + a = log(2.0) # returns 0.693147 + sinh(a) # returns 0.75 + [/codeblock] </description> </method> <method name="sqrt"> @@ -767,7 +882,10 @@ <argument index="0" name="s" type="float"> </argument> <description> - Returns the square root of s. + Return the square root of 's'. + [codeblock] + sqrt(9) # returns 3 + [/codeblock] </description> </method> <method name="stepify"> @@ -786,6 +904,12 @@ </return> <description> Convert one or more arguments to string in the best way possible. + [codeblock] + var a = [10, 20, 30] + var b = str(a); + len(a) # returns 3 + len(b) # returns 12 + [/codeblock] </description> </method> <method name="str2var"> @@ -795,6 +919,11 @@ </argument> <description> Convert a formatted string that was returned by [method var2str] to the original value. + [codeblock] + a = '{ "a": 1, "b": 2 }' + b = str2var(a) + print(b['a']) # prints 1 + [/codeblock] </description> </method> <method name="tan"> @@ -803,7 +932,10 @@ <argument index="0" name="s" type="float"> </argument> <description> - Returns the tangent of an angle of s radians. + Return the tangent of angle 's' in radians. + [codeblock] + tan( deg2rad(45) ) # returns 1 + [/codeblock] </description> </method> <method name="tanh"> @@ -812,7 +944,11 @@ <argument index="0" name="s" type="float"> </argument> <description> - Returns the hyperbolic tangent of s. + Returns the hyperbolic tangent of 's'. + [codeblock] + a = log(2.0) # returns 0.693147 + tanh(a) # returns 0.6 + [/codeblock] </description> </method> <method name="to_json"> @@ -821,7 +957,12 @@ <argument index="0" name="var" type="Variant"> </argument> <description> - Convert a Variant to json text. + Convert a Variant 'var' to json text and return the result. Useful for serializing data to store or send over the network + [codeblock] + a = { 'a': 1, 'b': 2 } + b = to_json(a) + print(b) # {"a":1, "b":2} + [/codeblock] </description> </method> <method name="type_exists"> @@ -844,6 +985,13 @@ </argument> <description> Return the internal type of the given Variant object, using the TYPE_* enum in [@Global Scope]. + [codeblock] + p = parse_json('["a", "b", "c"]') + if typeof(p) == TYPE_ARRAY: + print(p[0]) # prints a + else: + print("unexpected results") + [/codeblock] </description> </method> <method name="validate_json"> @@ -852,7 +1000,15 @@ <argument index="0" name="json" type="String"> </argument> <description> - This method is used to validate the structure and data types of a piece of JSON, similar to XML Schema for XML. + Check that 'json' is valid json data. Return empty string if valid. Return error message if not valid. + [codeblock] + j = to_json([1, 2, 3]) + v = validate_json(j) + if not v: + print("valid") + else: + prints("invalid", v) + [/codeblock] </description> </method> <method name="var2bytes"> @@ -871,6 +1027,17 @@ </argument> <description> Convert a value to a formatted string that can later be parsed using [method str2var]. + [codeblock] + a = { 'a': 1, 'b': 2 } + print(var2str(a)) + [/codeblock] + prints + [codeblock] + { + "a": 1, + "b": 2 + } + [/codeblock] </description> </method> <method name="weakref"> diff --git a/doc/classes/@Global Scope.xml b/doc/classes/@Global Scope.xml index 4044c4ed1f..a8fd377ecf 100644 --- a/doc/classes/@Global Scope.xml +++ b/doc/classes/@Global Scope.xml @@ -38,6 +38,8 @@ <member name="InputMap" type="InputMap" setter="" getter=""> [InputMap] singleton </member> + <member name="JSON" type="JSON" setter="" getter=""> + </member> <member name="Marshalls" type="Reference" setter="" getter=""> [Marshalls] singleton </member> diff --git a/doc/classes/AcceptDialog.xml b/doc/classes/AcceptDialog.xml index 8821a450e5..4244e66a35 100644 --- a/doc/classes/AcceptDialog.xml +++ b/doc/classes/AcceptDialog.xml @@ -21,8 +21,8 @@ <argument index="2" name="action" type="String" default=""""> </argument> <description> - Add custom button to the dialog and return the created button. - The button titled with [i]text[/i] and the [i]action[/i] will be passed to [custom_action] signal when it is pressed. + Adds a button with label [i]text[/i] and a custom [i]action[/i] to the dialog and returns the created button. [i]action[/i] will be passed to the [custom_action] signal when pressed. + If [code]true[/code], [i]right[/i] will place the button to the right of any sibling buttons. Default value: [code]false[/code]. </description> </method> <method name="add_cancel"> @@ -31,7 +31,7 @@ <argument index="0" name="name" type="String"> </argument> <description> - Add custom cancel button to the dialog and return the created button. + Adds a button with label [i]name[/i] and a cancel action to the dialog and returns the created button. </description> </method> <method name="get_hide_on_ok" qualifiers="const"> @@ -68,7 +68,7 @@ <argument index="0" name="line_edit" type="Node"> </argument> <description> - Register a [LineEdit] in the dialog. When the enter key is pressed, the dialog will be accepted. + Registers a [LineEdit] in the dialog. When the enter key is pressed, the dialog will be accepted. </description> </method> <method name="set_hide_on_ok"> @@ -99,14 +99,14 @@ <signals> <signal name="confirmed"> <description> - Emitted when accepted. + Emitted when the dialog is accepted. </description> </signal> <signal name="custom_action"> <argument index="0" name="action" type="String"> </argument> <description> - Emitted with a custom button is added. + Emitted when a custom button is pressed. See [method add_button]. </description> </signal> </signals> diff --git a/doc/classes/AudioStreamOGGVorbis.xml b/doc/classes/AudioStreamOGGVorbis.xml index fd9018764d..679438b66b 100644 --- a/doc/classes/AudioStreamOGGVorbis.xml +++ b/doc/classes/AudioStreamOGGVorbis.xml @@ -56,10 +56,13 @@ </methods> <members> <member name="data" type="PoolByteArray" setter="set_data" getter="get_data"> + Raw audio data. </member> <member name="loop" type="bool" setter="set_loop" getter="has_loop"> + If [code]true[/code], audio will loop continuously. Default value: [code]false[/code]. </member> <member name="loop_offset" type="float" setter="set_loop_offset" getter="get_loop_offset"> + If loop is [code]true[/code], loop starts from this position, in seconds. </member> </members> <constants> diff --git a/doc/classes/AudioStreamPlayer.xml b/doc/classes/AudioStreamPlayer.xml index 6ee0ba09a1..edf5dd619b 100644 --- a/doc/classes/AudioStreamPlayer.xml +++ b/doc/classes/AudioStreamPlayer.xml @@ -1,8 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="AudioStreamPlayer" inherits="Node" category="Core" version="3.0.alpha.custom_build"> <brief_description> + Plays back audio. </brief_description> <description> + Plays background audio. </description> <tutorials> </tutorials> @@ -57,6 +59,7 @@ <argument index="0" name="from_pos" type="float" default="0.0"> </argument> <description> + Plays the audio from the given position 'from_pos', in seconds. </description> </method> <method name="seek"> @@ -65,6 +68,7 @@ <argument index="0" name="to_pos" type="float"> </argument> <description> + Sets the position from which audio will be played, in seconds. </description> </method> <method name="set_autoplay"> @@ -111,26 +115,33 @@ <return type="void"> </return> <description> + Stops the audio. </description> </method> </methods> <members> <member name="autoplay" type="bool" setter="set_autoplay" getter="is_autoplay_enabled"> + If [code]true[/code], audio plays when added to scene tree. Default value: [code]false[/code]. </member> <member name="bus" type="String" setter="set_bus" getter="get_bus"> + Bus on which this audio is playing. </member> <member name="mix_target" type="int" setter="set_mix_target" getter="get_mix_target" enum="AudioStreamPlayer.MixTarget"> </member> <member name="playing" type="bool" setter="_set_playing" getter="is_playing"> + If [code]true[/code], audio is playing. </member> <member name="stream" type="AudioStream" setter="set_stream" getter="get_stream"> + The [AudioStream] object to be played. </member> <member name="volume_db" type="float" setter="set_volume_db" getter="get_volume_db"> + Volume of sound, in dB. </member> </members> <signals> <signal name="finished"> <description> + Emitted when the audio stops playing. </description> </signal> </signals> diff --git a/doc/classes/AudioStreamPlayer2D.xml b/doc/classes/AudioStreamPlayer2D.xml index f2464ddac4..e31f2dd941 100644 --- a/doc/classes/AudioStreamPlayer2D.xml +++ b/doc/classes/AudioStreamPlayer2D.xml @@ -1,10 +1,13 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="AudioStreamPlayer2D" inherits="Node2D" category="Core" version="3.0.alpha.custom_build"> <brief_description> + Plays audio in 2D. </brief_description> <description> + Plays audio that dampens with distance from screen center. </description> <tutorials> + http://docs.godotengine.org/en/latest/learning/features/audio/index.html </tutorials> <demos> </demos> @@ -69,6 +72,7 @@ <argument index="0" name="from_pos" type="float" default="0.0"> </argument> <description> + Plays the audio from the given position 'from_pos', in seconds. </description> </method> <method name="seek"> @@ -77,6 +81,7 @@ <argument index="0" name="to_pos" type="float"> </argument> <description> + Sets the position from which audio will be played, in seconds. </description> </method> <method name="set_area_mask"> @@ -139,30 +144,40 @@ <return type="void"> </return> <description> + Stops the audio. </description> </method> </methods> <members> <member name="area_mask" type="int" setter="set_area_mask" getter="get_area_mask"> + Areas in which this sound plays. </member> <member name="attenuation" type="float" setter="set_attenuation" getter="get_attenuation"> + Dampens audio over distance with this as an exponent. </member> <member name="autoplay" type="bool" setter="set_autoplay" getter="is_autoplay_enabled"> + If [code]true[/code], audio plays when added to scene tree. Default value: [code]false[/code]. </member> <member name="bus" type="String" setter="set_bus" getter="get_bus"> + Bus on which this audio is playing. </member> <member name="max_distance" type="float" setter="set_max_distance" getter="get_max_distance"> + Maximum distance from which audio is still hearable. </member> <member name="playing" type="bool" setter="_set_playing" getter="is_playing"> + If [code]true[/code], audio is playing. </member> <member name="stream" type="AudioStream" setter="set_stream" getter="get_stream"> + The [AudioStream] object to be played. </member> <member name="volume_db" type="float" setter="set_volume_db" getter="get_volume_db"> + Base volume without dampening. </member> </members> <signals> <signal name="finished"> <description> + Emitted when the audio stops playing. </description> </signal> </signals> diff --git a/doc/classes/AudioStreamPlayer3D.xml b/doc/classes/AudioStreamPlayer3D.xml index 668e0cc0d2..3aad0ea87a 100644 --- a/doc/classes/AudioStreamPlayer3D.xml +++ b/doc/classes/AudioStreamPlayer3D.xml @@ -1,10 +1,13 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="AudioStreamPlayer3D" inherits="Spatial" category="Core" version="3.0.alpha.custom_build"> <brief_description> + Plays 3D sound in 3D space </brief_description> <description> + Plays a sound effect with directed sound effects, dampens with distance if needed, generates effect of hearable position in space. </description> <tutorials> + http://docs.godotengine.org/en/latest/learning/features/audio/index.html </tutorials> <demos> </demos> @@ -123,6 +126,7 @@ <argument index="0" name="from_pos" type="float" default="0.0"> </argument> <description> + Plays the audio from the given position 'from_pos', in seconds. </description> </method> <method name="seek"> @@ -131,6 +135,7 @@ <argument index="0" name="to_pos" type="float"> </argument> <description> + Sets the position from which audio will be played, in seconds. </description> </method> <method name="set_area_mask"> @@ -265,67 +270,94 @@ <return type="void"> </return> <description> + Stops the audio. </description> </method> </methods> <members> <member name="area_mask" type="int" setter="set_area_mask" getter="get_area_mask"> + Areas in which this sound plays. </member> <member name="attenuation_filter_cutoff_hz" type="float" setter="set_attenuation_filter_cutoff_hz" getter="get_attenuation_filter_cutoff_hz"> + Dampens audio above this frequency, in Hz. </member> <member name="attenuation_filter_db" type="float" setter="set_attenuation_filter_db" getter="get_attenuation_filter_db"> + Amount how much the filter affects the loudness, in dB. </member> <member name="attenuation_model" type="int" setter="set_attenuation_model" getter="get_attenuation_model" enum="AudioStreamPlayer3D.AttenuationModel"> + Decides if audio should get quieter with distance linearly, quadratically or logarithmically. </member> <member name="autoplay" type="bool" setter="set_autoplay" getter="is_autoplay_enabled"> + If [code]true[/code], audio plays audio plays when added to scene tree. Default value: [code]false[/code]. </member> <member name="bus" type="String" setter="set_bus" getter="get_bus"> + Bus on which this audio is playing. </member> <member name="doppler_tracking" type="int" setter="set_doppler_tracking" getter="get_doppler_tracking" enum="AudioStreamPlayer3D.DopplerTracking"> + Decides in which step the Doppler effect should be calculated. </member> <member name="emission_angle_degrees" type="float" setter="set_emission_angle" getter="get_emission_angle"> + The angle in which the audio reaches cameras undampened. </member> <member name="emission_angle_enabled" type="bool" setter="set_emission_angle_enabled" getter="is_emission_angle_enabled"> + If [code]true[/code], the audio should be dampened according to the direction of the sound. </member> <member name="emission_angle_filter_attenuation_db" type="float" setter="set_emission_angle_filter_attenuation_db" getter="get_emission_angle_filter_attenuation_db"> + dampens audio if camera is outside of 'emission_angle_degrees' and 'emission_angle_enabled' is set by this factor, in dB. </member> <member name="max_db" type="float" setter="set_max_db" getter="get_max_db"> + Sets the absolute maximum of the soundlevel, in dB. </member> <member name="max_distance" type="float" setter="set_max_distance" getter="get_max_distance"> + Sets the distance from wich the 'out_of_range_mode' takes effect. Has no effect if set to 0. </member> <member name="out_of_range_mode" type="int" setter="set_out_of_range_mode" getter="get_out_of_range_mode" enum="AudioStreamPlayer3D.OutOfRangeMode"> + Decides if audio should pause when source is outside of 'max_distance' range. </member> <member name="playing" type="bool" setter="_set_playing" getter="is_playing"> + If [code]true[/code], audio is playing. </member> <member name="stream" type="AudioStream" setter="set_stream" getter="get_stream"> + The [AudioStream] object to be played. </member> <member name="unit_db" type="float" setter="set_unit_db" getter="get_unit_db"> + Base sound level unaffected by dampening, in dB. </member> <member name="unit_size" type="float" setter="set_unit_size" getter="get_unit_size"> + Factor for the attenuation effect. </member> </members> <signals> <signal name="finished"> <description> + Fires when the audio stops playing. </description> </signal> </signals> <constants> <constant name="ATTENUATION_INVERSE_DISTANCE" value="0"> + Linear dampening of loudness according to distance. </constant> <constant name="ATTENUATION_INVERSE_SQUARE_DISTANCE" value="1"> + Squared dampening of loudness according to distance. </constant> <constant name="ATTENUATION_LOGARITHMIC" value="2"> + Logarithmic dampening of loudness according to distance. </constant> <constant name="OUT_OF_RANGE_MIX" value="0"> + Mix this audio in, even when it's out of range. </constant> <constant name="OUT_OF_RANGE_PAUSE" value="1"> + Pause this audio when it gets out of range. </constant> <constant name="DOPPLER_TRACKING_DISABLED" value="0"> + Disables doppler tracking. </constant> <constant name="DOPPLER_TRACKING_IDLE_STEP" value="1"> + Executes doppler trackin in idle step. </constant> <constant name="DOPPLER_TRACKING_FIXED_STEP" value="2"> + Executes doppler tracking in fixed step. </constant> </constants> </class> diff --git a/doc/classes/AudioStreamRandomPitch.xml b/doc/classes/AudioStreamRandomPitch.xml index 91856682e6..1573a78d1f 100644 --- a/doc/classes/AudioStreamRandomPitch.xml +++ b/doc/classes/AudioStreamRandomPitch.xml @@ -1,8 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="AudioStreamRandomPitch" inherits="AudioStream" category="Core" version="3.0.alpha.custom_build"> <brief_description> + Plays audio with random pitch tweaking. </brief_description> <description> + Randomly varies pitch on each start. </description> <tutorials> </tutorials> @@ -40,8 +42,10 @@ </methods> <members> <member name="audio_stream" type="AudioStream" setter="set_audio_stream" getter="get_audio_stream"> + The current [AudioStream]. </member> <member name="random_pitch" type="float" setter="set_random_pitch" getter="get_random_pitch"> + The intensity of random pitch variation. </member> </members> <constants> diff --git a/doc/classes/AudioStreamSample.xml b/doc/classes/AudioStreamSample.xml index 22b820aa7d..7f7414e4d3 100644 --- a/doc/classes/AudioStreamSample.xml +++ b/doc/classes/AudioStreamSample.xml @@ -1,8 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="AudioStreamSample" inherits="AudioStream" category="Core" version="3.0.alpha.custom_build"> <brief_description> + Plays audio. </brief_description> <description> + Plays audio, can loop. </description> <tutorials> </tutorials> @@ -110,32 +112,45 @@ </methods> <members> <member name="data" type="PoolByteArray" setter="set_data" getter="get_data"> + Raw audio data. </member> <member name="format" type="int" setter="set_format" getter="get_format" enum="AudioStreamSample.Format"> + Audio format. See FORMAT_* constants for values. </member> <member name="loop_begin" type="int" setter="set_loop_begin" getter="get_loop_begin"> + Loop start in bytes. </member> <member name="loop_end" type="int" setter="set_loop_end" getter="get_loop_end"> + Loop end in bytes. </member> <member name="loop_mode" type="int" setter="set_loop_mode" getter="get_loop_mode" enum="AudioStreamSample.LoopMode"> + Loop mode. See LOOP_* constants for values. </member> <member name="mix_rate" type="int" setter="set_mix_rate" getter="get_mix_rate"> + The sample rate for mixing this audio. </member> <member name="stereo" type="bool" setter="set_stereo" getter="is_stereo"> + If [code]true[/code], audio is stereo. Default value: [code]false[/code]. </member> </members> <constants> <constant name="FORMAT_8_BITS" value="0"> + Audio codec 8 bit. </constant> <constant name="FORMAT_16_BITS" value="1"> + Audio codec 16 bit. </constant> <constant name="FORMAT_IMA_ADPCM" value="2"> + Audio codec IMA ADPCM. </constant> <constant name="LOOP_DISABLED" value="0"> + Audio does not loop. </constant> <constant name="LOOP_FORWARD" value="1"> + Audio loops the data between loop_begin and loop_end playing forward only. </constant> <constant name="LOOP_PING_PONG" value="2"> + Audio loops the data between loop_begin and loop_end playing back and forth. </constant> </constants> </class> diff --git a/doc/classes/CanvasLayer.xml b/doc/classes/CanvasLayer.xml index f19e7ef041..3ee1f10536 100644 --- a/doc/classes/CanvasLayer.xml +++ b/doc/classes/CanvasLayer.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="CanvasLayer" inherits="Node" category="Core" version="3.0.alpha.custom_build"> <brief_description> - Canvas Item layer. + Canvas drawing layer. </brief_description> <description> - Canvas Item layer. [CanvasItem] nodes that are direct or indirect children of a [CanvasLayer] will be drawn in that layer. The layer is a numeric index that defines the draw order. The default 2D scene renders with index 0, so a [CanvasLayer] with index -1 will be drawn below, and one with index 1 will be drawn above. This is very useful for HUDs (in layer 1+ or above), or backgrounds (in layer -1 or below). + Canvas drawing layer. [CanvasItem] nodes that are direct or indirect children of a [CanvasLayer] will be drawn in that layer. The layer is a numeric index that defines the draw order. The default 2D scene renders with index 0, so a [CanvasLayer] with index -1 will be drawn below, and one with index 1 will be drawn above. This is very useful for HUDs (in layer 1+ or above), or backgrounds (in layer -1 or below). </description> <tutorials> </tutorials> @@ -131,12 +131,16 @@ </methods> <members> <member name="layer" type="int" setter="set_layer" getter="get_layer"> + Layer index for draw order. Lower values are drawn first. Default value: [code]1[/code]. </member> <member name="offset" type="Vector2" setter="set_offset" getter="get_offset"> + The layer's base offset. </member> <member name="rotation" type="float" setter="set_rotationd" getter="get_rotationd"> + The layer's rotation in degrees. </member> <member name="scale" type="Vector2" setter="set_scale" getter="get_scale"> + The layer's scale. </member> </members> <constants> diff --git a/doc/classes/CapsuleShape.xml b/doc/classes/CapsuleShape.xml index 29072203ea..db075a504c 100644 --- a/doc/classes/CapsuleShape.xml +++ b/doc/classes/CapsuleShape.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="CapsuleShape" inherits="Shape" category="Core" version="3.0.alpha.custom_build"> <brief_description> - Capsule shape resource. + Capsule shape for collisions. </brief_description> <description> - Capsule shape resource, which can be set into a [PhysicsBody] or area. + Capsule shape for collisions. </description> <tutorials> </tutorials> @@ -46,8 +46,10 @@ </methods> <members> <member name="height" type="float" setter="set_height" getter="get_height"> + The capsule's height. </member> <member name="radius" type="float" setter="set_radius" getter="get_radius"> + The capsule's radius. </member> </members> <constants> diff --git a/doc/classes/CapsuleShape2D.xml b/doc/classes/CapsuleShape2D.xml index 9c2b1c4a3d..df833e0582 100644 --- a/doc/classes/CapsuleShape2D.xml +++ b/doc/classes/CapsuleShape2D.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="CapsuleShape2D" inherits="Shape2D" category="Core" version="3.0.alpha.custom_build"> <brief_description> - Capsule 2D shape resource for physics. + Capsule shape for 2D collisions. </brief_description> <description> - Capsule 2D shape resource for physics. A capsule (or sometimes called "pill") is like a line grown in all directions. It has a radius and a height, and is often useful for modeling biped characters. + Capsule shape for 2D collisions. </description> <tutorials> </tutorials> @@ -46,8 +46,10 @@ </methods> <members> <member name="height" type="float" setter="set_height" getter="get_height"> + The capsule's height. </member> <member name="radius" type="float" setter="set_radius" getter="get_radius"> + The capsules's radius. </member> </members> <constants> diff --git a/doc/classes/CircleShape2D.xml b/doc/classes/CircleShape2D.xml index c3d4bdae03..1ed54f0705 100644 --- a/doc/classes/CircleShape2D.xml +++ b/doc/classes/CircleShape2D.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="CircleShape2D" inherits="Shape2D" category="Core" version="3.0.alpha.custom_build"> <brief_description> - Circular Shape for 2D Physics. + Circular shape for 2D collisions. </brief_description> <description> - Circular Shape for 2D Physics. This shape is useful for modeling balls or small characters and its collision detection with everything else is very fast. + Circular shape for 2D collisions. This shape is useful for modeling balls or small characters and its collision detection with everything else is very fast. </description> <tutorials> </tutorials> @@ -30,6 +30,7 @@ </methods> <members> <member name="radius" type="float" setter="set_radius" getter="get_radius"> + The circle's radius. </member> </members> <constants> diff --git a/doc/classes/CollisionPolygon.xml b/doc/classes/CollisionPolygon.xml index cf425e3d60..c2496424d6 100644 --- a/doc/classes/CollisionPolygon.xml +++ b/doc/classes/CollisionPolygon.xml @@ -1,8 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="CollisionPolygon" inherits="Spatial" category="Core" version="3.0.alpha.custom_build"> <brief_description> + Editor-only class for defining a collision polygon in 3D space. </brief_description> <description> + Allows editing a collision polygon's vertices on a selected plane. Can also set a depth perpendicular to that plane. This class is only available in the editor. It will not appear in the scene tree at runtime. Creates a [Shape] for gameplay. Properties modified during gameplay will have no effect. </description> <tutorials> </tutorials> @@ -54,10 +56,13 @@ </methods> <members> <member name="depth" type="float" setter="set_depth" getter="get_depth"> + Length that the resulting collision extends in either direction perpendicular to its polygon. </member> <member name="disabled" type="bool" setter="set_disabled" getter="is_disabled"> + If true, no collision will be produced. </member> <member name="polygon" type="PoolVector2Array" setter="set_polygon" getter="get_polygon"> + Array of vertices which define the polygon. </member> </members> <constants> diff --git a/doc/classes/CollisionPolygon2D.xml b/doc/classes/CollisionPolygon2D.xml index b602610167..d3dee1e9bb 100644 --- a/doc/classes/CollisionPolygon2D.xml +++ b/doc/classes/CollisionPolygon2D.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="CollisionPolygon2D" inherits="Node2D" category="Core" version="3.0.alpha.custom_build"> <brief_description> - Editor-only class for easy editing of collision polygons. + Editor-only class for defining a collision polygon in 2D space. </brief_description> <description> - Editor-only class. This is not present when running the game. It's used in the editor to properly edit and position collision shapes in [CollisionObject2D]. This is not accessible from regular code. This class is for editing custom shape polygons. + Allows editing a collision polygon's vertices. This class is only available in the editor. It will not appear in the scene tree at runtime. Creates a [Shape2D] for gameplay. Properties modified during gameplay will have no effect. </description> <tutorials> </tutorials> @@ -75,12 +75,16 @@ </methods> <members> <member name="build_mode" type="int" setter="set_build_mode" getter="get_build_mode" enum="CollisionPolygon2D.BuildMode"> + If BUILD_SOLIDS, the polygon and the area within it will have collision. If BUILD_SEGMENTS, only the edges of the polygon will have collision. </member> <member name="disabled" type="bool" setter="set_disabled" getter="is_disabled"> + If true, no collision will be produced. </member> <member name="one_way_collision" type="bool" setter="set_one_way_collision" getter="is_one_way_collision_enabled"> + If true, only edges that face up, relative to CollisionPolygon2D's rotation, will collide with other objects. </member> <member name="polygon" type="PoolVector2Array" setter="set_polygon" getter="get_polygon"> + Array of vertices which define the polygon. </member> </members> <constants> diff --git a/doc/classes/JSON.xml b/doc/classes/JSON.xml new file mode 100644 index 0000000000..a38b2f61cf --- /dev/null +++ b/doc/classes/JSON.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="JSON" inherits="Object" category="Core" version="3.0.alpha.custom_build"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <demos> + </demos> + <methods> + <method name="parse"> + <return type="JSONParseResult"> + </return> + <argument index="0" name="json" type="String"> + </argument> + <description> + </description> + </method> + <method name="print"> + <return type="String"> + </return> + <argument index="0" name="value" type="Variant"> + </argument> + <description> + </description> + </method> + </methods> + <constants> + </constants> +</class> diff --git a/doc/classes/JSONParseResult.xml b/doc/classes/JSONParseResult.xml new file mode 100644 index 0000000000..6aeb614508 --- /dev/null +++ b/doc/classes/JSONParseResult.xml @@ -0,0 +1,81 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="JSONParseResult" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <demos> + </demos> + <methods> + <method name="get_error" qualifiers="const"> + <return type="int" enum="Error"> + </return> + <description> + </description> + </method> + <method name="get_error_line" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="get_error_string" qualifiers="const"> + <return type="String"> + </return> + <description> + </description> + </method> + <method name="get_result" qualifiers="const"> + <return type="Variant"> + </return> + <description> + </description> + </method> + <method name="set_error"> + <return type="void"> + </return> + <argument index="0" name="error" type="int" enum="Error"> + </argument> + <description> + </description> + </method> + <method name="set_error_line"> + <return type="void"> + </return> + <argument index="0" name="error_line" type="int"> + </argument> + <description> + </description> + </method> + <method name="set_error_string"> + <return type="void"> + </return> + <argument index="0" name="error_string" type="String"> + </argument> + <description> + </description> + </method> + <method name="set_result"> + <return type="void"> + </return> + <argument index="0" name="result" type="Variant"> + </argument> + <description> + </description> + </method> + </methods> + <members> + <member name="error" type="int" setter="set_error" getter="get_error" enum="Error"> + </member> + <member name="error_line" type="int" setter="set_error_line" getter="get_error_line"> + </member> + <member name="error_string" type="String" setter="set_error_string" getter="get_error_string"> + </member> + <member name="result" type="Variant" setter="set_result" getter="get_result"> + </member> + </members> + <constants> + </constants> +</class> diff --git a/doc/classes/KinematicBody2D.xml b/doc/classes/KinematicBody2D.xml index 26c7c6125d..dddae2c0fc 100644 --- a/doc/classes/KinematicBody2D.xml +++ b/doc/classes/KinematicBody2D.xml @@ -63,6 +63,7 @@ <argument index="0" name="rel_vec" type="Vector2"> </argument> <description> + Moves the body along the given vector. The body will stop if it collides. Returns a [KinematicCollision2D], which contains information about the colliding body. </description> </method> <method name="move_and_slide"> @@ -97,7 +98,7 @@ <argument index="1" name="rel_vec" type="Vector2"> </argument> <description> - Return true if there would be a collision if the body moved from the given point in the given direction. + Returns true if there would be a collision if the body moved from the given point in the given direction. </description> </method> </methods> diff --git a/doc/classes/KinematicCollision.xml b/doc/classes/KinematicCollision.xml index 5e5b125654..b7269a646e 100644 --- a/doc/classes/KinematicCollision.xml +++ b/doc/classes/KinematicCollision.xml @@ -1,8 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="KinematicCollision" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> <brief_description> + Collision data for KinematicBody2D collisions. </brief_description> <description> + Contains collision data for KinematicBody collisions. When a [KinematicBody] is moved using [method KinematicBody.move_and_collide], it stops if it detects a collision with another body. If a collision is detected, a KinematicCollision object is returned. + This object contains information about the collision, including the colliding object, the remaining motion, and the collision position. This information can be used to calculate a collision response. </description> <tutorials> </tutorials> @@ -78,26 +81,37 @@ </methods> <members> <member name="collider" type="Object" setter="" getter="get_collider"> + The colliding body. </member> <member name="collider_id" type="int" setter="" getter="get_collider_id"> + The colliding body's unique [RID]. </member> <member name="collider_metadata" type="Variant" setter="" getter="get_collider_metadata"> + The colliding body's metadata. See [Object]. </member> <member name="collider_shape" type="Object" setter="" getter="get_collider_shape"> + The colliding body's shape. </member> <member name="collider_shape_index" type="int" setter="" getter="get_collider_shape_index"> + The colliding shape's index. See [CollisionObject]. </member> <member name="collider_velocity" type="Vector3" setter="" getter="get_collider_velocity"> + The colliding object's velocity. </member> <member name="local_shape" type="Object" setter="" getter="get_local_shape"> + The moving object's colliding shape. </member> <member name="normal" type="Vector3" setter="" getter="get_normal"> + The colliding body's shape's normal at the point of collision. </member> <member name="position" type="Vector3" setter="" getter="get_position"> + The point of collision. </member> <member name="remainder" type="Vector3" setter="" getter="get_remainder"> + The moving object's remaining movement vector. </member> <member name="travel" type="Vector3" setter="" getter="get_travel"> + The distance the moving object traveled before collision. </member> </members> <constants> diff --git a/doc/classes/KinematicCollision2D.xml b/doc/classes/KinematicCollision2D.xml index 4ef35066d0..7a40a39292 100644 --- a/doc/classes/KinematicCollision2D.xml +++ b/doc/classes/KinematicCollision2D.xml @@ -1,8 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="KinematicCollision2D" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> <brief_description> + Collision data for KinematicBody2D collisions. </brief_description> <description> + Contains collision data for KinematicBody2D collisions. When a [KinematicBody2D] is moved using [method KinematicBody2D.move_and_collide], it stops if it detects a collision with another body. If a collision is detected, a KinematicCollision2D object is returned. + This object contains information about the collision, including the colliding object, the remaining motion, and the collision position. This information can be used to calculate a collision response. </description> <tutorials> </tutorials> @@ -78,26 +81,37 @@ </methods> <members> <member name="collider" type="Object" setter="" getter="get_collider"> + The colliding body. </member> <member name="collider_id" type="int" setter="" getter="get_collider_id"> + The colliding body's unique [RID]. </member> <member name="collider_metadata" type="Variant" setter="" getter="get_collider_metadata"> + The colliding body's metadata. See [Object]. </member> <member name="collider_shape" type="Object" setter="" getter="get_collider_shape"> + The colliding body's shape. </member> <member name="collider_shape_index" type="int" setter="" getter="get_collider_shape_index"> + The colliding shape's index. See [CollisionObject2D]. </member> <member name="collider_velocity" type="Vector2" setter="" getter="get_collider_velocity"> + The colliding object's velocity. </member> <member name="local_shape" type="Object" setter="" getter="get_local_shape"> + The moving object's colliding shape. </member> <member name="normal" type="Vector2" setter="" getter="get_normal"> + The colliding body's shape's normal at the point of collision. </member> <member name="position" type="Vector2" setter="" getter="get_position"> + The point of collision. </member> <member name="remainder" type="Vector2" setter="" getter="get_remainder"> + The moving object's remaining movement vector. </member> <member name="travel" type="Vector2" setter="" getter="get_travel"> + The distance the moving object traveled before collision. </member> </members> <constants> diff --git a/doc/classes/Label.xml b/doc/classes/Label.xml index 2e860aac0c..8c5e69b407 100644 --- a/doc/classes/Label.xml +++ b/doc/classes/Label.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="Label" inherits="Control" category="Core" version="3.0.alpha.custom_build"> <brief_description> - Control that displays formatted text. + Displays plain text in a line or wrapped inside a rectangle. For formatted text, use [RichTextLabel]. </brief_description> <description> - Label is a control that displays formatted text, optionally autowrapping it to the [Control] area. It inherits from range to be able to scroll wrapped text vertically. + Label displays plain text on the screen. It gives you control over the horizontal and vertical alignment, and can wrap the text inside the node's bounding rectangle. It doesn't support bold, italics or other formatting. For that, use [RichTextLabel] instead. </description> <tutorials> </tutorials> @@ -22,14 +22,14 @@ <return type="int"> </return> <description> - Return the amount of lines. + Returns the amount of lines of text the Label has. </description> </method> <method name="get_line_height" qualifiers="const"> <return type="int"> </return> <description> - Return the height of a line. + Returns the font size in pixels. </description> </method> <method name="get_lines_skipped" qualifiers="const"> @@ -98,14 +98,14 @@ <return type="bool"> </return> <description> - Return true if text would be cut off if it is too wide. + Return [code]true[/code] if text would be cut off if it is too wide. </description> </method> <method name="is_uppercase" qualifiers="const"> <return type="bool"> </return> <description> - Return true if text is displayed in all capitals. + Return [code]true[/code] if text is displayed in all capitals. </description> </method> <method name="set_align"> @@ -201,22 +201,31 @@ </methods> <members> <member name="align" type="int" setter="set_align" getter="get_align" enum="Label.Align"> + Controls the text's horizontal align. Supports left, center, right, and fill, or justify. Set it to one of the [code]ALIGN_*[/code] constants. </member> <member name="autowrap" type="bool" setter="set_autowrap" getter="has_autowrap"> + If [code]true[/code], wraps the text inside the node's bounding rectangle. If you resize the node, it will change its height automatically to show all the text. Default: false. </member> <member name="clip_text" type="bool" setter="set_clip_text" getter="is_clipping_text"> + If [code]true[/code], the Label only shows the text that fits inside its bounding rectangle. It also lets you scale the node down freely. </member> <member name="lines_skipped" type="int" setter="set_lines_skipped" getter="get_lines_skipped"> + The node ignores the first [code]lines_skipped[/code] lines before it starts to display text. </member> <member name="max_lines_visible" type="int" setter="set_max_lines_visible" getter="get_max_lines_visible"> + Limits the lines of text the node shows on screen. </member> <member name="percent_visible" type="float" setter="set_percent_visible" getter="get_percent_visible"> + Limits the count of visible characters. If you set [code]percent_visible[/code] to 50, only up to half of the text's characters will display on screen. Useful to animate the text in a dialog box. </member> <member name="text" type="String" setter="set_text" getter="get_text"> + The text to display on screen. </member> <member name="uppercase" type="bool" setter="set_uppercase" getter="is_uppercase"> + If [code]true[/code], all the text displays as UPPERCASE. </member> <member name="valign" type="int" setter="set_valign" getter="get_valign" enum="Label.VAlign"> + Controls the text's vertical align. Supports top, center, bottom, and fill. Set it to one of the [code]VALIGN_*[/code] constants. </member> </members> <constants> diff --git a/doc/classes/Light2D.xml b/doc/classes/Light2D.xml index 1386fc53d9..7ce7cef7c1 100644 --- a/doc/classes/Light2D.xml +++ b/doc/classes/Light2D.xml @@ -340,46 +340,67 @@ </methods> <members> <member name="color" type="Color" setter="set_color" getter="get_color"> + The Light2D's [Color]. </member> <member name="editor_only" type="bool" setter="set_editor_only" getter="is_editor_only"> + If [code]true[/code] Light2D will only appear when editing the scene. Default value: [code]false[/code]. </member> <member name="enabled" type="bool" setter="set_enabled" getter="is_enabled"> + If [code]true[/code] Light2D will emit light. Default value: [code]true[/code]. </member> <member name="energy" type="float" setter="set_energy" getter="get_energy"> + The Light2D's energy value. The larger the value, the stronger the light. </member> <member name="mode" type="int" setter="set_mode" getter="get_mode" enum="Light2D.Mode"> + The Light2D's mode. See MODE_* constants for values. </member> <member name="offset" type="Vector2" setter="set_texture_offset" getter="get_texture_offset"> + The offset of the Light2D's [code]texture[/code]. </member> <member name="range_height" type="float" setter="set_height" getter="get_height"> + The height of the Light2D. Used with 2D normal mapping. </member> <member name="range_item_cull_mask" type="int" setter="set_item_cull_mask" getter="get_item_cull_mask"> + The layer mask. Only objects with a matching mask will be affected by the Light2D. </member> <member name="range_layer_max" type="int" setter="set_layer_range_max" getter="get_layer_range_max"> + Maximum layer value of objects that are affected by the Light2D. Default value: [code]0[/code]. </member> <member name="range_layer_min" type="int" setter="set_layer_range_min" getter="get_layer_range_min"> + Minimum layer value of objects that are affected by the Light2D. Default value: [code]0[/code]. </member> <member name="range_z_max" type="int" setter="set_z_range_max" getter="get_z_range_max"> + Maximum [code]Z[/code] value of objects that are affected by the Light2D. Default value: [code]1024[/code]. </member> <member name="range_z_min" type="int" setter="set_z_range_min" getter="get_z_range_min"> + Minimum [code]z[/code] value of objects that are affected by the Light2D. Default value: [code]-1024[/code]. </member> <member name="shadow_buffer_size" type="int" setter="set_shadow_buffer_size" getter="get_shadow_buffer_size"> + Shadow buffer size. Default value: [code]2048[/code]. </member> <member name="shadow_color" type="Color" setter="set_shadow_color" getter="get_shadow_color"> + [Color] of shadows cast by the Light2D. </member> <member name="shadow_enabled" type="bool" setter="set_shadow_enabled" getter="is_shadow_enabled"> + If [code]true[/code] the Light2D will cast shadows. Default value: [code]false[/code]. </member> <member name="shadow_filter" type="int" setter="set_shadow_filter" getter="get_shadow_filter" enum="Light2D.ShadowFilter"> + Shadow filter type. May be one of [code][None, PCF5, PCF9, PCF13][/code]. Default value: [code]None[/code]. </member> <member name="shadow_filter_smooth" type="float" setter="set_shadow_smooth" getter="get_shadow_smooth"> + Smoothing value for shadows. </member> <member name="shadow_gradient_length" type="float" setter="set_shadow_gradient_length" getter="get_shadow_gradient_length"> + Smooth shadow gradient length. </member> <member name="shadow_item_cull_mask" type="int" setter="set_item_shadow_cull_mask" getter="get_item_shadow_cull_mask"> + The shadow mask. Used with [LightOccluder2D] to cast shadows. Only occluders with a matching shadow mask will cast shadows. </member> <member name="texture" type="Texture" setter="set_texture" getter="get_texture"> + [Texture] used for the Light2D's appearance. </member> <member name="texture_scale" type="float" setter="set_texture_scale" getter="get_texture_scale"> + The [code]texture[/code]'s scale factor. </member> </members> <constants> diff --git a/doc/classes/LineShape2D.xml b/doc/classes/LineShape2D.xml index 3346c46a19..5596c48162 100644 --- a/doc/classes/LineShape2D.xml +++ b/doc/classes/LineShape2D.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="LineShape2D" inherits="Shape2D" category="Core" version="3.0.alpha.custom_build"> <brief_description> - Line shape for 2D collision objects. + Line shape for 2D collisions. </brief_description> <description> - Line shape for 2D collision objects. It works like a 2D plane and will not allow any body to go to the negative side. Not recommended for rigid bodies, and usually not recommended for static bodies either because it forces checks against it on every frame. + Line shape for 2D collisions. It works like a 2D plane and will not allow any body to go to the negative side. Not recommended for rigid bodies, and usually not recommended for static bodies either because it forces checks against it on every frame. </description> <tutorials> </tutorials> @@ -46,8 +46,10 @@ </methods> <members> <member name="d" type="float" setter="set_d" getter="get_d"> + The line's distance from the origin. </member> <member name="normal" type="Vector2" setter="set_normal" getter="get_normal"> + The line's normal. </member> </members> <constants> diff --git a/doc/classes/NinePatchRect.xml b/doc/classes/NinePatchRect.xml index 092e928ef9..6829b36e14 100644 --- a/doc/classes/NinePatchRect.xml +++ b/doc/classes/NinePatchRect.xml @@ -1,8 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="NinePatchRect" inherits="Control" category="Core" version="3.0.alpha.custom_build"> <brief_description> + Scalable texture-based frame that tiles the texture's centers and sides, but keeps the corners' original size. Perfect for panels and dialog boxes. </brief_description> <description> + Better known as 9-slice panels, NinePatchRect produces clean panels of any size, based on a small texture. To do so, it splits the texture in a 3 by 3 grid. When you scale the node, it tiles the texture's sides horizontally or vertically, the center on both axes but it doesn't scale or tile the corners. </description> <tutorials> </tutorials> @@ -100,36 +102,49 @@ </methods> <members> <member name="axis_stretch_horizontal" type="int" setter="set_h_axis_stretch_mode" getter="get_h_axis_stretch_mode" enum="NinePatchRect.AxisStretchMode"> + Doesn't do anything at the time of writing. </member> <member name="axis_stretch_vertical" type="int" setter="set_v_axis_stretch_mode" getter="get_v_axis_stretch_mode" enum="NinePatchRect.AxisStretchMode"> + Doesn't do anything at the time of writing. </member> <member name="draw_center" type="bool" setter="set_draw_center" getter="is_draw_center_enabled"> + If [code]true[/code], draw the panel's center. Else, only draw the 9-slice's borders. Default value: [code]true[/code] </member> <member name="patch_margin_bottom" type="int" setter="set_patch_margin" getter="get_patch_margin"> + The height of the 9-slice's bottom row. A margin of 16 means the 9-slice's bottom corners and side will have a height of 16 pixels. You can set all 4 margin values indivually to create panels with non-uniform borders. </member> <member name="patch_margin_left" type="int" setter="set_patch_margin" getter="get_patch_margin"> + The height of the 9-slice's left column. </member> <member name="patch_margin_right" type="int" setter="set_patch_margin" getter="get_patch_margin"> + The height of the 9-slice's right column. </member> <member name="patch_margin_top" type="int" setter="set_patch_margin" getter="get_patch_margin"> + The height of the 9-slice's top row. </member> <member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect"> + Rectangular region of the texture to sample from. If you're working with an atlas, use this property to define the area the 9-slice should use. All other properties are relative to this one. </member> <member name="texture" type="Texture" setter="set_texture" getter="get_texture"> + The node's texture resource. </member> </members> <signals> <signal name="texture_changed"> <description> + Fired when the node's texture changes. </description> </signal> </signals> <constants> <constant name="AXIS_STRETCH_MODE_STRETCH" value="0"> + Doesn't do anything at the time of writing. Default value for [code]axis_stretch_horizontal[/code] and [code]axis_stretch_vertical[/code]. </constant> <constant name="AXIS_STRETCH_MODE_TILE" value="1"> + Doesn't do anything at the time of writing. </constant> <constant name="AXIS_STRETCH_MODE_TILE_FIT" value="2"> + Doesn't do anything at the time of writing. </constant> </constants> </class> diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index 5b14d5a746..65200c4769 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -286,7 +286,7 @@ </description> </method> <method name="get_screen_orientation" qualifiers="const"> - <return type="int" enum="_OS.ScreenOrientation"> + <return type="int" enum="OS.ScreenOrientation"> </return> <description> Returns the current screen orientation, the return value will be one of the SCREEN_ORIENTATION constants in this class. @@ -331,7 +331,7 @@ <method name="get_system_dir" qualifiers="const"> <return type="String"> </return> - <argument index="0" name="dir" type="int" enum="_OS.SystemDir"> + <argument index="0" name="dir" type="int" enum="OS.SystemDir"> </argument> <description> </description> @@ -660,7 +660,7 @@ <method name="set_screen_orientation"> <return type="void"> </return> - <argument index="0" name="orientation" type="int" enum="_OS.ScreenOrientation"> + <argument index="0" name="orientation" type="int" enum="OS.ScreenOrientation"> </argument> <description> Sets the current screen orientation, the argument value must be one of the SCREEN_ORIENTATION constants in this class. @@ -840,15 +840,15 @@ </constant> <constant name="SYSTEM_DIR_RINGTONES" value="7"> </constant> - <constant name="OS::POWERSTATE_UNKNOWN" value="0"> + <constant name="POWERSTATE_UNKNOWN" value="0"> </constant> - <constant name="OS::POWERSTATE_ON_BATTERY" value="1"> + <constant name="POWERSTATE_ON_BATTERY" value="1"> </constant> - <constant name="OS::POWERSTATE_NO_BATTERY" value="2"> + <constant name="POWERSTATE_NO_BATTERY" value="2"> </constant> - <constant name="OS::POWERSTATE_CHARGING" value="3"> + <constant name="POWERSTATE_CHARGING" value="3"> </constant> - <constant name="OS::POWERSTATE_CHARGED" value="4"> + <constant name="POWERSTATE_CHARGED" value="4"> </constant> </constants> </class> diff --git a/doc/classes/PhysicsBody.xml b/doc/classes/PhysicsBody.xml index e8ae986346..e75fbb8e2d 100644 --- a/doc/classes/PhysicsBody.xml +++ b/doc/classes/PhysicsBody.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="PhysicsBody" inherits="CollisionObject" category="Core" version="3.0.alpha.custom_build"> <brief_description> - Base class for different types of Physics bodies. + Base class for all objects affected by physics in 3D space. </brief_description> <description> - PhysicsBody is an abstract base class for implementing a physics body. All PhysicsBody types inherit from it. + PhysicsBody is an abstract base class for implementing a physics body. All *Body types inherit from it. </description> <tutorials> </tutorials> @@ -17,7 +17,7 @@ <argument index="0" name="body" type="Node"> </argument> <description> - Adds a body to the collision exception list. This list contains bodies that this body will not collide with. + Adds a body to the list of bodies that this body can't collide with. </description> </method> <method name="get_collision_layer" qualifiers="const"> @@ -54,7 +54,7 @@ <argument index="0" name="body" type="Node"> </argument> <description> - Removes a body from the collision exception list. + Removes a body from the list of bodies that this body can't collide with. </description> </method> <method name="set_collision_layer"> @@ -96,8 +96,12 @@ </methods> <members> <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer"> + The physics layers this area is in. + Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the collision_mask property. + A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. </member> <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask"> + The physics layers this area can scan for collisions. </member> </members> <constants> diff --git a/doc/classes/PhysicsBody2D.xml b/doc/classes/PhysicsBody2D.xml index e160311090..748506baa9 100644 --- a/doc/classes/PhysicsBody2D.xml +++ b/doc/classes/PhysicsBody2D.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="PhysicsBody2D" inherits="CollisionObject2D" category="Core" version="3.0.alpha.custom_build"> <brief_description> - Base class for all objects affected by physics. + Base class for all objects affected by physics in 2D space. </brief_description> <description> PhysicsBody2D is an abstract base class for implementing a physics body. All *Body2D types inherit from it. @@ -17,6 +17,7 @@ <argument index="0" name="body" type="Node"> </argument> <description> + Adds a body to the list of bodies that this body can't collide with. </description> </method> <method name="get_collision_layer" qualifiers="const"> @@ -57,6 +58,7 @@ <argument index="0" name="body" type="Node"> </argument> <description> + Removes a body from the list of bodies that this body can't collide with. </description> </method> <method name="set_collision_layer"> @@ -104,10 +106,15 @@ </methods> <members> <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer"> + The physics layers this area is in. + Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the collision_mask property. + A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. </member> <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask"> + The physics layers this area can scan for collisions. </member> <member name="layers" type="int" setter="_set_layers" getter="_get_layers"> + Both collision_layer and collision_mask. Returns collision_layer when accessed. Updates collision_layers and collision_mask when modified. </member> </members> <constants> diff --git a/doc/classes/RayShape2D.xml b/doc/classes/RayShape2D.xml index 8414ee2348..4f6313a1d2 100644 --- a/doc/classes/RayShape2D.xml +++ b/doc/classes/RayShape2D.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="RayShape2D" inherits="Shape2D" category="Core" version="3.0.alpha.custom_build"> <brief_description> - Ray 2D shape resource for physics. + Ray shape for 2D collisions. </brief_description> <description> - Ray 2D shape resource for physics. A ray is not really a collision body, instead it tries to separate itself from whatever is touching its far endpoint. It's often useful for characters. + Ray shape for 2D collisions. A ray is not really a collision body, instead it tries to separate itself from whatever is touching its far endpoint. It's often useful for characters. </description> <tutorials> </tutorials> @@ -30,6 +30,7 @@ </methods> <members> <member name="length" type="float" setter="set_length" getter="get_length"> + The ray's length. </member> </members> <constants> diff --git a/doc/classes/RectangleShape2D.xml b/doc/classes/RectangleShape2D.xml index 9c18df970b..7a1aec2021 100644 --- a/doc/classes/RectangleShape2D.xml +++ b/doc/classes/RectangleShape2D.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="RectangleShape2D" inherits="Shape2D" category="Core" version="3.0.alpha.custom_build"> <brief_description> - Rectangle Shape for 2D Physics. + Rectangle shape for 2D collisions. </brief_description> <description> - Rectangle Shape for 2D Physics. This shape is useful for modeling box-like 2D objects. + Rectangle shape for 2D collisions. This shape is useful for modeling box-like 2D objects. </description> <tutorials> </tutorials> @@ -30,6 +30,7 @@ </methods> <members> <member name="extents" type="Vector2" setter="set_extents" getter="get_extents"> + The rectangle's half extents. The width and height of this shape is twice the half extents. </member> </members> <constants> diff --git a/doc/classes/SegmentShape2D.xml b/doc/classes/SegmentShape2D.xml index 0e2c5c86f3..3b7a747bcb 100644 --- a/doc/classes/SegmentShape2D.xml +++ b/doc/classes/SegmentShape2D.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="SegmentShape2D" inherits="Shape2D" category="Core" version="3.0.alpha.custom_build"> <brief_description> - Segment Shape for 2D Collision Detection. + Segment shape for 2D collisions. </brief_description> <description> - Segment Shape for 2D Collision Detection, consists of two points, 'a' and 'b'. + Segment shape for 2D collisions. Consists of two points, [code]a[/code] and [code]b[/code]. </description> <tutorials> </tutorials> @@ -46,8 +46,10 @@ </methods> <members> <member name="a" type="Vector2" setter="set_a" getter="get_a"> + The segment's first point position. </member> <member name="b" type="Vector2" setter="set_b" getter="get_b"> + The segment's second point position. </member> </members> <constants> diff --git a/doc/classes/Spatial.xml b/doc/classes/Spatial.xml index 076d0b9bc3..e43e4dcc1b 100644 --- a/doc/classes/Spatial.xml +++ b/doc/classes/Spatial.xml @@ -4,7 +4,7 @@ Most basic 3D game object, parent of all 3D related nodes. </brief_description> <description> - Most basic 3D game object, with a 3D [Transform] and visibility settings. All 3D physics nodes and sprites inherit from Spatial. Use Spatial as a parent node to move, scale, rotate and show/hide children in a 3D project. + Most basic 3D game object, with a 3D [Transform] and visibility settings. All other 3D game objects inherit from Spatial. Use Spatial as a parent node to move, scale, rotate and show/hide children in a 3D project. </description> <tutorials> </tutorials> @@ -15,35 +15,35 @@ <return type="SpatialGizmo"> </return> <description> - Return the SpatialGizmo for this node. Used for example in [EditorSpatialGizmo] as custom visualization and editing handles in Editor. + Returns the SpatialGizmo for this node. Used for example in [EditorSpatialGizmo] as custom visualization and editing handles in Editor. </description> </method> <method name="get_global_transform" qualifiers="const"> <return type="Transform"> </return> <description> - Return the global transform, relative to worldspace. + Returns the global transform, relative to worldspace. </description> </method> <method name="get_parent_spatial" qualifiers="const"> <return type="Spatial"> </return> <description> - Return the parent [Spatial], or an empty [Object] if no parent exists or parent is not of type [Spatial]. + Returns the parent [Spatial], or an empty [Object] if no parent exists or parent is not of type [Spatial]. </description> </method> <method name="get_rotation" qualifiers="const"> <return type="Vector3"> </return> <description> - Return the rotation (in radians). + Returns the rotation (in radians). </description> </method> <method name="get_rotation_deg" qualifiers="const"> <return type="Vector3"> </return> <description> - Return the rotation (in degrees). + Returns the rotation (in degrees). </description> </method> <method name="get_scale" qualifiers="const"> @@ -56,7 +56,7 @@ <return type="Transform"> </return> <description> - Return the local transform, relative to the bone parent. + Returns the local transform, relative to the bone parent. </description> </method> <method name="get_translation" qualifiers="const"> @@ -69,7 +69,7 @@ <return type="World"> </return> <description> - Return current [World] resource this Spatial node is registered to. + Returns the current [World] resource this Spatial node is registered to. </description> </method> <method name="global_rotate"> @@ -80,7 +80,7 @@ <argument index="1" name="radians" type="float"> </argument> <description> - Rotate current node along normal [Vector3] by angle in radians in Global space. + Rotates the current node along normal [Vector3] by angle in radians in Global space. </description> </method> <method name="global_translate"> @@ -89,49 +89,49 @@ <argument index="0" name="offset" type="Vector3"> </argument> <description> - Move current node by [Vector3] offset in Global space. + Moves the node by [Vector3] offset in Global space. </description> </method> <method name="hide"> <return type="void"> </return> <description> - Disable rendering of this node. Change Spatial Visible property to false. + Disables rendering of this node. Change Spatial Visible property to false. </description> </method> <method name="is_local_transform_notification_enabled" qualifiers="const"> <return type="bool"> </return> <description> - Returns whether node sends notification that its local transformation changed. Spatial will not propagate this by default. + Returns whether node notifies about its local transformation changes. Spatial will not propagate this by default. </description> </method> <method name="is_set_as_toplevel" qualifiers="const"> <return type="bool"> </return> <description> - Returns whether this node is set as Toplevel, ignoring its parent node transformations. + Returns whether this node is set as Toplevel, that is whether it ignores its parent nodes transformations. </description> </method> <method name="is_transform_notification_enabled" qualifiers="const"> <return type="bool"> </return> <description> - Returns whether node sends notification that its transformation changed. Spatial will not propagate this by default. + Returns whether the node notifies about its global and local transformation changes. Spatial will not propagate this by default. </description> </method> <method name="is_visible" qualifiers="const"> <return type="bool"> </return> <description> - Returns whether this node is set to be visible. + Returns whether the node is set to be visible. </description> </method> <method name="is_visible_in_tree" qualifiers="const"> <return type="bool"> </return> <description> - Returns whether this node is visible, taking into consideration that its parents visibility. + Returns whether the node is visible, taking into consideration that its parents visibility. </description> </method> <method name="look_at"> @@ -155,14 +155,14 @@ <argument index="2" name="up" type="Vector3"> </argument> <description> - Moves itself to specified position and then rotates itself to point into direction of target position. Operations take place in global space. + Moves the node to specified position and then rotates itself to point into direction of target position. Operations take place in global space. </description> </method> <method name="orthonormalize"> <return type="void"> </return> <description> - Reset this node transformations (like scale, skew and taper) preserving its rotation and translation. Performs orthonormalization on this node [Transform3D]. + Resets this node's transformations (like scale, skew and taper) preserving its rotation and translation. Performs orthonormalization on this node [Transform3D]. </description> </method> <method name="rotate"> @@ -173,7 +173,7 @@ <argument index="1" name="radians" type="float"> </argument> <description> - Rotates node in local space on given normal [Vector3] by angle in radians. + Rotates the node in local space on given normal [Vector3] by angle in radians. </description> </method> <method name="rotate_x"> @@ -182,7 +182,7 @@ <argument index="0" name="radians" type="float"> </argument> <description> - Rotates node in local space on X axis by angle in radians. + Rotates the node in local space on X axis by angle in radians. </description> </method> <method name="rotate_y"> @@ -191,7 +191,7 @@ <argument index="0" name="radians" type="float"> </argument> <description> - Rotates node in local space on Y axis by angle in radians. + Rotates the node in local space on Y axis by angle in radians. </description> </method> <method name="rotate_z"> @@ -200,7 +200,7 @@ <argument index="0" name="radians" type="float"> </argument> <description> - Rotates node in local space on Z axis by angle in radians. + Rotates the node in local space on Z axis by angle in radians. </description> </method> <method name="set_as_toplevel"> @@ -209,7 +209,7 @@ <argument index="0" name="enable" type="bool"> </argument> <description> - Makes this node ignore its parents tranformations. Node tranformations are only in global space. + Makes the node ignore its parents tranformations. Node tranformations are only in global space. </description> </method> <method name="set_gizmo"> @@ -243,7 +243,7 @@ <argument index="0" name="enabled" type="bool"> </argument> <description> - Set whether this node ignores notification that its transformation changed. + Set whether the node ignores notification that its transformation (global or local) changed. </description> </method> <method name="set_notify_local_transform"> @@ -252,7 +252,7 @@ <argument index="0" name="enable" type="bool"> </argument> <description> - Set whether this node sends notification that its local transformation changed. Spatial will not propagate this by default. + Set whether the node notifies about its local transformation changes. Spatial will not propagate this by default. </description> </method> <method name="set_notify_transform"> @@ -261,7 +261,7 @@ <argument index="0" name="enable" type="bool"> </argument> <description> - Set whether this node sends notification that its transformation changed. Spatial will not propagate this by default. + Set whether the node notifies about its global and local transformation changes. Spatial will not propagate this by default. </description> </method> <method name="set_rotation"> @@ -320,7 +320,7 @@ <return type="void"> </return> <description> - Enable rendering of this node. Change Spatial Visible property to false. + Enables rendering of this node. Change Spatial Visible property to "True". </description> </method> <method name="to_global" qualifiers="const"> @@ -329,7 +329,7 @@ <argument index="0" name="local_point" type="Vector3"> </argument> <description> - Tranform [Vector3] from this node local space to world space. + Tranforms [Vector3] "local_point" from this node's local space to world space. </description> </method> <method name="to_local" qualifiers="const"> @@ -338,7 +338,7 @@ <argument index="0" name="global_point" type="Vector3"> </argument> <description> - Tranform [Vector3] from world space to this node local space. + Tranforms [Vector3] "global_point" from world space to this node's local space. </description> </method> <method name="translate"> @@ -347,14 +347,14 @@ <argument index="0" name="offset" type="Vector3"> </argument> <description> - Change node position by given offset [Vector3]. + Changes the node's position by given offset [Vector3]. </description> </method> <method name="update_gizmo"> <return type="void"> </return> <description> - Update [SpatialGizmo] of this node. + Updates the [SpatialGizmo] of this node. </description> </method> </methods> @@ -384,23 +384,23 @@ <signals> <signal name="visibility_changed"> <description> - Emitted when node visibility changed. + Emitted when node visibility changes. </description> </signal> </signals> <constants> <constant name="NOTIFICATION_TRANSFORM_CHANGED" value="29" enum=""> - Spatial nodes receive this notification when their global transform changes. This means that either the current or a parent node changed its transform. + Spatial nodes receives this notification when their global transform changes. This means that either the current or a parent node changed its transform. In order for NOTIFICATION_TRANSFORM_CHANGED to work user first needs to ask for it, with set_notify_transform(true). </constant> <constant name="NOTIFICATION_ENTER_WORLD" value="41" enum=""> - Spatial nodes receive this notification when they are registered to new [World] resource. + Spatial nodes receives this notification when they are registered to new [World] resource. </constant> <constant name="NOTIFICATION_EXIT_WORLD" value="42" enum=""> - Spatial nodes receive this notification when they are unregistered from current [World] resource. + Spatial nodes receives this notification when they are unregistered from current [World] resource. </constant> <constant name="NOTIFICATION_VISIBILITY_CHANGED" value="43" enum=""> - Spatial nodes receive this notification when their visibility changes. + Spatial nodes receives this notification when their visibility changes. </constant> </constants> </class> diff --git a/doc/classes/TextureProgress.xml b/doc/classes/TextureProgress.xml index 1ac031c411..0a6ffcdeb8 100644 --- a/doc/classes/TextureProgress.xml +++ b/doc/classes/TextureProgress.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="TextureProgress" inherits="Range" category="Core" version="3.0.alpha.custom_build"> <brief_description> - Textured progress bar implementation. + Textured progress bar. </brief_description> <description> - [ProgressBar] implementation that is easier to theme (by just passing a few textures). + A [ProgressBar] that uses textures to display fill percentage. Can be set to linear or radial mode. </description> <tutorials> </tutorials> @@ -148,28 +148,40 @@ </methods> <members> <member name="fill_mode" type="int" setter="set_fill_mode" getter="get_fill_mode"> + The fill direction. Uses FILL_* constants. </member> <member name="nine_patch_stretch" type="bool" setter="set_nine_patch_stretch" getter="get_nine_patch_stretch"> + If [code]true[/code] textures will be stretched as [NinePatchRect]. Uses [code]stretch_margin[/code] properties (see below). Default value: [code]false[/code] </member> <member name="radial_center_offset" type="Vector2" setter="set_radial_center_offset" getter="get_radial_center_offset"> + The offset amount for radial mode. </member> <member name="radial_fill_degrees" type="float" setter="set_fill_degrees" getter="get_fill_degrees"> + The amount of the texture to use for radial mode. </member> <member name="radial_initial_angle" type="float" setter="set_radial_initial_angle" getter="get_radial_initial_angle"> + Start angle for radial mode. </member> <member name="stretch_margin_bottom" type="int" setter="set_stretch_margin" getter="get_stretch_margin"> + Nine-patch texture offset for bottom margin. </member> <member name="stretch_margin_left" type="int" setter="set_stretch_margin" getter="get_stretch_margin"> + Nine-patch texture offset for left margin. </member> <member name="stretch_margin_right" type="int" setter="set_stretch_margin" getter="get_stretch_margin"> + Nine-patch texture offset for right margin. </member> <member name="stretch_margin_top" type="int" setter="set_stretch_margin" getter="get_stretch_margin"> + Nine-patch texture offset for top margin. </member> <member name="texture_over" type="Texture" setter="set_over_texture" getter="get_over_texture"> + The [Texture] that will be drawn over the progress bar. </member> <member name="texture_progress" type="Texture" setter="set_progress_texture" getter="get_progress_texture"> + The [Texture] used to display [code]value[/code]. </member> <member name="texture_under" type="Texture" setter="set_under_texture" getter="get_under_texture"> + The [Texture] that will be drawn under the progress bar. </member> </members> <constants> diff --git a/doc/classes/TextureRect.xml b/doc/classes/TextureRect.xml index 6d137cb14c..af5626ae84 100644 --- a/doc/classes/TextureRect.xml +++ b/doc/classes/TextureRect.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="TextureRect" inherits="Control" category="Core" version="3.0.alpha.custom_build"> <brief_description> - Control that draws a texture. + Draws a sprite or a texture inside a User Interface. The texture can tile or not. </brief_description> <description> - Control that draws a texture. + Use TextureRect to draw icons and sprites in your User Interfaces. To create panels and menu boxes, take a look at [NinePatchFrame]. Its Stretch Mode property controls the texture's scale and placement. It can scale, tile and stay centered inside its bounding rectangle. TextureRect is one of the 5 most common nodes to create game UI. </description> <tutorials> </tutorials> @@ -56,31 +56,39 @@ </methods> <members> <member name="expand" type="bool" setter="set_expand" getter="has_expand"> - If [code]true[/code] texture will expand to fit. Default value: [code]false[/code]. + If [code]true[/code], the texture scales to fit its bounding rectangle. Default value: [code]false[/code]. </member> <member name="stretch_mode" type="int" setter="set_stretch_mode" getter="get_stretch_mode" enum="TextureRect.StretchMode"> - Stretch mode of the texture. Use STRETCH_* constants as value. + Controls the texture's behavior when you resize the node's bounding rectangle. Set it to one of the [code]STRETCH_*[/code] constants. See the constants to learn more. </member> <member name="texture" type="Texture" setter="set_texture" getter="get_texture"> - The [Texture] resource for the node. + The node's [Texture] resource. </member> </members> <constants> <constant name="STRETCH_SCALE_ON_EXPAND" value="0"> + Scale to fit the node's bounding rectangle, only if [code]expand[/code] is [code]true[/code]. Default [code]stretch_mode[/code], for backwards compatibility. Until you set [code]expand[/code] to [code]true[/code], the texture will behave like [code]STRETCH_KEEP[/code]. </constant> <constant name="STRETCH_SCALE" value="1"> + Scale to fit the node's bounding rectangle. </constant> <constant name="STRETCH_TILE" value="2"> + Tile inside the node's bounding rectangle. </constant> <constant name="STRETCH_KEEP" value="3"> + The texture keeps its original size and stays in the bounding rectangle's top-left corner. </constant> <constant name="STRETCH_KEEP_CENTERED" value="4"> + The texture keeps its original size and stays centered in the node's bounding rectangle. </constant> <constant name="STRETCH_KEEP_ASPECT" value="5"> + Scale the texture to fit the node's bounding rectangle, but maintain the texture's aspect ratio. </constant> <constant name="STRETCH_KEEP_ASPECT_CENTERED" value="6"> + Scale the texture to fit the node's bounding rectangle, center it and maintain its aspect ratio. </constant> <constant name="STRETCH_KEEP_ASPECT_COVERED" value="7"> + Scale the texture so that the shorter side fits the bounding rectangle. The other side clips to the node's limits. </constant> </constants> </class> diff --git a/doc/classes/Transform.xml b/doc/classes/Transform.xml index d632eee70a..6780de1943 100644 --- a/doc/classes/Transform.xml +++ b/doc/classes/Transform.xml @@ -23,7 +23,7 @@ <argument index="3" name="origin" type="Vector3"> </argument> <description> - Construct the Transform from four [Vector3]. Each axis corresponds to local basis vectors (some of which may be scaled). + Constructs the Transform from four [Vector3]. Each axis corresponds to local basis vectors (some of which may be scaled). </description> </method> <method name="Transform"> @@ -34,7 +34,7 @@ <argument index="1" name="origin" type="Vector3"> </argument> <description> - Construct the Transform from a [Basis] and [Vector3]. + Constructs the Transform from a [Basis] and [Vector3]. </description> </method> <method name="Transform"> @@ -43,7 +43,7 @@ <argument index="0" name="from" type="Transform2D"> </argument> <description> - Construct the Transform from a [Transform2D]. + Constructs the Transform from a [Transform2D]. </description> </method> <method name="Transform"> @@ -52,7 +52,7 @@ <argument index="0" name="from" type="Quat"> </argument> <description> - Construct the Transform from a [Quat]. The origin will be Vector3(0, 0, 0). + Constructs the Transform from a [Quat]. The origin will be Vector3(0, 0, 0). </description> </method> <method name="Transform"> @@ -61,7 +61,7 @@ <argument index="0" name="from" type="Basis"> </argument> <description> - Construct the Transform from a [Basis]. The origin will be Vector3(0, 0, 0). + Constructs the Transform from a [Basis]. The origin will be Vector3(0, 0, 0). </description> </method> <method name="affine_inverse"> @@ -79,7 +79,7 @@ <argument index="1" name="weight" type="float"> </argument> <description> - Interpolate to other Transform by weight amount (0-1). + Interpolates the transform to other Transform by weight amount (0-1). </description> </method> <method name="inverse"> @@ -104,7 +104,7 @@ <return type="Transform"> </return> <description> - Returns a transfrom with the basis orthogonal (90 degrees), and normalized axis vectors. + Returns the transfrom with the basis orthogonal (90 degrees), and normalized axis vectors. </description> </method> <method name="rotated"> @@ -115,7 +115,7 @@ <argument index="1" name="phi" type="float"> </argument> <description> - Rotate the transform around given axis by phi. The axis must be a normalized vector. + Rotates the transform around given axis by phi. The axis must be a normalized vector. </description> </method> <method name="scaled"> @@ -124,7 +124,7 @@ <argument index="0" name="scale" type="Vector3"> </argument> <description> - Scale the transform by the specified 3D scaling factors. + Scales the transform by the specified 3D scaling factors. </description> </method> <method name="translated"> @@ -133,7 +133,7 @@ <argument index="0" name="ofs" type="Vector3"> </argument> <description> - Translate the transform by the specified offset. + Translates the transform by the specified offset. </description> </method> <method name="xform"> @@ -151,7 +151,7 @@ <argument index="0" name="v" type="var"> </argument> <description> - Inverse-transforms vector "v" by this transform. + Inverse-transforms the given vector "v" by this transform. </description> </method> </methods> diff --git a/doc/classes/Transform2D.xml b/doc/classes/Transform2D.xml index b3b752c1da..4cbe9123f1 100644 --- a/doc/classes/Transform2D.xml +++ b/doc/classes/Transform2D.xml @@ -66,28 +66,28 @@ <argument index="0" name="v" type="var"> </argument> <description> - Inverse-transforms vector "v" by this transform basis (no translation). + Inverse-transforms the given vector "v" by this transform basis (no translation). </description> </method> <method name="get_origin"> <return type="Vector2"> </return> <description> - Return the origin [Vector2] (translation). + Returns the origin [Vector2] (translation). </description> </method> <method name="get_rotation"> <return type="float"> </return> <description> - Return the rotation (in radians). + Returns the rotation (in radians). </description> </method> <method name="get_scale"> <return type="Vector2"> </return> <description> - Return the scale. + Returns the scale. </description> </method> <method name="interpolate_with"> @@ -98,7 +98,7 @@ <argument index="1" name="weight" type="float"> </argument> <description> - Interpolate to other Transform2D by weight amount (0-1). + Interpolates the transform to other Transform2D by weight amount (0-1). </description> </method> <method name="inverse"> @@ -112,7 +112,7 @@ <return type="Transform2D"> </return> <description> - Returns a transfrom with the basis orthogonal (90 degrees), and normalized axis vectors. + Returns the transfrom with the basis orthogonal (90 degrees), and normalized axis vectors. </description> </method> <method name="rotated"> @@ -121,7 +121,7 @@ <argument index="0" name="phi" type="float"> </argument> <description> - Rotate the transform by phi. + Rotates the transform by phi. </description> </method> <method name="scaled"> @@ -130,7 +130,7 @@ <argument index="0" name="scale" type="Vector2"> </argument> <description> - Scale the transform by the specified 2D scaling factors. + Scales the transform by the specified 2D scaling factors. </description> </method> <method name="translated"> @@ -139,7 +139,7 @@ <argument index="0" name="offset" type="Vector2"> </argument> <description> - Translate the transform by the specified offset. + Translates the transform by the specified offset. </description> </method> <method name="xform"> diff --git a/doc/classes/UndoRedo.xml b/doc/classes/UndoRedo.xml index 43e0ad7873..d450a8812e 100644 --- a/doc/classes/UndoRedo.xml +++ b/doc/classes/UndoRedo.xml @@ -108,6 +108,12 @@ Get the name of the current action. </description> </method> + <method name="get_max_steps" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> <method name="get_version" qualifiers="const"> <return type="int"> </return> @@ -116,6 +122,26 @@ This is useful mostly to check if something changed from a saved version. </description> </method> + <method name="redo"> + <return type="void"> + </return> + <description> + </description> + </method> + <method name="set_max_steps"> + <return type="void"> + </return> + <argument index="0" name="max_steps" type="int"> + </argument> + <description> + </description> + </method> + <method name="undo"> + <return type="void"> + </return> + <description> + </description> + </method> </methods> <constants> <constant name="MERGE_DISABLE" value="0"> diff --git a/doc/classes/VisibilityNotifier.xml b/doc/classes/VisibilityNotifier.xml index 4d76c7c927..816523fc27 100644 --- a/doc/classes/VisibilityNotifier.xml +++ b/doc/classes/VisibilityNotifier.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="VisibilityNotifier" inherits="Spatial" category="Core" version="3.0.alpha.custom_build"> <brief_description> - Detect when the node is visible on screen. + Detects when the node is visible on screen. </brief_description> <description> - The VisibilityNotifier is used to notify when its bounding box enters the screen, is visible on the screen, or when it exits the screen. + The VisibilityNotifier detects when it is visible on the screen. It also notifies when its bounding rectangle enters or exits the screen or a [Camera]'s view. </description> <tutorials> </tutorials> @@ -15,14 +15,14 @@ <return type="Rect3"> </return> <description> - Return the visibility bounding box of the VisibilityNotifier. + Returns the bounding box of the VisibilityNotifier. </description> </method> <method name="is_on_screen" qualifiers="const"> <return type="bool"> </return> <description> - Return true if any part of the bounding box is on the screen. + If [code]true[/code] the bounding box is on the screen. </description> </method> <method name="set_aabb"> @@ -37,6 +37,7 @@ </methods> <members> <member name="aabb" type="Rect3" setter="set_aabb" getter="get_aabb"> + The VisibilityNotifier's bounding box. </member> </members> <signals> diff --git a/doc/classes/VisibilityNotifier2D.xml b/doc/classes/VisibilityNotifier2D.xml index 1058e3d6d4..86227a0277 100644 --- a/doc/classes/VisibilityNotifier2D.xml +++ b/doc/classes/VisibilityNotifier2D.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="VisibilityNotifier2D" inherits="Node2D" category="Core" version="3.0.alpha.custom_build"> <brief_description> - Detect when the node is visible on screen. + Detects when the node is visible on screen. </brief_description> <description> - The VisibilityNotifier2D is used to notify when its bounding rectangle enters the screen, is visible on the screen, or when it exits the screen. + The VisibilityNotifier2D detects when it is visible on the screen. It also notifies when its bounding rectangle enters or exits the screen or a viewport. </description> <tutorials> </tutorials> @@ -15,14 +15,14 @@ <return type="Rect2"> </return> <description> - Return the visibility bounding rectangle of the VisibilityNotifier2D. + Returns the bounding rectangle of the VisibilityNotifier2D. </description> </method> <method name="is_on_screen" qualifiers="const"> <return type="bool"> </return> <description> - Return true if any part of the bounding rectangle is on the screen. + If [code]true[/code] the bounding rectangle is on the screen. </description> </method> <method name="set_rect"> @@ -37,6 +37,7 @@ </methods> <members> <member name="rect" type="Rect2" setter="set_rect" getter="get_rect"> + The VisibilityNotifier2D's bounding rectangle. </member> </members> <signals> diff --git a/doc/tools/doc_status.py b/doc/tools/doc_status.py index b0fa36230c..6b6b794f11 100644 --- a/doc/tools/doc_status.py +++ b/doc/tools/doc_status.py @@ -253,6 +253,9 @@ class ClassStatus: for sub_tag in list(tag): status.progresses[tag.tag].increment(len(sub_tag.text.strip()) > 0) + elif tag.tag in ['tutorials', 'demos']: + pass # Ignore those tags for now + elif tag.tag in ['theme_items']: pass # Ignore those tags, since they seem to lack description at all @@ -361,7 +364,7 @@ if len(input_class_list) < 1: ################################################################################ table = [table_column_names] -table_row_chars = '+- ' +table_row_chars = '| - ' table_column_chars = '|' total_status = ClassStatus('Total') @@ -423,7 +426,7 @@ for row in table: divider_string = table_row_chars[0] for cell_i in range(len(table[0])): - divider_string += table_row_chars[1] * (table_column_sizes[cell_i] + 2) + table_row_chars[0] + divider_string += table_row_chars[1] + table_row_chars[2] * (table_column_sizes[cell_i]) + table_row_chars[1] + table_row_chars[0] print(divider_string) for row_i, row in enumerate(table): @@ -431,9 +434,9 @@ for row_i, row in enumerate(table): for cell_i, cell in enumerate(row): padding_needed = table_column_sizes[cell_i] - nonescape_len(cell) + 2 if cell_i == 0: - row_string += table_row_chars[2] + cell + table_row_chars[2] * (padding_needed - 1) + row_string += table_row_chars[3] + cell + table_row_chars[3] * (padding_needed - 1) else: - row_string += table_row_chars[2] * math.floor(padding_needed / 2) + cell + table_row_chars[2] * math.ceil((padding_needed / 2)) + row_string += table_row_chars[3] * math.floor(padding_needed / 2) + cell + table_row_chars[3] * math.ceil((padding_needed / 2)) row_string += table_column_chars print(row_string) diff --git a/drivers/gles3/rasterizer_scene_gles3.h b/drivers/gles3/rasterizer_scene_gles3.h index b3fd6fa2a0..8669c42a7a 100644 --- a/drivers/gles3/rasterizer_scene_gles3.h +++ b/drivers/gles3/rasterizer_scene_gles3.h @@ -806,7 +806,7 @@ public: void _render_list(RenderList::Element **p_elements, int p_element_count, const Transform &p_view_transform, const CameraMatrix &p_projection, GLuint p_base_env, bool p_reverse_cull, bool p_alpha_pass, bool p_shadow, bool p_directional_add, bool p_directional_shadows); - _FORCE_INLINE_ void _add_geometry(RasterizerStorageGLES3::Geometry *p_geometry, InstanceBase *p_instance, RasterizerStorageGLES3::GeometryOwner *p_owner, int p_material, bool p_depth_passs); + _FORCE_INLINE_ void _add_geometry(RasterizerStorageGLES3::Geometry *p_geometry, InstanceBase *p_instance, RasterizerStorageGLES3::GeometryOwner *p_owner, int p_material, bool p_depth_pass); _FORCE_INLINE_ void _add_geometry_with_material(RasterizerStorageGLES3::Geometry *p_geometry, InstanceBase *p_instance, RasterizerStorageGLES3::GeometryOwner *p_owner, RasterizerStorageGLES3::Material *p_material, bool p_depth_pass); diff --git a/drivers/rtaudio/audio_driver_rtaudio.cpp b/drivers/rtaudio/audio_driver_rtaudio.cpp index ae5fdd28b6..a184c9e9cf 100644 --- a/drivers/rtaudio/audio_driver_rtaudio.cpp +++ b/drivers/rtaudio/audio_driver_rtaudio.cpp @@ -143,7 +143,7 @@ Error AudioDriverRtAudio::init() { } } - return OK; + return active ? OK : ERR_UNAVAILABLE; } int AudioDriverRtAudio::get_mix_rate() const { diff --git a/drivers/unix/dir_access_unix.cpp b/drivers/unix/dir_access_unix.cpp index 45ea654bad..e7054e11a3 100644 --- a/drivers/unix/dir_access_unix.cpp +++ b/drivers/unix/dir_access_unix.cpp @@ -183,17 +183,18 @@ void DirAccessUnix::list_dir_end() { _cisdir = false; } -#ifdef HAVE_MNTENT +#if defined(HAVE_MNTENT) && defined(X11_ENABLED) static bool _filter_drive(struct mntent *mnt) { // Ignore devices that don't point to /dev if (strncmp(mnt->mnt_fsname, "/dev", 4) != 0) { return false; } - // Accept devices mounted at /media, /mnt or /home + // Accept devices mounted at common locations if (strncmp(mnt->mnt_dir, "/media", 6) == 0 || strncmp(mnt->mnt_dir, "/mnt", 4) == 0 || - strncmp(mnt->mnt_dir, "/home", 5) == 0) { + strncmp(mnt->mnt_dir, "/home", 5) == 0 || + strncmp(mnt->mnt_dir, "/run/media", 10) == 0) { return true; } @@ -204,7 +205,7 @@ static bool _filter_drive(struct mntent *mnt) { static void _get_drives(List<String> *list) { -#ifdef HAVE_MNTENT +#if defined(HAVE_MNTENT) && defined(X11_ENABLED) // Check /etc/mtab for the list of mounted partitions FILE *mtab = setmntent("/etc/mtab", "r"); if (mtab) { diff --git a/drivers/unix/file_access_unix.cpp b/drivers/unix/file_access_unix.cpp index 80565c5b02..e19bc738cb 100644 --- a/drivers/unix/file_access_unix.cpp +++ b/drivers/unix/file_access_unix.cpp @@ -274,6 +274,15 @@ uint64_t FileAccessUnix::_get_modified_time(const String &p_file) { }; } +Error FileAccessUnix::_chmod(const String &p_path, int p_mod) { + int err = chmod(p_path.utf8().get_data(), p_mod); + if (!err) { + return OK; + } + + return FAILED; +} + FileAccess *FileAccessUnix::create_libc() { return memnew(FileAccessUnix); diff --git a/drivers/unix/file_access_unix.h b/drivers/unix/file_access_unix.h index 6e5110431f..c5ab8821be 100644 --- a/drivers/unix/file_access_unix.h +++ b/drivers/unix/file_access_unix.h @@ -78,6 +78,8 @@ public: virtual uint64_t _get_modified_time(const String &p_file); + virtual Error _chmod(const String &p_path, int p_mod); + FileAccessUnix(); virtual ~FileAccessUnix(); }; diff --git a/editor/SCsub b/editor/SCsub index 839d8e74c1..315865ad32 100644 --- a/editor/SCsub +++ b/editor/SCsub @@ -41,7 +41,7 @@ def make_doc_header(target, source, env): src = s.srcnode().abspath f = open_utf8(src, "r") content = f.read() - buf+=content + buf+=content buf = encode_utf8(docbegin + buf + docend) decomp_size = len(buf) @@ -385,13 +385,13 @@ def make_license_header(target, source, env): def _make_doc_data_class_path(to_path): - g = open_utf8(os.path.join(to_path,"doc_data_class_path.gen.h"), "wb") + g = open_utf8(os.path.join(to_path,"doc_data_class_path.gen.h"), "w") g.write("static const int _doc_data_class_path_count="+str(len(env.doc_class_path))+";\n") g.write("struct _DocDataClassPath { const char* name; const char* path; };\n") g.write("static const _DocDataClassPath _doc_data_class_paths["+str(len(env.doc_class_path)+1)+"]={\n"); for c in env.doc_class_path: - g.write("{\""+c+"\",\""+env.doc_class_path[c]+"\"},\n") + g.write("{\""+c+"\",\""+env.doc_class_path[c]+"\"},\n") g.write("{NULL,NULL}\n") g.write("};\n") @@ -414,7 +414,7 @@ if (env["tools"] == "yes"): docs=[] print("cdir is: "+env.Dir('#').abspath) for f in os.listdir(os.path.join(env.Dir('#').abspath,"doc/classes")): - docs.append("#doc/classes/"+f) + docs.append("#doc/classes/"+f) _make_doc_data_class_path(os.path.join(env.Dir('#').abspath,"editor/doc")) diff --git a/editor/animation_editor.cpp b/editor/animation_editor.cpp index 47360ff7fb..40493c1de3 100644 --- a/editor/animation_editor.cpp +++ b/editor/animation_editor.cpp @@ -2898,10 +2898,6 @@ void AnimationKeyEditor::_notification(int p_what) { zoomicon->set_custom_minimum_size(Size2(24 * EDSCALE, 0)); zoomicon->set_stretch_mode(TextureRect::STRETCH_KEEP_CENTERED); - menu_add_track->get_popup()->add_icon_item(get_icon("KeyValue", "EditorIcons"), "Add Normal Track", ADD_TRACK_MENU_ADD_VALUE_TRACK); - menu_add_track->get_popup()->add_icon_item(get_icon("KeyXform", "EditorIcons"), "Add Transform Track", ADD_TRACK_MENU_ADD_TRANSFORM_TRACK); - menu_add_track->get_popup()->add_icon_item(get_icon("KeyCall", "EditorIcons"), "Add Call Func Track", ADD_TRACK_MENU_ADD_CALL_TRACK); - menu_track->set_icon(get_icon("Tools", "EditorIcons")); menu_track->get_popup()->add_item(TTR("Scale Selection"), TRACK_MENU_SCALE); menu_track->get_popup()->add_item(TTR("Scale From Cursor"), TRACK_MENU_SCALE_PIVOT); @@ -3817,6 +3813,9 @@ AnimationKeyEditor::AnimationKeyEditor() { hb->add_child(menu_add_track); menu_add_track->get_popup()->connect("id_pressed", this, "_menu_add_track"); menu_add_track->set_tooltip(TTR("Add new tracks.")); + menu_add_track->get_popup()->add_icon_item(get_icon("KeyValue", "EditorIcons"), "Add Normal Track", ADD_TRACK_MENU_ADD_VALUE_TRACK); + menu_add_track->get_popup()->add_icon_item(get_icon("KeyXform", "EditorIcons"), "Add Transform Track", ADD_TRACK_MENU_ADD_TRANSFORM_TRACK); + menu_add_track->get_popup()->add_icon_item(get_icon("KeyCall", "EditorIcons"), "Add Call Func Track", ADD_TRACK_MENU_ADD_CALL_TRACK); move_up_button = memnew(ToolButton); hb->add_child(move_up_button); diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index 344cb87aa6..9797a2e9f5 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -54,12 +54,7 @@ void CreateDialog::popup_create(bool p_dontclear) { TreeItem *ti = recent->create_item(root); ti->set_text(0, l); - if (has_icon(l, "EditorIcons")) { - - ti->set_icon(0, get_icon(l, "EditorIcons")); - } else { - ti->set_icon(0, get_icon("Object", "EditorIcons")); - } + ti->set_icon(0, _get_editor_icon(l)); } } @@ -122,6 +117,29 @@ void CreateDialog::_sbox_input(const Ref<InputEvent> &p_ie) { } } +Ref<Texture> CreateDialog::_get_editor_icon(const String &p_type) const { + + if (has_icon(p_type, "EditorIcons")) { + return get_icon(p_type, "EditorIcons"); + } + + const Map<String, Vector<EditorData::CustomType> > &p_map = EditorNode::get_editor_data().get_custom_types(); + for (const Map<String, Vector<EditorData::CustomType> >::Element *E = p_map.front(); E; E = E->next()) { + const Vector<EditorData::CustomType> &ct = E->value(); + for (int i = 0; i < ct.size(); ++i) { + if (ct[i].name == p_type) { + if (ct[i].icon.is_valid()) { + return ct[i].icon; + } else { + return get_icon("Object", "EditorIcons"); + } + } + } + } + + return get_icon("Object", "EditorIcons"); +} + void CreateDialog::add_type(const String &p_type, HashMap<String, TreeItem *> &p_types, TreeItem *p_root, TreeItem **to_select) { if (p_types.has(p_type)) @@ -457,13 +475,7 @@ void CreateDialog::_update_favorite_list() { TreeItem *ti = favorites->create_item(root); String l = favorite_list[i]; ti->set_text(0, l); - - if (has_icon(l, "EditorIcons")) { - - ti->set_icon(0, get_icon(l, "EditorIcons")); - } else { - ti->set_icon(0, get_icon("Object", "EditorIcons")); - } + ti->set_icon(0, _get_editor_icon(l)); } } diff --git a/editor/create_dialog.h b/editor/create_dialog.h index 31f106ea22..a523539ba0 100644 --- a/editor/create_dialog.h +++ b/editor/create_dialog.h @@ -74,6 +74,8 @@ class CreateDialog : public ConfirmationDialog { void _confirmed(); void _text_changed(const String &p_newtext); + Ref<Texture> _get_editor_icon(const String &p_type) const; + void add_type(const String &p_type, HashMap<String, TreeItem *> &p_types, TreeItem *p_root, TreeItem **to_select); Variant get_drag_data_fw(const Point2 &p_point, Control *p_from); diff --git a/editor/doc/doc_data.cpp b/editor/doc/doc_data.cpp index 272a5af59b..d35dc53ae1 100644 --- a/editor/doc/doc_data.cpp +++ b/editor/doc/doc_data.cpp @@ -170,6 +170,8 @@ static void return_doc_from_retinfo(DocData::MethodDoc &p_method, const Property if (p_retinfo.type == Variant::INT && p_retinfo.usage & PROPERTY_USAGE_CLASS_IS_ENUM) { p_method.return_enum = p_retinfo.class_name; + if (p_method.return_enum.begins_with("_")) //proxy class + p_method.return_enum = p_method.return_enum.substr(1, p_method.return_enum.length()); p_method.return_type = "int"; } else if (p_retinfo.class_name != StringName()) { p_method.return_type = p_retinfo.class_name; @@ -190,6 +192,8 @@ static void argument_doc_from_arginfo(DocData::ArgumentDoc &p_argument, const Pr if (p_arginfo.type == Variant::INT && p_arginfo.usage & PROPERTY_USAGE_CLASS_IS_ENUM) { p_argument.enumeration = p_arginfo.class_name; + if (p_argument.enumeration.begins_with("_")) //proxy class + p_argument.enumeration = p_argument.enumeration.substr(1, p_argument.enumeration.length()); p_argument.type = "int"; } else if (p_arginfo.class_name != StringName()) { p_argument.type = p_arginfo.class_name; diff --git a/editor/editor_dir_dialog.cpp b/editor/editor_dir_dialog.cpp index cfb3abfd1d..658c12d4d0 100644 --- a/editor/editor_dir_dialog.cpp +++ b/editor/editor_dir_dialog.cpp @@ -64,7 +64,7 @@ void EditorDirDialog::_update_dir(TreeItem *p_item, EditorFileSystemDirectory *p } } -void EditorDirDialog::reload(const String &p_with_path) { +void EditorDirDialog::reload(const String &p_path) { if (!is_visible_in_tree()) { must_reload = true; @@ -73,7 +73,7 @@ void EditorDirDialog::reload(const String &p_with_path) { tree->clear(); TreeItem *root = tree->create_item(); - _update_dir(root, EditorFileSystem::get_singleton()->get_filesystem(), p_with_path); + _update_dir(root, EditorFileSystem::get_singleton()->get_filesystem(), p_path); _item_collapsed(root); must_reload = false; } diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp index d08a595fd2..ad9bc4a662 100644 --- a/editor/editor_export.cpp +++ b/editor/editor_export.cpp @@ -1246,9 +1246,13 @@ Error EditorExportPlatformPC::export_project(const Ref<EditorExportPreset> &p_pr } DirAccess *da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); - da->copy(template_path, p_path); + Error err = da->copy(template_path, p_path, get_chmod_flags()); memdelete(da); + if (err != OK) { + return err; + } + String pck_path = p_path.get_basename() + ".pck"; return save_pack(p_preset, pck_path); @@ -1302,5 +1306,17 @@ void EditorExportPlatformPC::get_platform_features(List<String> *r_features) { } } +int EditorExportPlatformPC::get_chmod_flags() const { + + return chmod_flags; +} + +void EditorExportPlatformPC::set_chmod_flags(int p_flags) { + + chmod_flags = p_flags; +} + EditorExportPlatformPC::EditorExportPlatformPC() { + + chmod_flags = -1; } diff --git a/editor/editor_export.h b/editor/editor_export.h index b6ea4fd889..50379b9683 100644 --- a/editor/editor_export.h +++ b/editor/editor_export.h @@ -319,6 +319,7 @@ class EditorExportPlatformPC : public EditorExportPlatform { Set<String> extra_features; bool use64; + int chmod_flags; public: virtual void get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features); @@ -347,6 +348,9 @@ public: void add_platform_feature(const String &p_feature); virtual void get_platform_features(List<String> *r_features); + int get_chmod_flags() const; + void set_chmod_flags(int p_flags); + EditorExportPlatformPC(); }; diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index 9d1756a7ec..288b923e87 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -107,8 +107,6 @@ void EditorFileDialog::_notification(int p_what) { fav_down->set_icon(get_icon("MoveDown", "EditorIcons")); fav_rm->set_icon(get_icon("RemoveSmall", "EditorIcons")); - Theme::get_default()->clear_icon("ResizedFile", "EditorIcons"); - Theme::get_default()->clear_icon("ResizedFolder", "EditorIcons"); update_file_list(); } } diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 3f0520379a..d7cce71b90 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -2780,14 +2780,6 @@ Dictionary EditorNode::_get_main_scene_state() { state["property_edit_offset"] = get_property_editor()->get_scene_tree()->get_vscroll_bar()->get_value(); state["saved_version"] = saved_version; state["node_filter"] = scene_tree_dock->get_filter(); - int current = -1; - for (int i = 0; i < editor_table.size(); i++) { - if (editor_plugin_screen == editor_table[i]) { - current = i; - break; - } - } - state["editor_index"] = current; return state; } @@ -2798,29 +2790,32 @@ void EditorNode::_set_main_scene_state(Dictionary p_state, Node *p_for_scene) { changing_scene = false; - if (p_state.has("editor_index")) { - - int index = p_state["editor_index"]; - int current = -1; - for (int i = 0; i < editor_table.size(); i++) { - if (editor_plugin_screen == editor_table[i]) { - current = i; - break; - } + int current = -1; + for (int i = 0; i < editor_table.size(); i++) { + if (editor_plugin_screen == editor_table[i]) { + current = i; + break; } + } + if (p_state.has("editor_index")) { + int index = p_state["editor_index"]; if (current < 2) { //if currently in spatial/2d, only switch to spatial/2d. if curently in script, stay there if (index < 2 || !get_edited_scene()) { _editor_select(index); - } else { - //use heuristic instead - int n2d = 0, n3d = 0; - _find_node_types(get_edited_scene(), n2d, n3d); - if (n2d > n3d) { - _editor_select(EDITOR_2D); - } else if (n3d > n2d) { - _editor_select(EDITOR_3D); - } + } + } + } + + if (get_edited_scene()) { + if (current < 2) { + //use heuristic instead + int n2d = 0, n3d = 0; + _find_node_types(get_edited_scene(), n2d, n3d); + if (n2d > n3d) { + _editor_select(EDITOR_2D); + } else if (n3d > n2d) { + _editor_select(EDITOR_3D); } } } @@ -3343,9 +3338,9 @@ void EditorNode::_editor_file_dialog_unregister(EditorFileDialog *p_dialog) { Vector<EditorNodeInitCallback> EditorNode::_init_callbacks; -Error EditorNode::export_preset(const String &preset, const String &p_path, bool p_debug, const String &p_password, bool p_quit_after) { +Error EditorNode::export_preset(const String &p_preset, const String &p_path, bool p_debug, const String &p_password, bool p_quit_after) { - export_defer.preset = preset; + export_defer.preset = p_preset; export_defer.path = p_path; export_defer.debug = p_debug; export_defer.password = p_password; @@ -4854,7 +4849,7 @@ EditorNode::EditorNode() { scene_root_parent = memnew(PanelContainer); scene_root_parent->set_custom_minimum_size(Size2(0, 80) * EDSCALE); scene_root_parent->add_style_override("panel", gui_base->get_stylebox("Content", "EditorStyles")); - + scene_root_parent->set_draw_behind_parent(true); srt->add_child(scene_root_parent); scene_root_parent->set_v_size_flags(Control::SIZE_EXPAND_FILL); diff --git a/editor/editor_node.h b/editor/editor_node.h index 5c6c5be4c8..33031e5634 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -609,7 +609,6 @@ private: void _license_tree_selected(); - protected: void _notification(int p_what); static void _bind_methods(); @@ -716,7 +715,7 @@ public: void show_warning(const String &p_text, const String &p_title = "Warning!"); - Error export_preset(const String &p_platform, const String &p_path, bool p_debug, const String &p_password, bool p_quit_after = false); + Error export_preset(const String &p_preset, const String &p_path, bool p_debug, const String &p_password, bool p_quit_after = false); static void register_editor_types(); static void unregister_editor_types(); diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index d7266df67c..d4ee6b2d17 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -599,8 +599,8 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { hints["global/default_project_export_path"] = PropertyInfo(Variant::STRING, "global/default_project_export_path", PROPERTY_HINT_GLOBAL_DIR); set("interface/show_script_in_scene_tabs", false); - set("text_editor/theme/color_theme", "Default"); - hints["text_editor/theme/color_theme"] = PropertyInfo(Variant::STRING, "text_editor/theme/color_theme", PROPERTY_HINT_ENUM, "Default"); + set("text_editor/theme/color_theme", "Adaptive"); + hints["text_editor/theme/color_theme"] = PropertyInfo(Variant::STRING, "text_editor/theme/color_theme", PROPERTY_HINT_ENUM, "Adaptive,Default"); set("text_editor/theme/line_spacing", 4); @@ -924,13 +924,13 @@ void EditorSettings::load_favorites() { } void EditorSettings::list_text_editor_themes() { - String themes = "Default"; + String themes = "Adaptive,Default"; DirAccess *d = DirAccess::open(settings_path + "/text_editor_themes"); if (d) { d->list_dir_begin(); String file = d->get_next(); while (file != String()) { - if (file.get_extension() == "tet" && file.get_basename().to_lower() != "default") { + if (file.get_extension() == "tet" && file.get_basename().to_lower() != "default" && file.get_basename().to_lower() != "adaptive") { themes += "," + file.get_basename(); } file = d->get_next(); @@ -942,7 +942,7 @@ void EditorSettings::list_text_editor_themes() { } void EditorSettings::load_text_editor_theme() { - if (get("text_editor/theme/color_theme") == "Default") { + if (get("text_editor/theme/color_theme") == "Default" || get("text_editor/theme/color_theme") == "Adaptive") { _load_default_text_editor_theme(); // sorry for "Settings changed" console spam return; } @@ -999,7 +999,7 @@ bool EditorSettings::save_text_editor_theme() { String p_file = get("text_editor/theme/color_theme"); - if (p_file.get_file().to_lower() == "default") { + if (p_file.get_file().to_lower() == "default" || p_file.get_file().to_lower() == "adaptive") { return false; } String theme_path = get_settings_path() + "/text_editor_themes/" + p_file + ".tet"; @@ -1011,7 +1011,7 @@ bool EditorSettings::save_text_editor_theme_as(String p_file) { p_file += ".tet"; } - if (p_file.get_file().to_lower() == "default.tet") { + if (p_file.get_file().to_lower() == "default.tet" || p_file.get_file().to_lower() == "adaptive.tet") { return false; } if (_save_text_editor_theme(p_file)) { diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 304d6acd62..0cba024595 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -369,6 +369,10 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { // Tabs Ref<StyleBoxFlat> style_tab_selected = style_default->duplicate(); + style_tab_selected->set_border_width_all(border_width); + style_tab_selected->set_border_width(MARGIN_BOTTOM, 0); + style_tab_selected->set_border_color_all(dark_color_3); + style_tab_selected->set_expand_margin_size(MARGIN_BOTTOM, border_width); style_tab_selected->set_default_margin(MARGIN_LEFT, 10 * EDSCALE); style_tab_selected->set_default_margin(MARGIN_RIGHT, 10 * EDSCALE); style_tab_selected->set_bg_color(tab_color); @@ -435,19 +439,6 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_stylebox("MenuHover", "EditorStyles", style_menu_hover_border); - // Content of each tab - Ref<StyleBoxFlat> style_content_panel = style_default->duplicate(); - style_content_panel->set_border_color_all(base_color); - - // this is the stylebox used in 3d and 2d viewports (no borders) - Ref<StyleBoxFlat> style_content_panel_vp = style_content_panel->duplicate(); - style_content_panel_vp->set_default_margin(MARGIN_LEFT, border_width); - style_content_panel_vp->set_default_margin(MARGIN_TOP, default_margin_size); - style_content_panel_vp->set_default_margin(MARGIN_RIGHT, border_width); - style_content_panel_vp->set_default_margin(MARGIN_BOTTOM, border_width); - theme->set_stylebox("panel", "TabContainer", style_content_panel); - theme->set_stylebox("Content", "EditorStyles", style_content_panel_vp); - // Buttons theme->set_stylebox("normal", "Button", style_widget); theme->set_stylebox("hover", "Button", style_widget_hover); @@ -608,6 +599,20 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_stylebox("button_pressed", "Tabs", style_menu); theme->set_stylebox("button", "Tabs", style_menu); + // Content of each tab + Ref<StyleBoxFlat> style_content_panel = style_default->duplicate(); + style_content_panel->set_border_color_all(dark_color_3); + style_content_panel->set_border_width_all(border_width); + + // this is the stylebox used in 3d and 2d viewports (no borders) + Ref<StyleBoxFlat> style_content_panel_vp = style_content_panel->duplicate(); + style_content_panel_vp->set_default_margin(MARGIN_LEFT, border_width); + style_content_panel_vp->set_default_margin(MARGIN_TOP, default_margin_size); + style_content_panel_vp->set_default_margin(MARGIN_LEFT, border_width); + style_content_panel_vp->set_default_margin(MARGIN_BOTTOM, border_width); + theme->set_stylebox("panel", "TabContainer", style_content_panel); + theme->set_stylebox("Content", "EditorStyles", style_content_panel_vp); + // Separators (no separators) theme->set_stylebox("separator", "HSeparator", make_line_stylebox(separator_color, border_width)); theme->set_stylebox("separator", "VSeparator", make_line_stylebox(separator_color, border_width, 0, true)); @@ -634,6 +639,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_stylebox("normal", "TextEdit", style_widget); theme->set_stylebox("focus", "TextEdit", style_widget_hover); theme->set_constant("side_margin", "TabContainer", 0); + theme->set_icon("tab", "TextEdit", theme->get_icon("GuiTab", "EditorIcons")); // H/VSplitContainer theme->set_stylebox("bg", "VSplitContainer", make_stylebox(theme->get_icon("GuiVsplitBg", "EditorIcons"), 1, 1, 1, 1)); @@ -782,6 +788,80 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { // FileDialog theme->set_color("files_disabled", "FileDialog", font_color_disabled); + // adaptive script theme constants + // for comments and elements with lower relevance + const Color dim_color = Color(font_color.r, font_color.g, font_color.b, 0.5); + + const float mono_value = mono_color.r; + const Color alpha1 = Color(mono_value, mono_value, mono_value, 0.1); + const Color alpha2 = Color(mono_value, mono_value, mono_value, 0.3); + const Color alpha3 = Color(mono_value, mono_value, mono_value, 0.5); + const Color alpha4 = Color(mono_value, mono_value, mono_value, 0.7); + + // editor main color + const Color main_color = Color::html(dark_theme ? "#57b3ff" : "#0480ff"); + + const Color symbol_color = Color::html("#5792ff").linear_interpolate(mono_color, dark_theme ? 0.5 : 0.3); + const Color keyword_color = main_color.linear_interpolate(mono_color, 0.4); + const Color basetype_color = Color::html(dark_theme ? "#42ffc2" : "#00c161"); + const Color type_color = basetype_color.linear_interpolate(mono_color, dark_theme ? 0.7 : 0.5); + const Color comment_color = dim_color; + const Color string_color = Color::html(dark_theme ? "#ffd942" : "#ffd118").linear_interpolate(mono_color, dark_theme ? 0.5 : 0.3); + + const Color te_background_color = Color(0, 0, 0, 0); + const Color completion_background_color = base_color; + const Color completion_selected_color = alpha1; + const Color completion_existing_color = alpha2; + const Color completion_scroll_color = alpha1; + const Color completion_font_color = font_color; + const Color text_color = font_color; + const Color line_number_color = dim_color; + const Color caret_color = mono_color; + const Color caret_background_color = mono_color.inverted(); + const Color text_selected_color = dark_color_3; + const Color selection_color = alpha3; + const Color brace_mismatch_color = error_color; + const Color current_line_color = alpha1; + const Color line_length_guideline_color = warning_color; + const Color word_highlighted_color = alpha1; + const Color number_color = basetype_color.linear_interpolate(mono_color, dark_theme ? 0.5 : 0.3); + const Color function_color = main_color; + const Color member_variable_color = mono_color; + const Color mark_color = Color(error_color.r, error_color.g, error_color.b, 0.3); + const Color breakpoint_color = error_color; + const Color search_result_color = alpha1; + const Color search_result_border_color = alpha4; + + theme->set_color("text_editor/theme/symbol_color", "Editor", symbol_color); + theme->set_color("text_editor/theme/keyword_color", "Editor", keyword_color); + theme->set_color("text_editor/theme/basetype_color", "Editor", basetype_color); + theme->set_color("text_editor/theme/type_color", "Editor", type_color); + theme->set_color("text_editor/theme/comment_color", "Editor", comment_color); + theme->set_color("text_editor/theme/string_color", "Editor", string_color); + theme->set_color("text_editor/theme/background_color", "Editor", te_background_color); + theme->set_color("text_editor/theme/completion_background_color", "Editor", completion_background_color); + theme->set_color("text_editor/theme/completion_selected_color", "Editor", completion_selected_color); + theme->set_color("text_editor/theme/completion_existing_color", "Editor", completion_existing_color); + theme->set_color("text_editor/theme/completion_scroll_color", "Editor", completion_scroll_color); + theme->set_color("text_editor/theme/completion_font_color", "Editor", completion_font_color); + theme->set_color("text_editor/theme/text_color", "Editor", text_color); + theme->set_color("text_editor/theme/line_number_color", "Editor", line_number_color); + theme->set_color("text_editor/theme/caret_color", "Editor", caret_color); + theme->set_color("text_editor/theme/caret_background_color", "Editor", caret_background_color); + theme->set_color("text_editor/theme/text_selected_color", "Editor", text_selected_color); + theme->set_color("text_editor/theme/selection_color", "Editor", selection_color); + theme->set_color("text_editor/theme/brace_mismatch_color", "Editor", brace_mismatch_color); + theme->set_color("text_editor/theme/current_line_color", "Editor", current_line_color); + theme->set_color("text_editor/theme/line_length_guideline_color", "Editor", line_length_guideline_color); + theme->set_color("text_editor/theme/word_highlighted_color", "Editor", word_highlighted_color); + theme->set_color("text_editor/theme/number_color", "Editor", number_color); + theme->set_color("text_editor/theme/function_color", "Editor", function_color); + theme->set_color("text_editor/theme/member_variable_color", "Editor", member_variable_color); + theme->set_color("text_editor/theme/mark_color", "Editor", mark_color); + theme->set_color("text_editor/theme/breakpoint_color", "Editor", breakpoint_color); + theme->set_color("text_editor/theme/search_result_color", "Editor", search_result_color); + theme->set_color("text_editor/theme/search_result_border_color", "Editor", search_result_border_color); + return theme; } diff --git a/editor/icons/icon_GUI_tab.svg b/editor/icons/icon_GUI_tab.svg new file mode 100644 index 0000000000..3eed0680c0 --- /dev/null +++ b/editor/icons/icon_GUI_tab.svg @@ -0,0 +1,5 @@ +<svg width="8" height="8" version="1.1" viewBox="0 0 8 8" xmlns="http://www.w3.org/2000/svg"> +<g transform="translate(0 -1044.4)"> +<path transform="translate(0 1044.4)" d="m6 0v8h2v-8h-2zm-5.0137 0.0019531a1 1 0 0 0 -0.69336 0.29102 1 1 0 0 0 0 1.4141l2.293 2.293-2.293 2.293a1 1 0 0 0 0 1.4141 1 1 0 0 0 1.4141 0l3-3a1.0001 1.0001 0 0 0 0 -1.4141l-3-3a1 1 0 0 0 -0.7207 -0.29102z" fill="#fff" fill-opacity=".19608"/> +</g> +</svg> diff --git a/editor/import/resource_importer_scene.h b/editor/import/resource_importer_scene.h index a483c3776f..652977b98a 100644 --- a/editor/import/resource_importer_scene.h +++ b/editor/import/resource_importer_scene.h @@ -119,7 +119,7 @@ public: virtual void get_import_options(List<ImportOption> *r_options, int p_preset = 0) const; virtual bool get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const; - void _make_external_resources(Node *p_node, const String &p_base_path, bool p_make_animations, bool p_make_materials, bool p_keep_materials, bool p_make_meshes, Map<Ref<Animation>, Ref<Animation> > &p_animation, Map<Ref<Material>, Ref<Material> > &p_materials, Map<Ref<ArrayMesh>, Ref<ArrayMesh> > &p_meshes); + void _make_external_resources(Node *p_node, const String &p_base_path, bool p_make_animations, bool p_make_materials, bool p_keep_materials, bool p_make_meshes, Map<Ref<Animation>, Ref<Animation> > &p_animations, Map<Ref<Material>, Ref<Material> > &p_materials, Map<Ref<ArrayMesh>, Ref<ArrayMesh> > &p_meshes); Node *_fix_node(Node *p_node, Node *p_root, Map<Ref<ArrayMesh>, Ref<Shape> > &collision_map); diff --git a/editor/plugins/animation_tree_editor_plugin.cpp b/editor/plugins/animation_tree_editor_plugin.cpp index 054124da8f..414b091475 100644 --- a/editor/plugins/animation_tree_editor_plugin.cpp +++ b/editor/plugins/animation_tree_editor_plugin.cpp @@ -476,7 +476,7 @@ void AnimationTreeEditor::_draw_node(const StringName &p_node) { Color font_color = get_color("font_color", "PopupMenu"); Color font_color_title = get_color("font_color_hover", "PopupMenu"); font_color_title.a *= 0.8; - Ref<Texture> slot_icon = get_icon("NodeRealSlot", "EditorIcons"); + Ref<Texture> slot_icon = get_icon("VisualShaderPort", "EditorIcons"); Size2 size = get_node_size(p_node); Point2 pos = anim_tree->node_get_pos(p_node); @@ -599,7 +599,7 @@ void AnimationTreeEditor::_draw_node(const StringName &p_node) { if (editable) { - Ref<Texture> arrow = get_icon("arrow", "Tree"); + Ref<Texture> arrow = get_icon("GuiDropdown", "EditorIcons"); Point2 arrow_ofs(w - arrow->get_width(), Math::floor((h - arrow->get_height()) / 2)); arrow->draw(ci, ofs + arrow_ofs); } @@ -671,7 +671,7 @@ Point2 AnimationTreeEditor::_get_slot_pos(const StringName &p_node_id, bool p_in Ref<StyleBox> style = get_stylebox("panel", "PopupMenu"); Ref<Font> font = get_font("font", "PopupMenu"); - Ref<Texture> slot_icon = get_icon("NodeRealSlot", "EditorIcons"); + Ref<Texture> slot_icon = get_icon("VisualShaderPort", "EditorIcons"); Size2 size = get_node_size(p_node_id); Point2 pos = anim_tree->node_get_pos(p_node_id); diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index ad01d0a31e..b28da54c6d 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -845,6 +845,8 @@ void CanvasItemEditor::_prepare_drag(const Point2 &p_click_pos) { se->undo_pivot = Object::cast_to<Node2D>(canvas_item)->edit_get_pivot(); if (Object::cast_to<Control>(canvas_item)) se->undo_pivot = Object::cast_to<Control>(canvas_item)->get_pivot_offset(); + + se->pre_drag_xform = canvas_item->get_global_transform_with_canvas(); } if (selection.size() == 1 && Object::cast_to<Node2D>(selection[0])) { @@ -1411,6 +1413,7 @@ void CanvasItemEditor::_viewport_gui_input(const Ref<InputEvent> &p_event) { se->undo_pivot = Object::cast_to<Node2D>(canvas_item)->edit_get_pivot(); if (Object::cast_to<Control>(canvas_item)) se->undo_pivot = Object::cast_to<Control>(canvas_item)->get_pivot_offset(); + se->pre_drag_xform = canvas_item->get_global_transform_with_canvas(); return; } @@ -1432,6 +1435,7 @@ void CanvasItemEditor::_viewport_gui_input(const Ref<InputEvent> &p_event) { se->undo_pivot = Object::cast_to<Node2D>(canvas_item)->edit_get_pivot(); if (Object::cast_to<Control>(canvas_item)) se->undo_pivot = Object::cast_to<Control>(canvas_item)->get_pivot_offset(); + se->pre_drag_xform = canvas_item->get_global_transform_with_canvas(); return; } @@ -1441,6 +1445,7 @@ void CanvasItemEditor::_viewport_gui_input(const Ref<InputEvent> &p_event) { if (drag != DRAG_NONE) { drag_from = transform.affine_inverse().xform(click); se->undo_state = canvas_item->edit_get_state(); + se->pre_drag_xform = canvas_item->get_global_transform_with_canvas(); return; } } @@ -1993,6 +1998,23 @@ void CanvasItemEditor::_viewport_draw() { Rect2 rect = canvas_item->get_item_rect(); + if (drag != DRAG_NONE && drag != DRAG_PIVOT) { + const Transform2D pre_drag_xform = transform * se->pre_drag_xform; + const Color pre_drag_color = Color(0.4, 0.6, 1, 0.7); + + Vector2 pre_drag_endpoints[4] = { + + pre_drag_xform.xform(rect.position), + pre_drag_xform.xform(rect.position + Vector2(rect.size.x, 0)), + pre_drag_xform.xform(rect.position + rect.size), + pre_drag_xform.xform(rect.position + Vector2(0, rect.size.y)) + }; + + for (int i = 0; i < 4; i++) { + viewport->draw_line(pre_drag_endpoints[i], pre_drag_endpoints[(i + 1) % 4], pre_drag_color, 2); + } + } + Transform2D xform = transform * canvas_item->get_global_transform_with_canvas(); VisualServer::get_singleton()->canvas_item_add_set_transform(ci, xform); diff --git a/editor/plugins/canvas_item_editor_plugin.h b/editor/plugins/canvas_item_editor_plugin.h index 2e1a2eac5f..f61bfc9ebb 100644 --- a/editor/plugins/canvas_item_editor_plugin.h +++ b/editor/plugins/canvas_item_editor_plugin.h @@ -58,6 +58,8 @@ public: Vector2 prev_pivot; float prev_anchors[4]; + Transform2D pre_drag_xform; + CanvasItemEditorSelectedItem() { prev_rot = 0; } }; @@ -315,7 +317,7 @@ class CanvasItemEditor : public VBoxContainer { void _prepare_drag(const Point2 &p_click_pos); DragType _get_anchor_handle_drag_type(const Point2 &p_click, Vector2 &r_point); - float _anchor_snap(float anchor, bool *snapped = NULL, float p_opposite_anchor = -1); + float _anchor_snap(float p_anchor, bool *p_snapped = NULL, float p_opposite_anchor = -1); Vector2 _anchor_to_position(Control *p_control, Vector2 anchor); Vector2 _position_to_anchor(Control *p_control, Vector2 position); diff --git a/editor/plugins/navigation_mesh_editor_plugin.h b/editor/plugins/navigation_mesh_editor_plugin.h index 3009e2addc..bac7f608ab 100644 --- a/editor/plugins/navigation_mesh_editor_plugin.h +++ b/editor/plugins/navigation_mesh_editor_plugin.h @@ -56,7 +56,7 @@ class NavigationMeshEditor : public Control { protected: void _node_removed(Node *p_node); static void _bind_methods(); - void _notification(int p_what); + void _notification(int p_option); public: void edit(NavigationMeshInstance *p_nav_mesh_instance); @@ -74,8 +74,8 @@ class NavigationMeshEditorPlugin : public EditorPlugin { public: virtual String get_name() const { return "NavigationMesh"; } bool has_main_screen() const { return false; } - virtual void edit(Object *p_node); - virtual bool handles(Object *p_node) const; + virtual void edit(Object *p_object); + virtual bool handles(Object *p_object) const; virtual void make_visible(bool p_visible); NavigationMeshEditorPlugin(EditorNode *p_node); diff --git a/editor/plugins/navigation_mesh_generator.h b/editor/plugins/navigation_mesh_generator.h index 48e7dfe53f..0a1c497f8f 100644 --- a/editor/plugins/navigation_mesh_generator.h +++ b/editor/plugins/navigation_mesh_generator.h @@ -56,7 +56,7 @@ protected: rcPolyMeshDetail *detail_mesh, Vector<float> &verticies, Vector<int> &indices); public: - static void bake(Ref<NavigationMesh> p_nav_mesh, Node *p_base); + static void bake(Ref<NavigationMesh> p_nav_mesh, Node *p_node); static void clear(Ref<NavigationMesh> p_nav_mesh); }; diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 44a9bc6d2e..9af5885a17 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -1682,9 +1682,10 @@ bool ScriptEditor::edit(const Ref<Script> &p_script, int p_line, int p_col, bool break; } ERR_FAIL_COND_V(!se, false); - tab_container->add_child(se); + // load script before adding as child else editor will crash at theme loading se->set_edited_script(p_script); + tab_container->add_child(se); se->set_tooltip_request_func("_get_debug_tooltip", this); if (se->get_edit_menu()) { se->get_edit_menu()->hide(); diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index d2cb96bf3b..c875ee7011 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -75,35 +75,98 @@ void ScriptTextEditor::_load_theme_settings() { text_edit->clear_colors(); - /* keyword color */ - - text_edit->add_color_override("background_color", EDITOR_DEF("text_editor/highlighting/background_color", Color(0, 0, 0, 0))); - text_edit->add_color_override("completion_background_color", EDITOR_DEF("text_editor/highlighting/completion_background_color", Color(0, 0, 0, 0))); - text_edit->add_color_override("completion_selected_color", EDITOR_DEF("text_editor/highlighting/completion_selected_color", Color::html("434244"))); - text_edit->add_color_override("completion_existing_color", EDITOR_DEF("text_editor/highlighting/completion_existing_color", Color::html("21dfdfdf"))); - text_edit->add_color_override("completion_scroll_color", EDITOR_DEF("text_editor/highlighting/completion_scroll_color", Color::html("ffffff"))); - text_edit->add_color_override("completion_font_color", EDITOR_DEF("text_editor/highlighting/completion_font_color", Color::html("aaaaaa"))); - text_edit->add_color_override("font_color", EDITOR_DEF("text_editor/highlighting/text_color", Color(0, 0, 0))); - text_edit->add_color_override("line_number_color", EDITOR_DEF("text_editor/highlighting/line_number_color", Color(0, 0, 0))); - text_edit->add_color_override("caret_color", EDITOR_DEF("text_editor/highlighting/caret_color", Color(0, 0, 0))); - text_edit->add_color_override("caret_background_color", EDITOR_DEF("text_editor/highlighting/caret_background_color", Color(0, 0, 0))); - text_edit->add_color_override("font_selected_color", EDITOR_DEF("text_editor/highlighting/text_selected_color", Color(1, 1, 1))); - text_edit->add_color_override("selection_color", EDITOR_DEF("text_editor/highlighting/selection_color", Color(0.2, 0.2, 1))); - text_edit->add_color_override("brace_mismatch_color", EDITOR_DEF("text_editor/highlighting/brace_mismatch_color", Color(1, 0.2, 0.2))); - text_edit->add_color_override("current_line_color", EDITOR_DEF("text_editor/highlighting/current_line_color", Color(0.3, 0.5, 0.8, 0.15))); - text_edit->add_color_override("line_length_guideline_color", EDITOR_DEF("text_editor/highlighting/line_length_guideline_color", Color(0, 0, 0))); - text_edit->add_color_override("word_highlighted_color", EDITOR_DEF("text_editor/highlighting/word_highlighted_color", Color(0.8, 0.9, 0.9, 0.15))); - text_edit->add_color_override("number_color", EDITOR_DEF("text_editor/highlighting/number_color", Color(0.9, 0.6, 0.0, 2))); - text_edit->add_color_override("function_color", EDITOR_DEF("text_editor/highlighting/function_color", Color(0.4, 0.6, 0.8))); - text_edit->add_color_override("member_variable_color", EDITOR_DEF("text_editor/highlighting/member_variable_color", Color(0.9, 0.3, 0.3))); - text_edit->add_color_override("mark_color", EDITOR_DEF("text_editor/highlighting/mark_color", Color(1.0, 0.4, 0.4, 0.4))); - text_edit->add_color_override("breakpoint_color", EDITOR_DEF("text_editor/highlighting/breakpoint_color", Color(0.8, 0.8, 0.4, 0.2))); - text_edit->add_color_override("search_result_color", EDITOR_DEF("text_editor/highlighting/search_result_color", Color(0.05, 0.25, 0.05, 1))); - text_edit->add_color_override("search_result_border_color", EDITOR_DEF("text_editor/highlighting/search_result_border_color", Color(0.1, 0.45, 0.1, 1))); - text_edit->add_color_override("symbol_color", EDITOR_DEF("text_editor/highlighting/symbol_color", Color::hex(0x005291ff))); - text_edit->add_constant_override("line_spacing", EDITOR_DEF("text_editor/theme/line_spacing", 4)); + Color background_color = EDITOR_DEF("text_editor/highlighting/background_color", Color(0, 0, 0, 0)); + Color completion_background_color = EDITOR_DEF("text_editor/highlighting/completion_background_color", Color(0, 0, 0, 0)); + Color completion_selected_color = EDITOR_DEF("text_editor/highlighting/completion_selected_color", Color::html("434244")); + Color completion_existing_color = EDITOR_DEF("text_editor/highlighting/completion_existing_color", Color::html("21dfdfdf")); + Color completion_scroll_color = EDITOR_DEF("text_editor/highlighting/completion_scroll_color", Color::html("ffffff")); + Color completion_font_color = EDITOR_DEF("text_editor/highlighting/completion_font_color", Color::html("aaaaaa")); + Color text_color = EDITOR_DEF("text_editor/highlighting/text_color", Color(0, 0, 0)); + Color line_number_color = EDITOR_DEF("text_editor/highlighting/line_number_color", Color(0, 0, 0)); + Color caret_color = EDITOR_DEF("text_editor/highlighting/caret_color", Color(0, 0, 0)); + Color caret_background_color = EDITOR_DEF("text_editor/highlighting/caret_background_color", Color(0, 0, 0)); + Color text_selected_color = EDITOR_DEF("text_editor/highlighting/text_selected_color", Color(1, 1, 1)); + Color selection_color = EDITOR_DEF("text_editor/highlighting/selection_color", Color(0.2, 0.2, 1)); + Color brace_mismatch_color = EDITOR_DEF("text_editor/highlighting/brace_mismatch_color", Color(1, 0.2, 0.2)); + Color current_line_color = EDITOR_DEF("text_editor/highlighting/current_line_color", Color(0.3, 0.5, 0.8, 0.15)); + Color line_length_guideline_color = EDITOR_DEF("text_editor/highlighting/line_length_guideline_color", Color(0, 0, 0)); + Color word_highlighted_color = EDITOR_DEF("text_editor/highlighting/word_highlighted_color", Color(0.8, 0.9, 0.9, 0.15)); + Color number_color = EDITOR_DEF("text_editor/highlighting/number_color", Color(0.9, 0.6, 0.0, 2)); + Color function_color = EDITOR_DEF("text_editor/highlighting/function_color", Color(0.4, 0.6, 0.8)); + Color member_variable_color = EDITOR_DEF("text_editor/highlighting/member_variable_color", Color(0.9, 0.3, 0.3)); + Color mark_color = EDITOR_DEF("text_editor/highlighting/mark_color", Color(1.0, 0.4, 0.4, 0.4)); + Color breakpoint_color = EDITOR_DEF("text_editor/highlighting/breakpoint_color", Color(0.8, 0.8, 0.4, 0.2)); + Color search_result_color = EDITOR_DEF("text_editor/highlighting/search_result_color", Color(0.05, 0.25, 0.05, 1)); + Color search_result_border_color = EDITOR_DEF("text_editor/highlighting/search_result_border_color", Color(0.1, 0.45, 0.1, 1)); + Color symbol_color = EDITOR_DEF("text_editor/highlighting/symbol_color", Color::hex(0x005291ff)); Color keyword_color = EDITOR_DEF("text_editor/highlighting/keyword_color", Color(0.5, 0.0, 0.2)); + Color basetype_color = EDITOR_DEF("text_editor/highlighting/base_type_color", Color(0.3, 0.3, 0.0)); + Color type_color = EDITOR_DEF("text_editor/highlighting/engine_type_color", Color(0.0, 0.2, 0.4)); + Color comment_color = EDITOR_DEF("text_editor/highlighting/comment_color", Color::hex(0x797e7eff)); + Color string_color = EDITOR_DEF("text_editor/highlighting/string_color", Color::hex(0x6b6f00ff)); + + // Adapt + if (EditorSettings::get_singleton()->get("text_editor/theme/color_theme") == "Adaptive") { + Ref<Theme> tm = EditorNode::get_singleton()->get_theme_base()->get_theme(); + + symbol_color = tm->get_color("text_editor/theme/symbol_color", "Editor"); + keyword_color = tm->get_color("text_editor/theme/keyword_color", "Editor"); + basetype_color = tm->get_color("text_editor/theme/basetype_color", "Editor"); + type_color = tm->get_color("text_editor/theme/type_color", "Editor"); + comment_color = tm->get_color("text_editor/theme/comment_color", "Editor"); + string_color = tm->get_color("text_editor/theme/string_color", "Editor"); + background_color = tm->get_color("text_editor/theme/background_color", "Editor"); + completion_background_color = tm->get_color("text_editor/theme/completion_background_color", "Editor"); + completion_selected_color = tm->get_color("text_editor/theme/completion_selected_color", "Editor"); + completion_existing_color = tm->get_color("text_editor/theme/completion_existing_color", "Editor"); + completion_scroll_color = tm->get_color("text_editor/theme/completion_scroll_color", "Editor"); + completion_font_color = tm->get_color("text_editor/theme/completion_font_color", "Editor"); + text_color = tm->get_color("text_editor/theme/text_color", "Editor"); + line_number_color = tm->get_color("text_editor/theme/line_number_color", "Editor"); + caret_color = tm->get_color("text_editor/theme/caret_color", "Editor"); + caret_background_color = tm->get_color("text_editor/theme/caret_background_color", "Editor"); + text_selected_color = tm->get_color("text_editor/theme/text_selected_color", "Editor"); + selection_color = tm->get_color("text_editor/theme/selection_color", "Editor"); + brace_mismatch_color = tm->get_color("text_editor/theme/brace_mismatch_color", "Editor"); + current_line_color = tm->get_color("text_editor/theme/current_line_color", "Editor"); + line_length_guideline_color = tm->get_color("text_editor/theme/line_length_guideline_color", "Editor"); + word_highlighted_color = tm->get_color("text_editor/theme/word_highlighted_color", "Editor"); + number_color = tm->get_color("text_editor/theme/number_color", "Editor"); + function_color = tm->get_color("text_editor/theme/function_color", "Editor"); + member_variable_color = tm->get_color("text_editor/theme/member_variable_color", "Editor"); + mark_color = tm->get_color("text_editor/theme/mark_color", "Editor"); + breakpoint_color = tm->get_color("text_editor/theme/breakpoint_color", "Editor"); + search_result_color = tm->get_color("text_editor/theme/search_result_color", "Editor"); + search_result_border_color = tm->get_color("text_editor/theme/search_result_border_color", "Editor"); + } + + text_edit->add_color_override("background_color", background_color); + text_edit->add_color_override("completion_background_color", completion_background_color); + text_edit->add_color_override("completion_selected_color", completion_selected_color); + text_edit->add_color_override("completion_existing_color", completion_existing_color); + text_edit->add_color_override("completion_scroll_color", completion_scroll_color); + text_edit->add_color_override("completion_font_color", completion_font_color); + text_edit->add_color_override("font_color", text_color); + text_edit->add_color_override("line_number_color", line_number_color); + text_edit->add_color_override("caret_color", caret_color); + text_edit->add_color_override("caret_background_color", caret_background_color); + text_edit->add_color_override("font_selected_color", text_selected_color); + text_edit->add_color_override("selection_color", selection_color); + text_edit->add_color_override("brace_mismatch_color", brace_mismatch_color); + text_edit->add_color_override("current_line_color", current_line_color); + text_edit->add_color_override("line_length_guideline_color", line_length_guideline_color); + text_edit->add_color_override("word_highlighted_color", word_highlighted_color); + text_edit->add_color_override("number_color", number_color); + text_edit->add_color_override("function_color", function_color); + text_edit->add_color_override("member_variable_color", member_variable_color); + text_edit->add_color_override("mark_color", mark_color); + text_edit->add_color_override("breakpoint_color", breakpoint_color); + text_edit->add_color_override("search_result_color", search_result_color); + text_edit->add_color_override("search_result_border_color", search_result_border_color); + text_edit->add_color_override("symbol_color", symbol_color); + + text_edit->add_constant_override("line_spacing", EDITOR_DEF("text_editor/theme/line_spacing", 4)); List<String> keywords; script->get_language()->get_reserved_words(&keywords); @@ -113,8 +176,6 @@ void ScriptTextEditor::_load_theme_settings() { } //colorize core types - Color basetype_color = EDITOR_DEF("text_editor/highlighting/base_type_color", Color(0.3, 0.3, 0.0)); - text_edit->add_keyword_color("String", basetype_color); text_edit->add_keyword_color("Vector2", basetype_color); text_edit->add_keyword_color("Rect2", basetype_color); @@ -140,8 +201,6 @@ void ScriptTextEditor::_load_theme_settings() { text_edit->add_keyword_color("PoolColorArray", basetype_color); //colorize engine types - Color type_color = EDITOR_DEF("text_editor/highlighting/engine_type_color", Color(0.0, 0.2, 0.4)); - List<StringName> types; ClassDB::get_class_list(&types); @@ -155,7 +214,6 @@ void ScriptTextEditor::_load_theme_settings() { } //colorize comments - Color comment_color = EDITOR_DEF("text_editor/highlighting/comment_color", Color::hex(0x797e7eff)); List<String> comments; script->get_language()->get_comment_delimiters(&comments); @@ -169,7 +227,6 @@ void ScriptTextEditor::_load_theme_settings() { } //colorize strings - Color string_color = EDITOR_DEF("text_editor/highlighting/string_color", Color::hex(0x6b6f00ff)); List<String> strings; script->get_language()->get_string_delimiters(&strings); @@ -209,6 +266,7 @@ void ScriptTextEditor::_notification(int p_what) { if (p_what == NOTIFICATION_READY) { //emit_signal("name_changed"); + _load_theme_settings(); } } @@ -492,8 +550,6 @@ void ScriptTextEditor::set_edited_script(const Ref<Script> &p_script) { script = p_script; - _load_theme_settings(); - code_editor->get_text_edit()->set_text(script->get_source_code()); code_editor->get_text_edit()->clear_undo_history(); code_editor->get_text_edit()->tag_saved_version(); diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp index 1b02f18d85..b0ee1a32ca 100644 --- a/editor/plugins/shader_editor_plugin.cpp +++ b/editor/plugins/shader_editor_plugin.cpp @@ -60,33 +60,96 @@ void ShaderTextEditor::_load_theme_settings() { get_text_edit()->clear_colors(); - /* keyword color */ - - get_text_edit()->add_color_override("background_color", EDITOR_DEF("text_editor/highlighting/background_color", Color(0, 0, 0, 0))); - get_text_edit()->add_color_override("completion_background_color", EDITOR_DEF("text_editor/highlighting/completion_background_color", Color(0, 0, 0, 0))); - get_text_edit()->add_color_override("completion_selected_color", EDITOR_DEF("text_editor/highlighting/completion_selected_color", Color::html("434244"))); - get_text_edit()->add_color_override("completion_existing_color", EDITOR_DEF("text_editor/highlighting/completion_existing_color", Color::html("21dfdfdf"))); - get_text_edit()->add_color_override("completion_scroll_color", EDITOR_DEF("text_editor/highlighting/completion_scroll_color", Color::html("ffffff"))); - get_text_edit()->add_color_override("completion_font_color", EDITOR_DEF("text_editor/highlighting/completion_font_color", Color::html("aaaaaa"))); - get_text_edit()->add_color_override("font_color", EDITOR_DEF("text_editor/highlighting/text_color", Color(0, 0, 0))); - get_text_edit()->add_color_override("line_number_color", EDITOR_DEF("text_editor/highlighting/line_number_color", Color(0, 0, 0))); - get_text_edit()->add_color_override("caret_color", EDITOR_DEF("text_editor/highlighting/caret_color", Color(0, 0, 0))); - get_text_edit()->add_color_override("caret_background_color", EDITOR_DEF("text_editor/highlighting/caret_background_color", Color(0, 0, 0))); - get_text_edit()->add_color_override("font_selected_color", EDITOR_DEF("text_editor/highlighting/text_selected_color", Color(1, 1, 1))); - get_text_edit()->add_color_override("selection_color", EDITOR_DEF("text_editor/highlighting/selection_color", Color(0.2, 0.2, 1))); - get_text_edit()->add_color_override("brace_mismatch_color", EDITOR_DEF("text_editor/highlighting/brace_mismatch_color", Color(1, 0.2, 0.2))); - get_text_edit()->add_color_override("current_line_color", EDITOR_DEF("text_editor/highlighting/current_line_color", Color(0.3, 0.5, 0.8, 0.15))); - get_text_edit()->add_color_override("word_highlighted_color", EDITOR_DEF("text_editor/highlighting/word_highlighted_color", Color(0.8, 0.9, 0.9, 0.15))); - get_text_edit()->add_color_override("number_color", EDITOR_DEF("text_editor/highlighting/number_color", Color(0.9, 0.6, 0.0, 2))); - get_text_edit()->add_color_override("function_color", EDITOR_DEF("text_editor/highlighting/function_color", Color(0.4, 0.6, 0.8))); - get_text_edit()->add_color_override("member_variable_color", EDITOR_DEF("text_editor/highlighting/member_variable_color", Color(0.9, 0.3, 0.3))); - get_text_edit()->add_color_override("mark_color", EDITOR_DEF("text_editor/highlighting/mark_color", Color(1.0, 0.4, 0.4, 0.4))); - get_text_edit()->add_color_override("breakpoint_color", EDITOR_DEF("text_editor/highlighting/breakpoint_color", Color(0.8, 0.8, 0.4, 0.2))); - get_text_edit()->add_color_override("search_result_color", EDITOR_DEF("text_editor/highlighting/search_result_color", Color(0.05, 0.25, 0.05, 1))); - get_text_edit()->add_color_override("search_result_border_color", EDITOR_DEF("text_editor/highlighting/search_result_border_color", Color(0.1, 0.45, 0.1, 1))); - get_text_edit()->add_color_override("symbol_color", EDITOR_DEF("text_editor/highlighting/symbol_color", Color::hex(0x005291ff))); + Color background_color = EDITOR_DEF("text_editor/highlighting/background_color", Color(0, 0, 0, 0)); + Color completion_background_color = EDITOR_DEF("text_editor/highlighting/completion_background_color", Color(0, 0, 0, 0)); + Color completion_selected_color = EDITOR_DEF("text_editor/highlighting/completion_selected_color", Color::html("434244")); + Color completion_existing_color = EDITOR_DEF("text_editor/highlighting/completion_existing_color", Color::html("21dfdfdf")); + Color completion_scroll_color = EDITOR_DEF("text_editor/highlighting/completion_scroll_color", Color::html("ffffff")); + Color completion_font_color = EDITOR_DEF("text_editor/highlighting/completion_font_color", Color::html("aaaaaa")); + Color text_color = EDITOR_DEF("text_editor/highlighting/text_color", Color(0, 0, 0)); + Color line_number_color = EDITOR_DEF("text_editor/highlighting/line_number_color", Color(0, 0, 0)); + Color caret_color = EDITOR_DEF("text_editor/highlighting/caret_color", Color(0, 0, 0)); + Color caret_background_color = EDITOR_DEF("text_editor/highlighting/caret_background_color", Color(0, 0, 0)); + Color text_selected_color = EDITOR_DEF("text_editor/highlighting/text_selected_color", Color(1, 1, 1)); + Color selection_color = EDITOR_DEF("text_editor/highlighting/selection_color", Color(0.2, 0.2, 1)); + Color brace_mismatch_color = EDITOR_DEF("text_editor/highlighting/brace_mismatch_color", Color(1, 0.2, 0.2)); + Color current_line_color = EDITOR_DEF("text_editor/highlighting/current_line_color", Color(0.3, 0.5, 0.8, 0.15)); + Color line_length_guideline_color = EDITOR_DEF("text_editor/highlighting/line_length_guideline_color", Color(0, 0, 0)); + Color word_highlighted_color = EDITOR_DEF("text_editor/highlighting/word_highlighted_color", Color(0.8, 0.9, 0.9, 0.15)); + Color number_color = EDITOR_DEF("text_editor/highlighting/number_color", Color(0.9, 0.6, 0.0, 2)); + Color function_color = EDITOR_DEF("text_editor/highlighting/function_color", Color(0.4, 0.6, 0.8)); + Color member_variable_color = EDITOR_DEF("text_editor/highlighting/member_variable_color", Color(0.9, 0.3, 0.3)); + Color mark_color = EDITOR_DEF("text_editor/highlighting/mark_color", Color(1.0, 0.4, 0.4, 0.4)); + Color breakpoint_color = EDITOR_DEF("text_editor/highlighting/breakpoint_color", Color(0.8, 0.8, 0.4, 0.2)); + Color search_result_color = EDITOR_DEF("text_editor/highlighting/search_result_color", Color(0.05, 0.25, 0.05, 1)); + Color search_result_border_color = EDITOR_DEF("text_editor/highlighting/search_result_border_color", Color(0.1, 0.45, 0.1, 1)); + Color symbol_color = EDITOR_DEF("text_editor/highlighting/symbol_color", Color::hex(0x005291ff)); Color keyword_color = EDITOR_DEF("text_editor/highlighting/keyword_color", Color(0.5, 0.0, 0.2)); + Color basetype_color = EDITOR_DEF("text_editor/highlighting/base_type_color", Color(0.3, 0.3, 0.0)); + Color type_color = EDITOR_DEF("text_editor/highlighting/engine_type_color", Color(0.0, 0.2, 0.4)); + Color comment_color = EDITOR_DEF("text_editor/highlighting/comment_color", Color::hex(0x797e7eff)); + Color string_color = EDITOR_DEF("text_editor/highlighting/string_color", Color::hex(0x6b6f00ff)); + + // Adapt + if (EditorSettings::get_singleton()->get("text_editor/theme/color_theme") == "Adaptive") { + Ref<Theme> tm = EditorNode::get_singleton()->get_theme_base()->get_theme(); + + symbol_color = tm->get_color("text_editor/theme/symbol_color", "Editor"); + keyword_color = tm->get_color("text_editor/theme/keyword_color", "Editor"); + basetype_color = tm->get_color("text_editor/theme/basetype_color", "Editor"); + type_color = tm->get_color("text_editor/theme/type_color", "Editor"); + comment_color = tm->get_color("text_editor/theme/comment_color", "Editor"); + string_color = tm->get_color("text_editor/theme/string_color", "Editor"); + background_color = tm->get_color("text_editor/theme/background_color", "Editor"); + completion_background_color = tm->get_color("text_editor/theme/completion_background_color", "Editor"); + completion_selected_color = tm->get_color("text_editor/theme/completion_selected_color", "Editor"); + completion_existing_color = tm->get_color("text_editor/theme/completion_existing_color", "Editor"); + completion_scroll_color = tm->get_color("text_editor/theme/completion_scroll_color", "Editor"); + completion_font_color = tm->get_color("text_editor/theme/completion_font_color", "Editor"); + text_color = tm->get_color("text_editor/theme/text_color", "Editor"); + line_number_color = tm->get_color("text_editor/theme/line_number_color", "Editor"); + caret_color = tm->get_color("text_editor/theme/caret_color", "Editor"); + caret_background_color = tm->get_color("text_editor/theme/caret_background_color", "Editor"); + text_selected_color = tm->get_color("text_editor/theme/text_selected_color", "Editor"); + selection_color = tm->get_color("text_editor/theme/selection_color", "Editor"); + brace_mismatch_color = tm->get_color("text_editor/theme/brace_mismatch_color", "Editor"); + current_line_color = tm->get_color("text_editor/theme/current_line_color", "Editor"); + line_length_guideline_color = tm->get_color("text_editor/theme/line_length_guideline_color", "Editor"); + word_highlighted_color = tm->get_color("text_editor/theme/word_highlighted_color", "Editor"); + number_color = tm->get_color("text_editor/theme/number_color", "Editor"); + function_color = tm->get_color("text_editor/theme/function_color", "Editor"); + member_variable_color = tm->get_color("text_editor/theme/member_variable_color", "Editor"); + mark_color = tm->get_color("text_editor/theme/mark_color", "Editor"); + breakpoint_color = tm->get_color("text_editor/theme/breakpoint_color", "Editor"); + search_result_color = tm->get_color("text_editor/theme/search_result_color", "Editor"); + search_result_border_color = tm->get_color("text_editor/theme/search_result_border_color", "Editor"); + } + + get_text_edit()->add_color_override("background_color", background_color); + get_text_edit()->add_color_override("completion_background_color", completion_background_color); + get_text_edit()->add_color_override("completion_selected_color", completion_selected_color); + get_text_edit()->add_color_override("completion_existing_color", completion_existing_color); + get_text_edit()->add_color_override("completion_scroll_color", completion_scroll_color); + get_text_edit()->add_color_override("completion_font_color", completion_font_color); + get_text_edit()->add_color_override("font_color", text_color); + get_text_edit()->add_color_override("line_number_color", line_number_color); + get_text_edit()->add_color_override("caret_color", caret_color); + get_text_edit()->add_color_override("caret_background_color", caret_background_color); + get_text_edit()->add_color_override("font_selected_color", text_selected_color); + get_text_edit()->add_color_override("selection_color", selection_color); + get_text_edit()->add_color_override("brace_mismatch_color", brace_mismatch_color); + get_text_edit()->add_color_override("current_line_color", current_line_color); + get_text_edit()->add_color_override("line_length_guideline_color", line_length_guideline_color); + get_text_edit()->add_color_override("word_highlighted_color", word_highlighted_color); + get_text_edit()->add_color_override("number_color", number_color); + get_text_edit()->add_color_override("function_color", function_color); + get_text_edit()->add_color_override("member_variable_color", member_variable_color); + get_text_edit()->add_color_override("mark_color", mark_color); + get_text_edit()->add_color_override("breakpoint_color", breakpoint_color); + get_text_edit()->add_color_override("search_result_color", search_result_color); + get_text_edit()->add_color_override("search_result_border_color", search_result_border_color); + get_text_edit()->add_color_override("symbol_color", symbol_color); List<String> keywords; ShaderLanguage::get_keyword_list(&keywords); @@ -115,8 +178,6 @@ void ShaderTextEditor::_load_theme_settings() { //Color basetype_color= EDITOR_DEF("text_editor/base_type_color",Color(0.3,0.3,0.0)); //colorize comments - Color comment_color = EDITOR_DEF("text_editor/highlighting/comment_color", Color::hex(0x797e7eff)); - get_text_edit()->add_color_region("/*", "*/", comment_color, false); get_text_edit()->add_color_region("//", "", comment_color, false); diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index 704d474746..a6ab36ed27 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -76,18 +76,29 @@ void SpatialEditorViewport::_update_camera(float p_interp_delta) { } else camera->set_perspective(get_fov(), get_znear(), get_zfar()); - float inertia = EDITOR_DEF("editors/3d/orbit_inertia", 0.5); - inertia = MAX(0, inertia); + //when not being manipulated, move softly + float free_orbit_inertia = EDITOR_DEF("editors/3d/free_orbit_inertia", 0.15); + float free_translation_inertia = EDITOR_DEF("editors/3d/free_translation_inertia", 0.15); + //when being manipulated, move more quickly + float manip_orbit_inertia = EDITOR_DEF("editors/3d/manipulation_orbit_inertia", 0.075); + float manip_translation_inertia = EDITOR_DEF("editors/3d/manipulation_translation_inertia", 0.075); + + //determine if being manipulated + bool manipulated = (Input::get_singleton()->get_mouse_button_mask() & (2 | 4)) || Input::get_singleton()->is_key_pressed(KEY_SHIFT) || Input::get_singleton()->is_key_pressed(KEY_ALT) || Input::get_singleton()->is_key_pressed(KEY_CONTROL); + + float orbit_inertia = MAX(0.00001, manipulated ? manip_orbit_inertia : free_orbit_inertia); + float translation_inertia = MAX(0.0001, manipulated ? manip_translation_inertia : free_translation_inertia); Cursor old_camera_cursor = camera_cursor; camera_cursor = cursor; - camera_cursor.x_rot = Math::lerp(old_camera_cursor.x_rot, cursor.x_rot, p_interp_delta * (1 / inertia)); - camera_cursor.y_rot = Math::lerp(old_camera_cursor.y_rot, cursor.y_rot, p_interp_delta * (1 / inertia)); + camera_cursor.x_rot = Math::lerp(old_camera_cursor.x_rot, cursor.x_rot, MIN(1.f, p_interp_delta * (1 / orbit_inertia))); + camera_cursor.y_rot = Math::lerp(old_camera_cursor.y_rot, cursor.y_rot, MIN(1.f, p_interp_delta * (1 / orbit_inertia))); - bool disable_interp = (Input::get_singleton()->get_mouse_button_mask() & (2 | 4)) || Input::get_singleton()->is_key_pressed(KEY_SHIFT) || Input::get_singleton()->is_key_pressed(KEY_ALT) || Input::get_singleton()->is_key_pressed(KEY_CONTROL); + camera_cursor.pos = old_camera_cursor.pos.linear_interpolate(cursor.pos, MIN(1.f, p_interp_delta * (1 / translation_inertia))); + camera_cursor.distance = Math::lerp(old_camera_cursor.distance, cursor.distance, MIN(1.f, p_interp_delta * (1 / translation_inertia))); - if (p_interp_delta == 0 || disable_interp || is_freelook_active()) { + if (p_interp_delta == 0 || is_freelook_active()) { camera_cursor = cursor; } @@ -2843,8 +2854,8 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed ED_SHORTCUT("spatial_editor/freelook_right", TTR("Freelook Right"), KEY_D); ED_SHORTCUT("spatial_editor/freelook_forward", TTR("Freelook Forward"), KEY_W); ED_SHORTCUT("spatial_editor/freelook_backwards", TTR("Freelook Backwards"), KEY_S); - ED_SHORTCUT("spatial_editor/freelook_up", TTR("Freelook Up"), KEY_Q); - ED_SHORTCUT("spatial_editor/freelook_down", TTR("Freelook Down"), KEY_E); + ED_SHORTCUT("spatial_editor/freelook_up", TTR("Freelook Up"), KEY_E); + ED_SHORTCUT("spatial_editor/freelook_down", TTR("Freelook Down"), KEY_Q); ED_SHORTCUT("spatial_editor/freelook_speed_modifier", TTR("Freelook Speed Modifier"), KEY_SHIFT); preview_camera = memnew(Button); diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp index 43856116a6..b85ffd6c67 100644 --- a/editor/plugins/tile_map_editor_plugin.cpp +++ b/editor/plugins/tile_map_editor_plugin.cpp @@ -72,6 +72,14 @@ void TileMapEditor::_menu_option(int p_option) { switch (p_option) { + case OPTION_PAINTING: { + // NOTE: We do not set tool = TOOL_PAINTING as this begins painting + // immediately without pressing the left mouse button first + tool = TOOL_NONE; + + canvas_item_editor->update(); + + } break; case OPTION_BUCKET: { tool = TOOL_BUCKET; @@ -703,7 +711,7 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) { return true; } else { - + // Mousebutton was released if (tool != TOOL_NONE) { if (tool == TOOL_PAINTING) { @@ -801,6 +809,9 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) { undo_redo->add_undo_method(this, "_fill_points", points, pop); undo_redo->commit_action(); + + // We want to keep the bucket-tool active + return true; } tool = TOOL_NONE; @@ -1046,9 +1057,25 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) { return true; } - if (tool != TOOL_NONE || !mouse_over) + if (!mouse_over) { + // Editor shortcuts should not fire if mouse not in viewport return false; + } + if (ED_IS_SHORTCUT("tile_map_editor/paint_tile", p_event)) { + // NOTE: We do not set tool = TOOL_PAINTING as this begins painting + // immediately without pressing the left mouse button first + tool = TOOL_NONE; + canvas_item_editor->update(); + + return true; + } + if (ED_IS_SHORTCUT("tile_map_editor/bucket_fill", p_event)) { + tool = TOOL_BUCKET; + canvas_item_editor->update(); + + return true; + } if (ED_IS_SHORTCUT("tile_map_editor/erase_selection", p_event)) { _menu_option(OPTION_ERASE_SELECTION); @@ -1458,7 +1485,7 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) { ED_SHORTCUT("tile_map_editor/erase_selection", TTR("Erase selection"), KEY_DELETE); ED_SHORTCUT("tile_map_editor/find_tile", TTR("Find tile"), KEY_MASK_CMD + KEY_F); - ED_SHORTCUT("tile_map_editor/transpose", TTR("Transpose")); + ED_SHORTCUT("tile_map_editor/transpose", TTR("Transpose"), KEY_T); ED_SHORTCUT("tile_map_editor/mirror_x", TTR("Mirror X"), KEY_A); ED_SHORTCUT("tile_map_editor/mirror_y", TTR("Mirror Y"), KEY_S); @@ -1512,7 +1539,8 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) { PopupMenu *p = options->get_popup(); - p->add_item(TTR("Bucket"), OPTION_BUCKET); + p->add_shortcut(ED_SHORTCUT("tile_map_editor/paint_tile", TTR("Paint Tile"), KEY_P), OPTION_PAINTING); + p->add_shortcut(ED_SHORTCUT("tile_map_editor/bucket_fill", TTR("Bucket Fill"), KEY_G), OPTION_BUCKET); p->add_separator(); p->add_item(TTR("Pick Tile"), OPTION_PICK_TILE, KEY_CONTROL); p->add_separator(); diff --git a/editor/plugins/tile_map_editor_plugin.h b/editor/plugins/tile_map_editor_plugin.h index e863c4bf3d..de9b9e8e0d 100644 --- a/editor/plugins/tile_map_editor_plugin.h +++ b/editor/plugins/tile_map_editor_plugin.h @@ -68,7 +68,8 @@ class TileMapEditor : public VBoxContainer { OPTION_PICK_TILE, OPTION_SELECT, OPTION_DUPLICATE, - OPTION_ERASE_SELECTION + OPTION_ERASE_SELECTION, + OPTION_PAINTING, }; TileMap *node; diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index c7a4e1fc3b..b7300b9610 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -861,13 +861,13 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: menu->add_separator(); } - menu->add_icon_item(get_icon("Load", "EditorIcons"), "Load", OBJ_MENU_LOAD); + menu->add_icon_item(get_icon("Load", "EditorIcons"), TTR("Load"), OBJ_MENU_LOAD); if (!RES(v).is_null()) { - menu->add_icon_item(get_icon("Edit", "EditorIcons"), "Edit", OBJ_MENU_EDIT); - menu->add_icon_item(get_icon("Clear", "EditorIcons"), "Clear", OBJ_MENU_CLEAR); - menu->add_icon_item(get_icon("Duplicate", "EditorIcons"), "Make Unique", OBJ_MENU_MAKE_UNIQUE); + menu->add_icon_item(get_icon("Edit", "EditorIcons"), TTR("Edit"), OBJ_MENU_EDIT); + menu->add_icon_item(get_icon("Clear", "EditorIcons"), TTR("Clear"), OBJ_MENU_CLEAR); + menu->add_icon_item(get_icon("Duplicate", "EditorIcons"), TTR("Make Unique"), OBJ_MENU_MAKE_UNIQUE); RES r = v; if (r.is_valid() && r->get_path().is_resource_file()) { menu->add_separator(); diff --git a/editor/quick_open.cpp b/editor/quick_open.cpp index b92ebed167..4bcbe073ee 100644 --- a/editor/quick_open.cpp +++ b/editor/quick_open.cpp @@ -189,7 +189,7 @@ Vector<Pair<String, Ref<Texture> > > EditorQuickOpen::_sort_fs(Vector<Pair<Strin Vector<Pair<String, Ref<Texture> > > sorted_list; if (search_text == String() || list.size() == 0) - return sorted_list; + return list; Vector<float> scores; scores.resize(list.size()); diff --git a/editor/script_editor_debugger.h b/editor/script_editor_debugger.h index 6cb5f0a70c..64ac2535a9 100644 --- a/editor/script_editor_debugger.h +++ b/editor/script_editor_debugger.h @@ -150,7 +150,7 @@ class ScriptEditorDebugger : public Control { void _scene_tree_selected(); void _scene_tree_request(); void _parse_message(const String &p_msg, const Array &p_data); - void _set_reason_text(const String &p_msg, MessageType p_type); + void _set_reason_text(const String &p_reason, MessageType p_type); void _scene_tree_property_select_object(ObjectID p_object); void _scene_tree_property_value_edited(const String &p_prop, const Variant &p_value); diff --git a/main/input_default.cpp b/main/input_default.cpp index b4c9a6207f..902d3168d8 100644 --- a/main/input_default.cpp +++ b/main/input_default.cpp @@ -80,7 +80,7 @@ bool InputDefault::is_key_pressed(int p_scancode) const { bool InputDefault::is_mouse_button_pressed(int p_button) const { _THREAD_SAFE_METHOD_ - return (mouse_button_mask & (1 << p_button)) != 0; + return (mouse_button_mask & (1 << (p_button - 1))) != 0; } static int _combine_device(int p_value, int p_device) { @@ -265,10 +265,11 @@ void InputDefault::parse_input_event(const Ref<InputEvent> &p_event) { if (mb.is_valid() && !mb->is_doubleclick()) { - if (mb->is_pressed()) - mouse_button_mask |= (1 << mb->get_button_index()); - else - mouse_button_mask &= ~(1 << mb->get_button_index()); + if (mb->is_pressed()) { + mouse_button_mask |= (1 << (mb->get_button_index() - 1)); + } else { + mouse_button_mask &= ~(1 << (mb->get_button_index() - 1)); + } if (main_loop && emulate_touch && mb->get_button_index() == 1) { Ref<InputEventScreenTouch> touch_event; diff --git a/modules/gdnative/gd_native_library_editor.cpp b/modules/gdnative/gd_native_library_editor.cpp index 8aa931d6c9..cc2c2b69a6 100644 --- a/modules/gdnative/gd_native_library_editor.cpp +++ b/modules/gdnative/gd_native_library_editor.cpp @@ -1,9 +1,39 @@ +/*************************************************************************/ +/* gd_native_library_editor.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ +#ifdef TOOLS_ENABLED #include "gd_native_library_editor.h" + #include "gdnative.h" void GDNativeLibraryEditor::_find_gdnative_singletons(EditorFileSystemDirectory *p_dir, const Set<String> &enabled_list) { - // check children for (int i = 0; i < p_dir->get_file_count(); i++) { @@ -17,48 +47,45 @@ void GDNativeLibraryEditor::_find_gdnative_singletons(EditorFileSystemDirectory if (lib.is_valid() && lib->is_singleton_gdnative()) { String path = p_dir->get_file_path(i); TreeItem *ti = libraries->create_item(libraries->get_root()); - ti->set_text(0,path.get_file()); - ti->set_tooltip(0,path); - ti->set_metadata(0,path); - ti->set_cell_mode(1,TreeItem::CELL_MODE_RANGE); - ti->set_text(1,"Disabled,Enabled"); - bool enabled = enabled_list.has(path)?true:false; - - ti->set_range(1,enabled?1:0); - ti->set_custom_color(1,enabled?Color(0,1,0):Color(1,0,0)); + ti->set_text(0, path.get_file()); + ti->set_tooltip(0, path); + ti->set_metadata(0, path); + ti->set_cell_mode(1, TreeItem::CELL_MODE_RANGE); + ti->set_text(1, "Disabled,Enabled"); + bool enabled = enabled_list.has(path) ? true : false; + + ti->set_range(1, enabled ? 1 : 0); + ti->set_custom_color(1, enabled ? Color(0, 1, 0) : Color(1, 0, 0)); } } // check subdirectories for (int i = 0; i < p_dir->get_subdir_count(); i++) { - _find_gdnative_singletons(p_dir->get_subdir(i),enabled_list); + _find_gdnative_singletons(p_dir->get_subdir(i), enabled_list); } - - } void GDNativeLibraryEditor::_update_libraries() { - updating=true; + updating = true; libraries->clear(); libraries->create_item(); //rppt Vector<String> enabled_paths; if (ProjectSettings::get_singleton()->has("gdnative/singletons")) { - enabled_paths=ProjectSettings::get_singleton()->get("gdnative/singletons"); + enabled_paths = ProjectSettings::get_singleton()->get("gdnative/singletons"); } Set<String> enabled_list; - for(int i=0;i<enabled_paths.size();i++) { + for (int i = 0; i < enabled_paths.size(); i++) { enabled_list.insert(enabled_paths[i]); } EditorFileSystemDirectory *fs = EditorFileSystem::get_singleton()->get_filesystem(); if (fs) { - _find_gdnative_singletons(fs,enabled_list); + _find_gdnative_singletons(fs, enabled_list); } - updating=false; - + updating = false; } void GDNativeLibraryEditor::_item_edited() { @@ -74,11 +101,11 @@ void GDNativeLibraryEditor::_item_edited() { Vector<String> enabled_paths; if (ProjectSettings::get_singleton()->has("gdnative/singletons")) { - enabled_paths=ProjectSettings::get_singleton()->get("gdnative/singletons"); + enabled_paths = ProjectSettings::get_singleton()->get("gdnative/singletons"); } if (enabled) { - if (enabled_paths.find(path)==-1) { + if (enabled_paths.find(path) == -1) { enabled_paths.push_back(path); } } else { @@ -86,15 +113,15 @@ void GDNativeLibraryEditor::_item_edited() { } if (enabled_paths.size()) { - ProjectSettings::get_singleton()->set("gdnative/singletons",enabled_paths); + ProjectSettings::get_singleton()->set("gdnative/singletons", enabled_paths); } else { - ProjectSettings::get_singleton()->set("gdnative/singletons",Variant()); + ProjectSettings::get_singleton()->set("gdnative/singletons", Variant()); } } void GDNativeLibraryEditor::_notification(int p_what) { - if (p_what==NOTIFICATION_VISIBILITY_CHANGED) { + if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { if (is_visible_in_tree()) { _update_libraries(); } @@ -103,18 +130,19 @@ void GDNativeLibraryEditor::_notification(int p_what) { void GDNativeLibraryEditor::_bind_methods() { - ClassDB::bind_method(D_METHOD("_item_edited"),&GDNativeLibraryEditor::_item_edited); + ClassDB::bind_method(D_METHOD("_item_edited"), &GDNativeLibraryEditor::_item_edited); } -GDNativeLibraryEditor::GDNativeLibraryEditor() -{ - libraries = memnew( Tree ); +GDNativeLibraryEditor::GDNativeLibraryEditor() { + libraries = memnew(Tree); libraries->set_columns(2); libraries->set_column_titles_visible(true); - libraries->set_column_title(0,TTR("Library")); - libraries->set_column_title(1,TTR("Status")); + libraries->set_column_title(0, TTR("Library")); + libraries->set_column_title(1, TTR("Status")); libraries->set_hide_root(true); - add_margin_child(TTR("Libraries: "),libraries,true); - updating=false; - libraries->connect("item_edited",this,"_item_edited"); + add_margin_child(TTR("Libraries: "), libraries, true); + updating = false; + libraries->connect("item_edited", this, "_item_edited"); } + +#endif // TOOLS_ENABLED diff --git a/modules/gdnative/gd_native_library_editor.h b/modules/gdnative/gd_native_library_editor.h index a6c8f31790..a11c4620dd 100644 --- a/modules/gdnative/gd_native_library_editor.h +++ b/modules/gdnative/gd_native_library_editor.h @@ -1,23 +1,52 @@ +/*************************************************************************/ +/* gd_native_library_editor.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #ifndef GD_NATIVE_LIBRARY_EDITOR_H #define GD_NATIVE_LIBRARY_EDITOR_H #ifdef TOOLS_ENABLED -#include "editor/project_settings_editor.h" #include "editor/editor_file_system.h" +#include "editor/project_settings_editor.h" -class GDNativeLibraryEditor : public VBoxContainer -{ +class GDNativeLibraryEditor : public VBoxContainer { Tree *libraries; bool updating; void _update_libraries(); - void _find_gdnative_singletons(EditorFileSystemDirectory *p_dir,const Set<String>& enabled_list); + void _find_gdnative_singletons(EditorFileSystemDirectory *p_dir, const Set<String> &enabled_list); void _item_edited(); -protected: +protected: void _notification(int p_what); static void _bind_methods(); + public: GDNativeLibraryEditor(); }; diff --git a/modules/gdnative/gdnative.cpp b/modules/gdnative/gdnative.cpp index 6da538844a..8cc8b0bec8 100644 --- a/modules/gdnative/gdnative.cpp +++ b/modules/gdnative/gdnative.cpp @@ -40,6 +40,16 @@ const String init_symbol = "godot_gdnative_init"; const String terminate_symbol = "godot_gdnative_terminate"; +#define GDAPI_FUNC(name, ret_type, ...) .name = name, +#define GDAPI_FUNC_VOID(name, ...) .name = name, + +const godot_gdnative_api_struct api_struct = { + GODOT_GDNATIVE_API_FUNCTIONS +}; + +#undef GDAPI_FUNC +#undef GDAPI_FUNC_VOID + String GDNativeLibrary::platform_names[NUM_PLATFORMS + 1] = { "X11_32bit", "X11_64bit", @@ -91,7 +101,7 @@ GDNativeLibrary::Platform GDNativeLibrary::current_platform = #endif GDNativeLibrary::GDNativeLibrary() - : library_paths() { + : library_paths(), singleton_gdnative(false) { } GDNativeLibrary::~GDNativeLibrary() { @@ -249,6 +259,7 @@ bool GDNative::initialize() { godot_gdnative_init_options options; + options.api_struct = &api_struct; options.in_editor = Engine::get_singleton()->is_editor_hint(); options.core_api_hash = ClassDB::get_api_hash(ClassDB::API_CORE); options.editor_api_hash = ClassDB::get_api_hash(ClassDB::API_EDITOR); diff --git a/modules/gdnative/gdnative.h b/modules/gdnative/gdnative.h index 4753c7efe5..29c6201641 100644 --- a/modules/gdnative/gdnative.h +++ b/modules/gdnative/gdnative.h @@ -36,6 +36,7 @@ #include "resource.h" #include "gdnative/gdnative.h" +#include "gdnative_api_struct.h" class GDNativeLibrary : public Resource { GDCLASS(GDNativeLibrary, Resource) @@ -77,7 +78,7 @@ class GDNativeLibrary : public Resource { String library_paths[NUM_PLATFORMS]; - bool singleton_gdnative = false; + bool singleton_gdnative; protected: bool _set(const StringName &p_name, const Variant &p_value); diff --git a/modules/gdnative/include/gdnative/gdnative.h b/modules/gdnative/include/gdnative/gdnative.h index c574c56d5a..04dca6f56d 100644 --- a/modules/gdnative/include/gdnative/gdnative.h +++ b/modules/gdnative/include/gdnative/gdnative.h @@ -234,7 +234,10 @@ void GDAPI godot_method_bind_ptrcall(godot_method_bind *p_method_bind, godot_obj godot_variant GDAPI godot_method_bind_call(godot_method_bind *p_method_bind, godot_object *p_instance, const godot_variant **p_args, const int p_arg_count, godot_variant_call_error *p_call_error); ////// Script API +struct godot_gdnative_api_struct; // Forward declaration + typedef struct { + const struct godot_gdnative_api_struct *api_struct; godot_bool in_editor; uint64_t core_api_hash; uint64_t editor_api_hash; diff --git a/modules/gdnative/include/gdnative_api_struct.h b/modules/gdnative/include/gdnative_api_struct.h new file mode 100644 index 0000000000..cfebeb08cc --- /dev/null +++ b/modules/gdnative/include/gdnative_api_struct.h @@ -0,0 +1,723 @@ +/*************************************************************************/ +/* gdnative_api_struct.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ +#ifndef GODOT_GDNATIVE_API_STRUCT_H +#define GODOT_GDNATIVE_API_STRUCT_H + +#include <gdnative/gdnative.h> +#include <nativescript/godot_nativescript.h> + +#ifdef __cplusplus +extern "C" { +#endif + +// Using X_MACRO to keep api function signatures in a single list +#define GODOT_GDNATIVE_API_FUNCTIONS \ + GDAPI_FUNC_VOID(godot_color_new_rgba, godot_color *r_dest, const godot_real p_r, const godot_real p_g, const godot_real p_b, const godot_real p_a) \ + GDAPI_FUNC_VOID(godot_color_new_rgb, godot_color *r_dest, const godot_real p_r, const godot_real p_g, const godot_real p_b) \ + GDAPI_FUNC(godot_color_get_r, godot_real, const godot_color *p_self) \ + GDAPI_FUNC_VOID(godot_color_set_r, godot_color *p_self, const godot_real r) \ + GDAPI_FUNC(godot_color_get_g, godot_real, const godot_color *p_self) \ + GDAPI_FUNC_VOID(godot_color_set_g, godot_color *p_self, const godot_real g) \ + GDAPI_FUNC(godot_color_get_b, godot_real, const godot_color *p_self) \ + GDAPI_FUNC_VOID(godot_color_set_b, godot_color *p_self, const godot_real b) \ + GDAPI_FUNC(godot_color_get_a, godot_real, const godot_color *p_self) \ + GDAPI_FUNC_VOID(godot_color_set_a, godot_color *p_self, const godot_real a) \ + GDAPI_FUNC(godot_color_get_h, godot_real, const godot_color *p_self) \ + GDAPI_FUNC(godot_color_get_s, godot_real, const godot_color *p_self) \ + GDAPI_FUNC(godot_color_get_v, godot_real, const godot_color *p_self) \ + GDAPI_FUNC(godot_color_as_string, godot_string, const godot_color *p_self) \ + GDAPI_FUNC(godot_color_to_rgba32, godot_int, const godot_color *p_self) \ + GDAPI_FUNC(godot_color_to_argb32, godot_int, const godot_color *p_self) \ + GDAPI_FUNC(godot_color_gray, godot_real, const godot_color *p_self) \ + GDAPI_FUNC(godot_color_inverted, godot_color, const godot_color *p_self) \ + GDAPI_FUNC(godot_color_contrasted, godot_color, const godot_color *p_self) \ + GDAPI_FUNC(godot_color_linear_interpolate, godot_color, const godot_color *p_self, const godot_color *p_b, const godot_real p_t) \ + GDAPI_FUNC(godot_color_blend, godot_color, const godot_color *p_self, const godot_color *p_over) \ + GDAPI_FUNC(godot_color_to_html, godot_string, const godot_color *p_self, const godot_bool p_with_alpha) \ + GDAPI_FUNC(godot_color_operator_equal, godot_bool, const godot_color *p_self, const godot_color *p_b) \ + GDAPI_FUNC(godot_color_operator_less, godot_bool, const godot_color *p_self, const godot_color *p_b) \ + GDAPI_FUNC_VOID(godot_vector2_new, godot_vector2 *r_dest, const godot_real p_x, const godot_real p_y) \ + GDAPI_FUNC(godot_vector2_as_string, godot_string, const godot_vector2 *p_self) \ + GDAPI_FUNC(godot_vector2_normalized, godot_vector2, const godot_vector2 *p_self) \ + GDAPI_FUNC(godot_vector2_length, godot_real, const godot_vector2 *p_self) \ + GDAPI_FUNC(godot_vector2_angle, godot_real, const godot_vector2 *p_self) \ + GDAPI_FUNC(godot_vector2_length_squared, godot_real, const godot_vector2 *p_self) \ + GDAPI_FUNC(godot_vector2_is_normalized, godot_bool, const godot_vector2 *p_self) \ + GDAPI_FUNC(godot_vector2_distance_to, godot_real, const godot_vector2 *p_self, const godot_vector2 *p_to) \ + GDAPI_FUNC(godot_vector2_distance_squared_to, godot_real, const godot_vector2 *p_self, const godot_vector2 *p_to) \ + GDAPI_FUNC(godot_vector2_angle_to, godot_real, const godot_vector2 *p_self, const godot_vector2 *p_to) \ + GDAPI_FUNC(godot_vector2_angle_to_point, godot_real, const godot_vector2 *p_self, const godot_vector2 *p_to) \ + GDAPI_FUNC(godot_vector2_linear_interpolate, godot_vector2, const godot_vector2 *p_self, const godot_vector2 *p_b, const godot_real p_t) \ + GDAPI_FUNC(godot_vector2_cubic_interpolate, godot_vector2, const godot_vector2 *p_self, const godot_vector2 *p_b, const godot_vector2 *p_pre_a, const godot_vector2 *p_post_b, const godot_real p_t) \ + GDAPI_FUNC(godot_vector2_rotated, godot_vector2, const godot_vector2 *p_self, const godot_real p_phi) \ + GDAPI_FUNC(godot_vector2_tangent, godot_vector2, const godot_vector2 *p_self) \ + GDAPI_FUNC(godot_vector2_floor, godot_vector2, const godot_vector2 *p_self) \ + GDAPI_FUNC(godot_vector2_snapped, godot_vector2, const godot_vector2 *p_self, const godot_vector2 *p_by) \ + GDAPI_FUNC(godot_vector2_aspect, godot_real, const godot_vector2 *p_self) \ + GDAPI_FUNC(godot_vector2_dot, godot_real, const godot_vector2 *p_self, const godot_vector2 *p_with) \ + GDAPI_FUNC(godot_vector2_slide, godot_vector2, const godot_vector2 *p_self, const godot_vector2 *p_n) \ + GDAPI_FUNC(godot_vector2_bounce, godot_vector2, const godot_vector2 *p_self, const godot_vector2 *p_n) \ + GDAPI_FUNC(godot_vector2_reflect, godot_vector2, const godot_vector2 *p_self, const godot_vector2 *p_n) \ + GDAPI_FUNC(godot_vector2_abs, godot_vector2, const godot_vector2 *p_self) \ + GDAPI_FUNC(godot_vector2_clamped, godot_vector2, const godot_vector2 *p_self, const godot_real p_length) \ + GDAPI_FUNC(godot_vector2_operator_add, godot_vector2, const godot_vector2 *p_self, const godot_vector2 *p_b) \ + GDAPI_FUNC(godot_vector2_operator_substract, godot_vector2, const godot_vector2 *p_self, const godot_vector2 *p_b) \ + GDAPI_FUNC(godot_vector2_operator_multiply_vector, godot_vector2, const godot_vector2 *p_self, const godot_vector2 *p_b) \ + GDAPI_FUNC(godot_vector2_operator_multiply_scalar, godot_vector2, const godot_vector2 *p_self, const godot_real p_b) \ + GDAPI_FUNC(godot_vector2_operator_divide_vector, godot_vector2, const godot_vector2 *p_self, const godot_vector2 *p_b) \ + GDAPI_FUNC(godot_vector2_operator_divide_scalar, godot_vector2, const godot_vector2 *p_self, const godot_real p_b) \ + GDAPI_FUNC(godot_vector2_operator_equal, godot_bool, const godot_vector2 *p_self, const godot_vector2 *p_b) \ + GDAPI_FUNC(godot_vector2_operator_less, godot_bool, const godot_vector2 *p_self, const godot_vector2 *p_b) \ + GDAPI_FUNC(godot_vector2_operator_neg, godot_vector2, const godot_vector2 *p_self) \ + GDAPI_FUNC_VOID(godot_vector2_set_x, godot_vector2 *p_self, const godot_real p_x) \ + GDAPI_FUNC_VOID(godot_vector2_set_y, godot_vector2 *p_self, const godot_real p_y) \ + GDAPI_FUNC(godot_vector2_get_x, godot_real, const godot_vector2 *p_self) \ + GDAPI_FUNC(godot_vector2_get_y, godot_real, const godot_vector2 *p_self) \ + GDAPI_FUNC_VOID(godot_quat_new, godot_quat *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_z, const godot_real p_w) \ + GDAPI_FUNC_VOID(godot_quat_new_with_axis_angle, godot_quat *r_dest, const godot_vector3 *p_axis, const godot_real p_angle) \ + GDAPI_FUNC(godot_quat_get_x, godot_real, const godot_quat *p_self) \ + GDAPI_FUNC_VOID(godot_quat_set_x, godot_quat *p_self, const godot_real val) \ + GDAPI_FUNC(godot_quat_get_y, godot_real, const godot_quat *p_self) \ + GDAPI_FUNC_VOID(godot_quat_set_y, godot_quat *p_self, const godot_real val) \ + GDAPI_FUNC(godot_quat_get_z, godot_real, const godot_quat *p_self) \ + GDAPI_FUNC_VOID(godot_quat_set_z, godot_quat *p_self, const godot_real val) \ + GDAPI_FUNC(godot_quat_get_w, godot_real, const godot_quat *p_self) \ + GDAPI_FUNC_VOID(godot_quat_set_w, godot_quat *p_self, const godot_real val) \ + GDAPI_FUNC(godot_quat_as_string, godot_string, const godot_quat *p_self) \ + GDAPI_FUNC(godot_quat_length, godot_real, const godot_quat *p_self) \ + GDAPI_FUNC(godot_quat_length_squared, godot_real, const godot_quat *p_self) \ + GDAPI_FUNC(godot_quat_normalized, godot_quat, const godot_quat *p_self) \ + GDAPI_FUNC(godot_quat_is_normalized, godot_bool, const godot_quat *p_self) \ + GDAPI_FUNC(godot_quat_inverse, godot_quat, const godot_quat *p_self) \ + GDAPI_FUNC(godot_quat_dot, godot_real, const godot_quat *p_self, const godot_quat *p_b) \ + GDAPI_FUNC(godot_quat_xform, godot_vector3, const godot_quat *p_self, const godot_vector3 *p_v) \ + GDAPI_FUNC(godot_quat_slerp, godot_quat, const godot_quat *p_self, const godot_quat *p_b, const godot_real p_t) \ + GDAPI_FUNC(godot_quat_slerpni, godot_quat, const godot_quat *p_self, const godot_quat *p_b, const godot_real p_t) \ + GDAPI_FUNC(godot_quat_cubic_slerp, godot_quat, const godot_quat *p_self, const godot_quat *p_b, const godot_quat *p_pre_a, const godot_quat *p_post_b, const godot_real p_t) \ + GDAPI_FUNC(godot_quat_operator_multiply, godot_quat, const godot_quat *p_self, const godot_real p_b) \ + GDAPI_FUNC(godot_quat_operator_add, godot_quat, const godot_quat *p_self, const godot_quat *p_b) \ + GDAPI_FUNC(godot_quat_operator_substract, godot_quat, const godot_quat *p_self, const godot_quat *p_b) \ + GDAPI_FUNC(godot_quat_operator_divide, godot_quat, const godot_quat *p_self, const godot_real p_b) \ + GDAPI_FUNC(godot_quat_operator_equal, godot_bool, const godot_quat *p_self, const godot_quat *p_b) \ + GDAPI_FUNC(godot_quat_operator_neg, godot_quat, const godot_quat *p_self) \ + GDAPI_FUNC_VOID(godot_basis_new_with_rows, godot_basis *r_dest, const godot_vector3 *p_x_axis, const godot_vector3 *p_y_axis, const godot_vector3 *p_z_axis) \ + GDAPI_FUNC_VOID(godot_basis_new_with_axis_and_angle, godot_basis *r_dest, const godot_vector3 *p_axis, const godot_real p_phi) \ + GDAPI_FUNC_VOID(godot_basis_new_with_euler, godot_basis *r_dest, const godot_vector3 *p_euler) \ + GDAPI_FUNC(godot_basis_as_string, godot_string, const godot_basis *p_self) \ + GDAPI_FUNC(godot_basis_inverse, godot_basis, const godot_basis *p_self) \ + GDAPI_FUNC(godot_basis_transposed, godot_basis, const godot_basis *p_self) \ + GDAPI_FUNC(godot_basis_orthonormalized, godot_basis, const godot_basis *p_self) \ + GDAPI_FUNC(godot_basis_determinant, godot_real, const godot_basis *p_self) \ + GDAPI_FUNC(godot_basis_rotated, godot_basis, const godot_basis *p_self, const godot_vector3 *p_axis, const godot_real p_phi) \ + GDAPI_FUNC(godot_basis_scaled, godot_basis, const godot_basis *p_self, const godot_vector3 *p_scale) \ + GDAPI_FUNC(godot_basis_get_scale, godot_vector3, const godot_basis *p_self) \ + GDAPI_FUNC(godot_basis_get_euler, godot_vector3, const godot_basis *p_self) \ + GDAPI_FUNC(godot_basis_tdotx, godot_real, const godot_basis *p_self, const godot_vector3 *p_with) \ + GDAPI_FUNC(godot_basis_tdoty, godot_real, const godot_basis *p_self, const godot_vector3 *p_with) \ + GDAPI_FUNC(godot_basis_tdotz, godot_real, const godot_basis *p_self, const godot_vector3 *p_with) \ + GDAPI_FUNC(godot_basis_xform, godot_vector3, const godot_basis *p_self, const godot_vector3 *p_v) \ + GDAPI_FUNC(godot_basis_xform_inv, godot_vector3, const godot_basis *p_self, const godot_vector3 *p_v) \ + GDAPI_FUNC(godot_basis_get_orthogonal_index, godot_int, const godot_basis *p_self) \ + GDAPI_FUNC_VOID(godot_basis_new, godot_basis *r_dest) \ + GDAPI_FUNC_VOID(godot_basis_new_with_euler_quat, godot_basis *r_dest, const godot_quat *p_euler) \ + GDAPI_FUNC_VOID(godot_basis_get_elements, godot_basis *p_self, godot_vector3 *p_elements) \ + GDAPI_FUNC(godot_basis_get_axis, godot_vector3, const godot_basis *p_self, const godot_int p_axis) \ + GDAPI_FUNC_VOID(godot_basis_set_axis, godot_basis *p_self, const godot_int p_axis, const godot_vector3 *p_value) \ + GDAPI_FUNC(godot_basis_get_row, godot_vector3, const godot_basis *p_self, const godot_int p_row) \ + GDAPI_FUNC_VOID(godot_basis_set_row, godot_basis *p_self, const godot_int p_row, const godot_vector3 *p_value) \ + GDAPI_FUNC(godot_basis_operator_equal, godot_bool, const godot_basis *p_self, const godot_basis *p_b) \ + GDAPI_FUNC(godot_basis_operator_add, godot_basis, const godot_basis *p_self, const godot_basis *p_b) \ + GDAPI_FUNC(godot_basis_operator_substract, godot_basis, const godot_basis *p_self, const godot_basis *p_b) \ + GDAPI_FUNC(godot_basis_operator_multiply_vector, godot_basis, const godot_basis *p_self, const godot_basis *p_b) \ + GDAPI_FUNC(godot_basis_operator_multiply_scalar, godot_basis, const godot_basis *p_self, const godot_real p_b) \ + GDAPI_FUNC_VOID(godot_vector3_new, godot_vector3 *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_z) \ + GDAPI_FUNC(godot_vector3_as_string, godot_string, const godot_vector3 *p_self) \ + GDAPI_FUNC(godot_vector3_min_axis, godot_int, const godot_vector3 *p_self) \ + GDAPI_FUNC(godot_vector3_max_axis, godot_int, const godot_vector3 *p_self) \ + GDAPI_FUNC(godot_vector3_length, godot_real, const godot_vector3 *p_self) \ + GDAPI_FUNC(godot_vector3_length_squared, godot_real, const godot_vector3 *p_self) \ + GDAPI_FUNC(godot_vector3_is_normalized, godot_bool, const godot_vector3 *p_self) \ + GDAPI_FUNC(godot_vector3_normalized, godot_vector3, const godot_vector3 *p_self) \ + GDAPI_FUNC(godot_vector3_inverse, godot_vector3, const godot_vector3 *p_self) \ + GDAPI_FUNC(godot_vector3_snapped, godot_vector3, const godot_vector3 *p_self, const godot_vector3 *p_by) \ + GDAPI_FUNC(godot_vector3_rotated, godot_vector3, const godot_vector3 *p_self, const godot_vector3 *p_axis, const godot_real p_phi) \ + GDAPI_FUNC(godot_vector3_linear_interpolate, godot_vector3, const godot_vector3 *p_self, const godot_vector3 *p_b, const godot_real p_t) \ + GDAPI_FUNC(godot_vector3_cubic_interpolate, godot_vector3, const godot_vector3 *p_self, const godot_vector3 *p_b, const godot_vector3 *p_pre_a, const godot_vector3 *p_post_b, const godot_real p_t) \ + GDAPI_FUNC(godot_vector3_dot, godot_real, const godot_vector3 *p_self, const godot_vector3 *p_b) \ + GDAPI_FUNC(godot_vector3_cross, godot_vector3, const godot_vector3 *p_self, const godot_vector3 *p_b) \ + GDAPI_FUNC(godot_vector3_outer, godot_basis, const godot_vector3 *p_self, const godot_vector3 *p_b) \ + GDAPI_FUNC(godot_vector3_to_diagonal_matrix, godot_basis, const godot_vector3 *p_self) \ + GDAPI_FUNC(godot_vector3_abs, godot_vector3, const godot_vector3 *p_self) \ + GDAPI_FUNC(godot_vector3_floor, godot_vector3, const godot_vector3 *p_self) \ + GDAPI_FUNC(godot_vector3_ceil, godot_vector3, const godot_vector3 *p_self) \ + GDAPI_FUNC(godot_vector3_distance_to, godot_real, const godot_vector3 *p_self, const godot_vector3 *p_b) \ + GDAPI_FUNC(godot_vector3_distance_squared_to, godot_real, const godot_vector3 *p_self, const godot_vector3 *p_b) \ + GDAPI_FUNC(godot_vector3_angle_to, godot_real, const godot_vector3 *p_self, const godot_vector3 *p_to) \ + GDAPI_FUNC(godot_vector3_slide, godot_vector3, const godot_vector3 *p_self, const godot_vector3 *p_n) \ + GDAPI_FUNC(godot_vector3_bounce, godot_vector3, const godot_vector3 *p_self, const godot_vector3 *p_n) \ + GDAPI_FUNC(godot_vector3_reflect, godot_vector3, const godot_vector3 *p_self, const godot_vector3 *p_n) \ + GDAPI_FUNC(godot_vector3_operator_add, godot_vector3, const godot_vector3 *p_self, const godot_vector3 *p_b) \ + GDAPI_FUNC(godot_vector3_operator_substract, godot_vector3, const godot_vector3 *p_self, const godot_vector3 *p_b) \ + GDAPI_FUNC(godot_vector3_operator_multiply_vector, godot_vector3, const godot_vector3 *p_self, const godot_vector3 *p_b) \ + GDAPI_FUNC(godot_vector3_operator_multiply_scalar, godot_vector3, const godot_vector3 *p_self, const godot_real p_b) \ + GDAPI_FUNC(godot_vector3_operator_divide_vector, godot_vector3, const godot_vector3 *p_self, const godot_vector3 *p_b) \ + GDAPI_FUNC(godot_vector3_operator_divide_scalar, godot_vector3, const godot_vector3 *p_self, const godot_real p_b) \ + GDAPI_FUNC(godot_vector3_operator_equal, godot_bool, const godot_vector3 *p_self, const godot_vector3 *p_b) \ + GDAPI_FUNC(godot_vector3_operator_less, godot_bool, const godot_vector3 *p_self, const godot_vector3 *p_b) \ + GDAPI_FUNC(godot_vector3_operator_neg, godot_vector3, const godot_vector3 *p_self) \ + GDAPI_FUNC_VOID(godot_vector3_set_axis, godot_vector3 *p_self, const godot_vector3_axis p_axis, const godot_real p_val) \ + GDAPI_FUNC(godot_vector3_get_axis, godot_real, const godot_vector3 *p_self, const godot_vector3_axis p_axis) \ + GDAPI_FUNC_VOID(godot_pool_byte_array_new, godot_pool_byte_array *r_dest) \ + GDAPI_FUNC_VOID(godot_pool_byte_array_new_copy, godot_pool_byte_array *r_dest, const godot_pool_byte_array *p_src) \ + GDAPI_FUNC_VOID(godot_pool_byte_array_new_with_array, godot_pool_byte_array *r_dest, const godot_array *p_a) \ + GDAPI_FUNC_VOID(godot_pool_byte_array_append, godot_pool_byte_array *p_self, const uint8_t p_data) \ + GDAPI_FUNC_VOID(godot_pool_byte_array_append_array, godot_pool_byte_array *p_self, const godot_pool_byte_array *p_array) \ + GDAPI_FUNC(godot_pool_byte_array_insert, godot_error, godot_pool_byte_array *p_self, const godot_int p_idx, const uint8_t p_data) \ + GDAPI_FUNC_VOID(godot_pool_byte_array_invert, godot_pool_byte_array *p_self) \ + GDAPI_FUNC_VOID(godot_pool_byte_array_push_back, godot_pool_byte_array *p_self, const uint8_t p_data) \ + GDAPI_FUNC_VOID(godot_pool_byte_array_remove, godot_pool_byte_array *p_self, const godot_int p_idx) \ + GDAPI_FUNC_VOID(godot_pool_byte_array_resize, godot_pool_byte_array *p_self, const godot_int p_size) \ + GDAPI_FUNC_VOID(godot_pool_byte_array_set, godot_pool_byte_array *p_self, const godot_int p_idx, const uint8_t p_data) \ + GDAPI_FUNC(godot_pool_byte_array_get, uint8_t, const godot_pool_byte_array *p_self, const godot_int p_idx) \ + GDAPI_FUNC(godot_pool_byte_array_size, godot_int, const godot_pool_byte_array *p_self) \ + GDAPI_FUNC_VOID(godot_pool_byte_array_destroy, godot_pool_byte_array *p_self) \ + GDAPI_FUNC_VOID(godot_pool_int_array_new, godot_pool_int_array *r_dest) \ + GDAPI_FUNC_VOID(godot_pool_int_array_new_copy, godot_pool_int_array *r_dest, const godot_pool_int_array *p_src) \ + GDAPI_FUNC_VOID(godot_pool_int_array_new_with_array, godot_pool_int_array *r_dest, const godot_array *p_a) \ + GDAPI_FUNC_VOID(godot_pool_int_array_append, godot_pool_int_array *p_self, const godot_int p_data) \ + GDAPI_FUNC_VOID(godot_pool_int_array_append_array, godot_pool_int_array *p_self, const godot_pool_int_array *p_array) \ + GDAPI_FUNC(godot_pool_int_array_insert, godot_error, godot_pool_int_array *p_self, const godot_int p_idx, const godot_int p_data) \ + GDAPI_FUNC_VOID(godot_pool_int_array_invert, godot_pool_int_array *p_self) \ + GDAPI_FUNC_VOID(godot_pool_int_array_push_back, godot_pool_int_array *p_self, const godot_int p_data) \ + GDAPI_FUNC_VOID(godot_pool_int_array_remove, godot_pool_int_array *p_self, const godot_int p_idx) \ + GDAPI_FUNC_VOID(godot_pool_int_array_resize, godot_pool_int_array *p_self, const godot_int p_size) \ + GDAPI_FUNC_VOID(godot_pool_int_array_set, godot_pool_int_array *p_self, const godot_int p_idx, const godot_int p_data) \ + GDAPI_FUNC(godot_pool_int_array_get, godot_int, const godot_pool_int_array *p_self, const godot_int p_idx) \ + GDAPI_FUNC(godot_pool_int_array_size, godot_int, const godot_pool_int_array *p_self) \ + GDAPI_FUNC_VOID(godot_pool_int_array_destroy, godot_pool_int_array *p_self) \ + GDAPI_FUNC_VOID(godot_pool_real_array_new, godot_pool_real_array *r_dest) \ + GDAPI_FUNC_VOID(godot_pool_real_array_new_copy, godot_pool_real_array *r_dest, const godot_pool_real_array *p_src) \ + GDAPI_FUNC_VOID(godot_pool_real_array_new_with_array, godot_pool_real_array *r_dest, const godot_array *p_a) \ + GDAPI_FUNC_VOID(godot_pool_real_array_append, godot_pool_real_array *p_self, const godot_real p_data) \ + GDAPI_FUNC_VOID(godot_pool_real_array_append_array, godot_pool_real_array *p_self, const godot_pool_real_array *p_array) \ + GDAPI_FUNC(godot_pool_real_array_insert, godot_error, godot_pool_real_array *p_self, const godot_int p_idx, const godot_real p_data) \ + GDAPI_FUNC_VOID(godot_pool_real_array_invert, godot_pool_real_array *p_self) \ + GDAPI_FUNC_VOID(godot_pool_real_array_push_back, godot_pool_real_array *p_self, const godot_real p_data) \ + GDAPI_FUNC_VOID(godot_pool_real_array_remove, godot_pool_real_array *p_self, const godot_int p_idx) \ + GDAPI_FUNC_VOID(godot_pool_real_array_resize, godot_pool_real_array *p_self, const godot_int p_size) \ + GDAPI_FUNC_VOID(godot_pool_real_array_set, godot_pool_real_array *p_self, const godot_int p_idx, const godot_real p_data) \ + GDAPI_FUNC(godot_pool_real_array_get, godot_real, const godot_pool_real_array *p_self, const godot_int p_idx) \ + GDAPI_FUNC(godot_pool_real_array_size, godot_int, const godot_pool_real_array *p_self) \ + GDAPI_FUNC_VOID(godot_pool_real_array_destroy, godot_pool_real_array *p_self) \ + GDAPI_FUNC_VOID(godot_pool_string_array_new, godot_pool_string_array *r_dest) \ + GDAPI_FUNC_VOID(godot_pool_string_array_new_copy, godot_pool_string_array *r_dest, const godot_pool_string_array *p_src) \ + GDAPI_FUNC_VOID(godot_pool_string_array_new_with_array, godot_pool_string_array *r_dest, const godot_array *p_a) \ + GDAPI_FUNC_VOID(godot_pool_string_array_append, godot_pool_string_array *p_self, const godot_string *p_data) \ + GDAPI_FUNC_VOID(godot_pool_string_array_append_array, godot_pool_string_array *p_self, const godot_pool_string_array *p_array) \ + GDAPI_FUNC(godot_pool_string_array_insert, godot_error, godot_pool_string_array *p_self, const godot_int p_idx, const godot_string *p_data) \ + GDAPI_FUNC_VOID(godot_pool_string_array_invert, godot_pool_string_array *p_self) \ + GDAPI_FUNC_VOID(godot_pool_string_array_push_back, godot_pool_string_array *p_self, const godot_string *p_data) \ + GDAPI_FUNC_VOID(godot_pool_string_array_remove, godot_pool_string_array *p_self, const godot_int p_idx) \ + GDAPI_FUNC_VOID(godot_pool_string_array_resize, godot_pool_string_array *p_self, const godot_int p_size) \ + GDAPI_FUNC_VOID(godot_pool_string_array_set, godot_pool_string_array *p_self, const godot_int p_idx, const godot_string *p_data) \ + GDAPI_FUNC(godot_pool_string_array_get, godot_string, const godot_pool_string_array *p_self, const godot_int p_idx) \ + GDAPI_FUNC(godot_pool_string_array_size, godot_int, const godot_pool_string_array *p_self) \ + GDAPI_FUNC_VOID(godot_pool_string_array_destroy, godot_pool_string_array *p_self) \ + GDAPI_FUNC_VOID(godot_pool_vector2_array_new, godot_pool_vector2_array *r_dest) \ + GDAPI_FUNC_VOID(godot_pool_vector2_array_new_copy, godot_pool_vector2_array *r_dest, const godot_pool_vector2_array *p_src) \ + GDAPI_FUNC_VOID(godot_pool_vector2_array_new_with_array, godot_pool_vector2_array *r_dest, const godot_array *p_a) \ + GDAPI_FUNC_VOID(godot_pool_vector2_array_append, godot_pool_vector2_array *p_self, const godot_vector2 *p_data) \ + GDAPI_FUNC_VOID(godot_pool_vector2_array_append_array, godot_pool_vector2_array *p_self, const godot_pool_vector2_array *p_array) \ + GDAPI_FUNC(godot_pool_vector2_array_insert, godot_error, godot_pool_vector2_array *p_self, const godot_int p_idx, const godot_vector2 *p_data) \ + GDAPI_FUNC_VOID(godot_pool_vector2_array_invert, godot_pool_vector2_array *p_self) \ + GDAPI_FUNC_VOID(godot_pool_vector2_array_push_back, godot_pool_vector2_array *p_self, const godot_vector2 *p_data) \ + GDAPI_FUNC_VOID(godot_pool_vector2_array_remove, godot_pool_vector2_array *p_self, const godot_int p_idx) \ + GDAPI_FUNC_VOID(godot_pool_vector2_array_resize, godot_pool_vector2_array *p_self, const godot_int p_size) \ + GDAPI_FUNC_VOID(godot_pool_vector2_array_set, godot_pool_vector2_array *p_self, const godot_int p_idx, const godot_vector2 *p_data) \ + GDAPI_FUNC(godot_pool_vector2_array_get, godot_vector2, const godot_pool_vector2_array *p_self, const godot_int p_idx) \ + GDAPI_FUNC(godot_pool_vector2_array_size, godot_int, const godot_pool_vector2_array *p_self) \ + GDAPI_FUNC_VOID(godot_pool_vector2_array_destroy, godot_pool_vector2_array *p_self) \ + GDAPI_FUNC_VOID(godot_pool_vector3_array_new, godot_pool_vector3_array *r_dest) \ + GDAPI_FUNC_VOID(godot_pool_vector3_array_new_copy, godot_pool_vector3_array *r_dest, const godot_pool_vector3_array *p_src) \ + GDAPI_FUNC_VOID(godot_pool_vector3_array_new_with_array, godot_pool_vector3_array *r_dest, const godot_array *p_a) \ + GDAPI_FUNC_VOID(godot_pool_vector3_array_append, godot_pool_vector3_array *p_self, const godot_vector3 *p_data) \ + GDAPI_FUNC_VOID(godot_pool_vector3_array_append_array, godot_pool_vector3_array *p_self, const godot_pool_vector3_array *p_array) \ + GDAPI_FUNC(godot_pool_vector3_array_insert, godot_error, godot_pool_vector3_array *p_self, const godot_int p_idx, const godot_vector3 *p_data) \ + GDAPI_FUNC_VOID(godot_pool_vector3_array_invert, godot_pool_vector3_array *p_self) \ + GDAPI_FUNC_VOID(godot_pool_vector3_array_push_back, godot_pool_vector3_array *p_self, const godot_vector3 *p_data) \ + GDAPI_FUNC_VOID(godot_pool_vector3_array_remove, godot_pool_vector3_array *p_self, const godot_int p_idx) \ + GDAPI_FUNC_VOID(godot_pool_vector3_array_resize, godot_pool_vector3_array *p_self, const godot_int p_size) \ + GDAPI_FUNC_VOID(godot_pool_vector3_array_set, godot_pool_vector3_array *p_self, const godot_int p_idx, const godot_vector3 *p_data) \ + GDAPI_FUNC(godot_pool_vector3_array_get, godot_vector3, const godot_pool_vector3_array *p_self, const godot_int p_idx) \ + GDAPI_FUNC(godot_pool_vector3_array_size, godot_int, const godot_pool_vector3_array *p_self) \ + GDAPI_FUNC_VOID(godot_pool_vector3_array_destroy, godot_pool_vector3_array *p_self) \ + GDAPI_FUNC_VOID(godot_pool_color_array_new, godot_pool_color_array *r_dest) \ + GDAPI_FUNC_VOID(godot_pool_color_array_new_copy, godot_pool_color_array *r_dest, const godot_pool_color_array *p_src) \ + GDAPI_FUNC_VOID(godot_pool_color_array_new_with_array, godot_pool_color_array *r_dest, const godot_array *p_a) \ + GDAPI_FUNC_VOID(godot_pool_color_array_append, godot_pool_color_array *p_self, const godot_color *p_data) \ + GDAPI_FUNC_VOID(godot_pool_color_array_append_array, godot_pool_color_array *p_self, const godot_pool_color_array *p_array) \ + GDAPI_FUNC(godot_pool_color_array_insert, godot_error, godot_pool_color_array *p_self, const godot_int p_idx, const godot_color *p_data) \ + GDAPI_FUNC_VOID(godot_pool_color_array_invert, godot_pool_color_array *p_self) \ + GDAPI_FUNC_VOID(godot_pool_color_array_push_back, godot_pool_color_array *p_self, const godot_color *p_data) \ + GDAPI_FUNC_VOID(godot_pool_color_array_remove, godot_pool_color_array *p_self, const godot_int p_idx) \ + GDAPI_FUNC_VOID(godot_pool_color_array_resize, godot_pool_color_array *p_self, const godot_int p_size) \ + GDAPI_FUNC_VOID(godot_pool_color_array_set, godot_pool_color_array *p_self, const godot_int p_idx, const godot_color *p_data) \ + GDAPI_FUNC(godot_pool_color_array_get, godot_color, const godot_pool_color_array *p_self, const godot_int p_idx) \ + GDAPI_FUNC(godot_pool_color_array_size, godot_int, const godot_pool_color_array *p_self) \ + GDAPI_FUNC_VOID(godot_pool_color_array_destroy, godot_pool_color_array *p_self) \ + GDAPI_FUNC_VOID(godot_array_new, godot_array *r_dest) \ + GDAPI_FUNC_VOID(godot_array_new_copy, godot_array *r_dest, const godot_array *p_src) \ + GDAPI_FUNC_VOID(godot_array_new_pool_color_array, godot_array *r_dest, const godot_pool_color_array *p_pca) \ + GDAPI_FUNC_VOID(godot_array_new_pool_vector3_array, godot_array *r_dest, const godot_pool_vector3_array *p_pv3a) \ + GDAPI_FUNC_VOID(godot_array_new_pool_vector2_array, godot_array *r_dest, const godot_pool_vector2_array *p_pv2a) \ + GDAPI_FUNC_VOID(godot_array_new_pool_string_array, godot_array *r_dest, const godot_pool_string_array *p_psa) \ + GDAPI_FUNC_VOID(godot_array_new_pool_real_array, godot_array *r_dest, const godot_pool_real_array *p_pra) \ + GDAPI_FUNC_VOID(godot_array_new_pool_int_array, godot_array *r_dest, const godot_pool_int_array *p_pia) \ + GDAPI_FUNC_VOID(godot_array_new_pool_byte_array, godot_array *r_dest, const godot_pool_byte_array *p_pba) \ + GDAPI_FUNC_VOID(godot_array_set, godot_array *p_self, const godot_int p_idx, const godot_variant *p_value) \ + GDAPI_FUNC(godot_array_get, godot_variant, const godot_array *p_self, const godot_int p_idx) \ + GDAPI_FUNC(godot_array_operator_index, godot_variant *, godot_array *p_self, const godot_int p_idx) \ + GDAPI_FUNC_VOID(godot_array_append, godot_array *p_self, const godot_variant *p_value) \ + GDAPI_FUNC_VOID(godot_array_clear, godot_array *p_self) \ + GDAPI_FUNC(godot_array_count, godot_int, const godot_array *p_self, const godot_variant *p_value) \ + GDAPI_FUNC(godot_array_empty, godot_bool, const godot_array *p_self) \ + GDAPI_FUNC_VOID(godot_array_erase, godot_array *p_self, const godot_variant *p_value) \ + GDAPI_FUNC(godot_array_front, godot_variant, const godot_array *p_self) \ + GDAPI_FUNC(godot_array_back, godot_variant, const godot_array *p_self) \ + GDAPI_FUNC(godot_array_find, godot_int, const godot_array *p_self, const godot_variant *p_what, const godot_int p_from) \ + GDAPI_FUNC(godot_array_find_last, godot_int, const godot_array *p_self, const godot_variant *p_what) \ + GDAPI_FUNC(godot_array_has, godot_bool, const godot_array *p_self, const godot_variant *p_value) \ + GDAPI_FUNC(godot_array_hash, godot_int, const godot_array *p_self) \ + GDAPI_FUNC_VOID(godot_array_insert, godot_array *p_self, const godot_int p_pos, const godot_variant *p_value) \ + GDAPI_FUNC_VOID(godot_array_invert, godot_array *p_self) \ + GDAPI_FUNC(godot_array_pop_back, godot_variant, godot_array *p_self) \ + GDAPI_FUNC(godot_array_pop_front, godot_variant, godot_array *p_self) \ + GDAPI_FUNC_VOID(godot_array_push_back, godot_array *p_self, const godot_variant *p_value) \ + GDAPI_FUNC_VOID(godot_array_push_front, godot_array *p_self, const godot_variant *p_value) \ + GDAPI_FUNC_VOID(godot_array_remove, godot_array *p_self, const godot_int p_idx) \ + GDAPI_FUNC_VOID(godot_array_resize, godot_array *p_self, const godot_int p_size) \ + GDAPI_FUNC(godot_array_rfind, godot_int, const godot_array *p_self, const godot_variant *p_what, const godot_int p_from) \ + GDAPI_FUNC(godot_array_size, godot_int, const godot_array *p_self) \ + GDAPI_FUNC_VOID(godot_array_sort, godot_array *p_self) \ + GDAPI_FUNC_VOID(godot_array_sort_custom, godot_array *p_self, godot_object *p_obj, const godot_string *p_func) \ + GDAPI_FUNC_VOID(godot_array_destroy, godot_array *p_self) \ + GDAPI_FUNC_VOID(godot_dictionary_new, godot_dictionary *r_dest) \ + GDAPI_FUNC_VOID(godot_dictionary_new_copy, godot_dictionary *r_dest, const godot_dictionary *p_src) \ + GDAPI_FUNC_VOID(godot_dictionary_destroy, godot_dictionary *p_self) \ + GDAPI_FUNC(godot_dictionary_size, godot_int, const godot_dictionary *p_self) \ + GDAPI_FUNC(godot_dictionary_empty, godot_bool, const godot_dictionary *p_self) \ + GDAPI_FUNC_VOID(godot_dictionary_clear, godot_dictionary *p_self) \ + GDAPI_FUNC(godot_dictionary_has, godot_bool, const godot_dictionary *p_self, const godot_variant *p_key) \ + GDAPI_FUNC(godot_dictionary_has_all, godot_bool, const godot_dictionary *p_self, const godot_array *p_keys) \ + GDAPI_FUNC_VOID(godot_dictionary_erase, godot_dictionary *p_self, const godot_variant *p_key) \ + GDAPI_FUNC(godot_dictionary_hash, godot_int, const godot_dictionary *p_self) \ + GDAPI_FUNC(godot_dictionary_keys, godot_array, const godot_dictionary *p_self) \ + GDAPI_FUNC(godot_dictionary_values, godot_array, const godot_dictionary *p_self) \ + GDAPI_FUNC(godot_dictionary_get, godot_variant, const godot_dictionary *p_self, const godot_variant *p_key) \ + GDAPI_FUNC_VOID(godot_dictionary_set, godot_dictionary *p_self, const godot_variant *p_key, const godot_variant *p_value) \ + GDAPI_FUNC(godot_dictionary_operator_index, godot_variant *, godot_dictionary *p_self, const godot_variant *p_key) \ + GDAPI_FUNC(godot_dictionary_next, godot_variant *, const godot_dictionary *p_self, const godot_variant *p_key) \ + GDAPI_FUNC(godot_dictionary_operator_equal, godot_bool, const godot_dictionary *p_self, const godot_dictionary *p_b) \ + GDAPI_FUNC(godot_dictionary_to_json, godot_string, const godot_dictionary *p_self) \ + GDAPI_FUNC_VOID(godot_node_path_new, godot_node_path *r_dest, const godot_string *p_from) \ + GDAPI_FUNC_VOID(godot_node_path_new_copy, godot_node_path *r_dest, const godot_node_path *p_src) \ + GDAPI_FUNC_VOID(godot_node_path_destroy, godot_node_path *p_self) \ + GDAPI_FUNC(godot_node_path_as_string, godot_string, const godot_node_path *p_self) \ + GDAPI_FUNC(godot_node_path_is_absolute, godot_bool, const godot_node_path *p_self) \ + GDAPI_FUNC(godot_node_path_get_name_count, godot_int, const godot_node_path *p_self) \ + GDAPI_FUNC(godot_node_path_get_name, godot_string, const godot_node_path *p_self, const godot_int p_idx) \ + GDAPI_FUNC(godot_node_path_get_subname_count, godot_int, const godot_node_path *p_self) \ + GDAPI_FUNC(godot_node_path_get_subname, godot_string, const godot_node_path *p_self, const godot_int p_idx) \ + GDAPI_FUNC(godot_node_path_get_property, godot_string, const godot_node_path *p_self) \ + GDAPI_FUNC(godot_node_path_is_empty, godot_bool, const godot_node_path *p_self) \ + GDAPI_FUNC(godot_node_path_operator_equal, godot_bool, const godot_node_path *p_self, const godot_node_path *p_b) \ + GDAPI_FUNC_VOID(godot_plane_new_with_reals, godot_plane *r_dest, const godot_real p_a, const godot_real p_b, const godot_real p_c, const godot_real p_d) \ + GDAPI_FUNC_VOID(godot_plane_new_with_vectors, godot_plane *r_dest, const godot_vector3 *p_v1, const godot_vector3 *p_v2, const godot_vector3 *p_v3) \ + GDAPI_FUNC_VOID(godot_plane_new_with_normal, godot_plane *r_dest, const godot_vector3 *p_normal, const godot_real p_d) \ + GDAPI_FUNC(godot_plane_as_string, godot_string, const godot_plane *p_self) \ + GDAPI_FUNC(godot_plane_normalized, godot_plane, const godot_plane *p_self) \ + GDAPI_FUNC(godot_plane_center, godot_vector3, const godot_plane *p_self) \ + GDAPI_FUNC(godot_plane_get_any_point, godot_vector3, const godot_plane *p_self) \ + GDAPI_FUNC(godot_plane_is_point_over, godot_bool, const godot_plane *p_self, const godot_vector3 *p_point) \ + GDAPI_FUNC(godot_plane_distance_to, godot_real, const godot_plane *p_self, const godot_vector3 *p_point) \ + GDAPI_FUNC(godot_plane_has_point, godot_bool, const godot_plane *p_self, const godot_vector3 *p_point, const godot_real p_epsilon) \ + GDAPI_FUNC(godot_plane_project, godot_vector3, const godot_plane *p_self, const godot_vector3 *p_point) \ + GDAPI_FUNC(godot_plane_intersect_3, godot_bool, const godot_plane *p_self, godot_vector3 *r_dest, const godot_plane *p_b, const godot_plane *p_c) \ + GDAPI_FUNC(godot_plane_intersects_ray, godot_bool, const godot_plane *p_self, godot_vector3 *r_dest, const godot_vector3 *p_from, const godot_vector3 *p_dir) \ + GDAPI_FUNC(godot_plane_intersects_segment, godot_bool, const godot_plane *p_self, godot_vector3 *r_dest, const godot_vector3 *p_begin, const godot_vector3 *p_end) \ + GDAPI_FUNC(godot_plane_operator_neg, godot_plane, const godot_plane *p_self) \ + GDAPI_FUNC(godot_plane_operator_equal, godot_bool, const godot_plane *p_self, const godot_plane *p_b) \ + GDAPI_FUNC_VOID(godot_plane_set_normal, godot_plane *p_self, const godot_vector3 *p_normal) \ + GDAPI_FUNC(godot_plane_get_normal, godot_vector3, const godot_plane *p_self) \ + GDAPI_FUNC(godot_plane_get_d, godot_real, const godot_plane *p_self) \ + GDAPI_FUNC_VOID(godot_plane_set_d, godot_plane *p_self, const godot_real p_d) \ + GDAPI_FUNC_VOID(godot_rect2_new_with_position_and_size, godot_rect2 *r_dest, const godot_vector2 *p_pos, const godot_vector2 *p_size) \ + GDAPI_FUNC_VOID(godot_rect2_new, godot_rect2 *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_width, const godot_real p_height) \ + GDAPI_FUNC(godot_rect2_as_string, godot_string, const godot_rect2 *p_self) \ + GDAPI_FUNC(godot_rect2_get_area, godot_real, const godot_rect2 *p_self) \ + GDAPI_FUNC(godot_rect2_intersects, godot_bool, const godot_rect2 *p_self, const godot_rect2 *p_b) \ + GDAPI_FUNC(godot_rect2_encloses, godot_bool, const godot_rect2 *p_self, const godot_rect2 *p_b) \ + GDAPI_FUNC(godot_rect2_has_no_area, godot_bool, const godot_rect2 *p_self) \ + GDAPI_FUNC(godot_rect2_clip, godot_rect2, const godot_rect2 *p_self, const godot_rect2 *p_b) \ + GDAPI_FUNC(godot_rect2_merge, godot_rect2, const godot_rect2 *p_self, const godot_rect2 *p_b) \ + GDAPI_FUNC(godot_rect2_has_point, godot_bool, const godot_rect2 *p_self, const godot_vector2 *p_point) \ + GDAPI_FUNC(godot_rect2_grow, godot_rect2, const godot_rect2 *p_self, const godot_real p_by) \ + GDAPI_FUNC(godot_rect2_expand, godot_rect2, const godot_rect2 *p_self, const godot_vector2 *p_to) \ + GDAPI_FUNC(godot_rect2_operator_equal, godot_bool, const godot_rect2 *p_self, const godot_rect2 *p_b) \ + GDAPI_FUNC(godot_rect2_get_position, godot_vector2, const godot_rect2 *p_self) \ + GDAPI_FUNC(godot_rect2_get_size, godot_vector2, const godot_rect2 *p_self) \ + GDAPI_FUNC_VOID(godot_rect2_set_position, godot_rect2 *p_self, const godot_vector2 *p_pos) \ + GDAPI_FUNC_VOID(godot_rect2_set_size, godot_rect2 *p_self, const godot_vector2 *p_size) \ + GDAPI_FUNC_VOID(godot_rect3_new, godot_rect3 *r_dest, const godot_vector3 *p_pos, const godot_vector3 *p_size) \ + GDAPI_FUNC(godot_rect3_get_position, godot_vector3, const godot_rect3 *p_self) \ + GDAPI_FUNC_VOID(godot_rect3_set_position, const godot_rect3 *p_self, const godot_vector3 *p_v) \ + GDAPI_FUNC(godot_rect3_get_size, godot_vector3, const godot_rect3 *p_self) \ + GDAPI_FUNC_VOID(godot_rect3_set_size, const godot_rect3 *p_self, const godot_vector3 *p_v) \ + GDAPI_FUNC(godot_rect3_as_string, godot_string, const godot_rect3 *p_self) \ + GDAPI_FUNC(godot_rect3_get_area, godot_real, const godot_rect3 *p_self) \ + GDAPI_FUNC(godot_rect3_has_no_area, godot_bool, const godot_rect3 *p_self) \ + GDAPI_FUNC(godot_rect3_has_no_surface, godot_bool, const godot_rect3 *p_self) \ + GDAPI_FUNC(godot_rect3_intersects, godot_bool, const godot_rect3 *p_self, const godot_rect3 *p_with) \ + GDAPI_FUNC(godot_rect3_encloses, godot_bool, const godot_rect3 *p_self, const godot_rect3 *p_with) \ + GDAPI_FUNC(godot_rect3_merge, godot_rect3, const godot_rect3 *p_self, const godot_rect3 *p_with) \ + GDAPI_FUNC(godot_rect3_intersection, godot_rect3, const godot_rect3 *p_self, const godot_rect3 *p_with) \ + GDAPI_FUNC(godot_rect3_intersects_plane, godot_bool, const godot_rect3 *p_self, const godot_plane *p_plane) \ + GDAPI_FUNC(godot_rect3_intersects_segment, godot_bool, const godot_rect3 *p_self, const godot_vector3 *p_from, const godot_vector3 *p_to) \ + GDAPI_FUNC(godot_rect3_has_point, godot_bool, const godot_rect3 *p_self, const godot_vector3 *p_point) \ + GDAPI_FUNC(godot_rect3_get_support, godot_vector3, const godot_rect3 *p_self, const godot_vector3 *p_dir) \ + GDAPI_FUNC(godot_rect3_get_longest_axis, godot_vector3, const godot_rect3 *p_self) \ + GDAPI_FUNC(godot_rect3_get_longest_axis_index, godot_int, const godot_rect3 *p_self) \ + GDAPI_FUNC(godot_rect3_get_longest_axis_size, godot_real, const godot_rect3 *p_self) \ + GDAPI_FUNC(godot_rect3_get_shortest_axis, godot_vector3, const godot_rect3 *p_self) \ + GDAPI_FUNC(godot_rect3_get_shortest_axis_index, godot_int, const godot_rect3 *p_self) \ + GDAPI_FUNC(godot_rect3_get_shortest_axis_size, godot_real, const godot_rect3 *p_self) \ + GDAPI_FUNC(godot_rect3_expand, godot_rect3, const godot_rect3 *p_self, const godot_vector3 *p_to_point) \ + GDAPI_FUNC(godot_rect3_grow, godot_rect3, const godot_rect3 *p_self, const godot_real p_by) \ + GDAPI_FUNC(godot_rect3_get_endpoint, godot_vector3, const godot_rect3 *p_self, const godot_int p_idx) \ + GDAPI_FUNC(godot_rect3_operator_equal, godot_bool, const godot_rect3 *p_self, const godot_rect3 *p_b) \ + GDAPI_FUNC_VOID(godot_rid_new, godot_rid *r_dest) \ + GDAPI_FUNC(godot_rid_get_id, godot_int, const godot_rid *p_self) \ + GDAPI_FUNC_VOID(godot_rid_new_with_resource, godot_rid *r_dest, const godot_object *p_from) \ + GDAPI_FUNC(godot_rid_operator_equal, godot_bool, const godot_rid *p_self, const godot_rid *p_b) \ + GDAPI_FUNC(godot_rid_operator_less, godot_bool, const godot_rid *p_self, const godot_rid *p_b) \ + GDAPI_FUNC_VOID(godot_transform_new_with_axis_origin, godot_transform *r_dest, const godot_vector3 *p_x_axis, const godot_vector3 *p_y_axis, const godot_vector3 *p_z_axis, const godot_vector3 *p_origin) \ + GDAPI_FUNC_VOID(godot_transform_new, godot_transform *r_dest, const godot_basis *p_basis, const godot_vector3 *p_origin) \ + GDAPI_FUNC(godot_transform_get_basis, godot_basis, const godot_transform *p_self) \ + GDAPI_FUNC_VOID(godot_transform_set_basis, godot_transform *p_self, godot_basis *p_v) \ + GDAPI_FUNC(godot_transform_get_origin, godot_vector3, const godot_transform *p_self) \ + GDAPI_FUNC_VOID(godot_transform_set_origin, godot_transform *p_self, godot_vector3 *p_v) \ + GDAPI_FUNC(godot_transform_as_string, godot_string, const godot_transform *p_self) \ + GDAPI_FUNC(godot_transform_inverse, godot_transform, const godot_transform *p_self) \ + GDAPI_FUNC(godot_transform_affine_inverse, godot_transform, const godot_transform *p_self) \ + GDAPI_FUNC(godot_transform_orthonormalized, godot_transform, const godot_transform *p_self) \ + GDAPI_FUNC(godot_transform_rotated, godot_transform, const godot_transform *p_self, const godot_vector3 *p_axis, const godot_real p_phi) \ + GDAPI_FUNC(godot_transform_scaled, godot_transform, const godot_transform *p_self, const godot_vector3 *p_scale) \ + GDAPI_FUNC(godot_transform_translated, godot_transform, const godot_transform *p_self, const godot_vector3 *p_ofs) \ + GDAPI_FUNC(godot_transform_looking_at, godot_transform, const godot_transform *p_self, const godot_vector3 *p_target, const godot_vector3 *p_up) \ + GDAPI_FUNC(godot_transform_xform_plane, godot_plane, const godot_transform *p_self, const godot_plane *p_v) \ + GDAPI_FUNC(godot_transform_xform_inv_plane, godot_plane, const godot_transform *p_self, const godot_plane *p_v) \ + GDAPI_FUNC_VOID(godot_transform_new_identity, godot_transform *r_dest) \ + GDAPI_FUNC(godot_transform_operator_equal, godot_bool, const godot_transform *p_self, const godot_transform *p_b) \ + GDAPI_FUNC(godot_transform_operator_multiply, godot_transform, const godot_transform *p_self, const godot_transform *p_b) \ + GDAPI_FUNC(godot_transform_xform_vector3, godot_vector3, const godot_transform *p_self, const godot_vector3 *p_v) \ + GDAPI_FUNC(godot_transform_xform_inv_vector3, godot_vector3, const godot_transform *p_self, const godot_vector3 *p_v) \ + GDAPI_FUNC(godot_transform_xform_rect3, godot_rect3, const godot_transform *p_self, const godot_rect3 *p_v) \ + GDAPI_FUNC(godot_transform_xform_inv_rect3, godot_rect3, const godot_transform *p_self, const godot_rect3 *p_v) \ + GDAPI_FUNC_VOID(godot_transform2d_new, godot_transform2d *r_dest, const godot_real p_rot, const godot_vector2 *p_pos) \ + GDAPI_FUNC_VOID(godot_transform2d_new_axis_origin, godot_transform2d *r_dest, const godot_vector2 *p_x_axis, const godot_vector2 *p_y_axis, const godot_vector2 *p_origin) \ + GDAPI_FUNC(godot_transform2d_as_string, godot_string, const godot_transform2d *p_self) \ + GDAPI_FUNC(godot_transform2d_inverse, godot_transform2d, const godot_transform2d *p_self) \ + GDAPI_FUNC(godot_transform2d_affine_inverse, godot_transform2d, const godot_transform2d *p_self) \ + GDAPI_FUNC(godot_transform2d_get_rotation, godot_real, const godot_transform2d *p_self) \ + GDAPI_FUNC(godot_transform2d_get_origin, godot_vector2, const godot_transform2d *p_self) \ + GDAPI_FUNC(godot_transform2d_get_scale, godot_vector2, const godot_transform2d *p_self) \ + GDAPI_FUNC(godot_transform2d_orthonormalized, godot_transform2d, const godot_transform2d *p_self) \ + GDAPI_FUNC(godot_transform2d_rotated, godot_transform2d, const godot_transform2d *p_self, const godot_real p_phi) \ + GDAPI_FUNC(godot_transform2d_scaled, godot_transform2d, const godot_transform2d *p_self, const godot_vector2 *p_scale) \ + GDAPI_FUNC(godot_transform2d_translated, godot_transform2d, const godot_transform2d *p_self, const godot_vector2 *p_offset) \ + GDAPI_FUNC(godot_transform2d_xform_vector2, godot_vector2, const godot_transform2d *p_self, const godot_vector2 *p_v) \ + GDAPI_FUNC(godot_transform2d_xform_inv_vector2, godot_vector2, const godot_transform2d *p_self, const godot_vector2 *p_v) \ + GDAPI_FUNC(godot_transform2d_basis_xform_vector2, godot_vector2, const godot_transform2d *p_self, const godot_vector2 *p_v) \ + GDAPI_FUNC(godot_transform2d_basis_xform_inv_vector2, godot_vector2, const godot_transform2d *p_self, const godot_vector2 *p_v) \ + GDAPI_FUNC(godot_transform2d_interpolate_with, godot_transform2d, const godot_transform2d *p_self, const godot_transform2d *p_m, const godot_real p_c) \ + GDAPI_FUNC(godot_transform2d_operator_equal, godot_bool, const godot_transform2d *p_self, const godot_transform2d *p_b) \ + GDAPI_FUNC(godot_transform2d_operator_multiply, godot_transform2d, const godot_transform2d *p_self, const godot_transform2d *p_b) \ + GDAPI_FUNC_VOID(godot_transform2d_new_identity, godot_transform2d *r_dest) \ + GDAPI_FUNC(godot_transform2d_xform_rect2, godot_rect2, const godot_transform2d *p_self, const godot_rect2 *p_v) \ + GDAPI_FUNC(godot_transform2d_xform_inv_rect2, godot_rect2, const godot_transform2d *p_self, const godot_rect2 *p_v) \ + GDAPI_FUNC(godot_variant_get_type, godot_variant_type, const godot_variant *p_v) \ + GDAPI_FUNC_VOID(godot_variant_new_copy, godot_variant *r_dest, const godot_variant *p_src) \ + GDAPI_FUNC_VOID(godot_variant_new_nil, godot_variant *r_dest) \ + GDAPI_FUNC_VOID(godot_variant_new_bool, godot_variant *p_v, const godot_bool p_b) \ + GDAPI_FUNC_VOID(godot_variant_new_uint, godot_variant *r_dest, const uint64_t p_i) \ + GDAPI_FUNC_VOID(godot_variant_new_int, godot_variant *r_dest, const int64_t p_i) \ + GDAPI_FUNC_VOID(godot_variant_new_real, godot_variant *r_dest, const double p_r) \ + GDAPI_FUNC_VOID(godot_variant_new_string, godot_variant *r_dest, const godot_string *p_s) \ + GDAPI_FUNC_VOID(godot_variant_new_vector2, godot_variant *r_dest, const godot_vector2 *p_v2) \ + GDAPI_FUNC_VOID(godot_variant_new_rect2, godot_variant *r_dest, const godot_rect2 *p_rect2) \ + GDAPI_FUNC_VOID(godot_variant_new_vector3, godot_variant *r_dest, const godot_vector3 *p_v3) \ + GDAPI_FUNC_VOID(godot_variant_new_transform2d, godot_variant *r_dest, const godot_transform2d *p_t2d) \ + GDAPI_FUNC_VOID(godot_variant_new_plane, godot_variant *r_dest, const godot_plane *p_plane) \ + GDAPI_FUNC_VOID(godot_variant_new_quat, godot_variant *r_dest, const godot_quat *p_quat) \ + GDAPI_FUNC_VOID(godot_variant_new_rect3, godot_variant *r_dest, const godot_rect3 *p_rect3) \ + GDAPI_FUNC_VOID(godot_variant_new_basis, godot_variant *r_dest, const godot_basis *p_basis) \ + GDAPI_FUNC_VOID(godot_variant_new_transform, godot_variant *r_dest, const godot_transform *p_trans) \ + GDAPI_FUNC_VOID(godot_variant_new_color, godot_variant *r_dest, const godot_color *p_color) \ + GDAPI_FUNC_VOID(godot_variant_new_node_path, godot_variant *r_dest, const godot_node_path *p_np) \ + GDAPI_FUNC_VOID(godot_variant_new_rid, godot_variant *r_dest, const godot_rid *p_rid) \ + GDAPI_FUNC_VOID(godot_variant_new_object, godot_variant *r_dest, const godot_object *p_obj) \ + GDAPI_FUNC_VOID(godot_variant_new_dictionary, godot_variant *r_dest, const godot_dictionary *p_dict) \ + GDAPI_FUNC_VOID(godot_variant_new_array, godot_variant *r_dest, const godot_array *p_arr) \ + GDAPI_FUNC_VOID(godot_variant_new_pool_byte_array, godot_variant *r_dest, const godot_pool_byte_array *p_pba) \ + GDAPI_FUNC_VOID(godot_variant_new_pool_int_array, godot_variant *r_dest, const godot_pool_int_array *p_pia) \ + GDAPI_FUNC_VOID(godot_variant_new_pool_real_array, godot_variant *r_dest, const godot_pool_real_array *p_pra) \ + GDAPI_FUNC_VOID(godot_variant_new_pool_string_array, godot_variant *r_dest, const godot_pool_string_array *p_psa) \ + GDAPI_FUNC_VOID(godot_variant_new_pool_vector2_array, godot_variant *r_dest, const godot_pool_vector2_array *p_pv2a) \ + GDAPI_FUNC_VOID(godot_variant_new_pool_vector3_array, godot_variant *r_dest, const godot_pool_vector3_array *p_pv3a) \ + GDAPI_FUNC_VOID(godot_variant_new_pool_color_array, godot_variant *r_dest, const godot_pool_color_array *p_pca) \ + GDAPI_FUNC(godot_variant_as_bool, godot_bool, const godot_variant *p_self) \ + GDAPI_FUNC(godot_variant_as_uint, uint64_t, const godot_variant *p_self) \ + GDAPI_FUNC(godot_variant_as_int, int64_t, const godot_variant *p_self) \ + GDAPI_FUNC(godot_variant_as_real, double, const godot_variant *p_self) \ + GDAPI_FUNC(godot_variant_as_string, godot_string, const godot_variant *p_self) \ + GDAPI_FUNC(godot_variant_as_vector2, godot_vector2, const godot_variant *p_self) \ + GDAPI_FUNC(godot_variant_as_rect2, godot_rect2, const godot_variant *p_self) \ + GDAPI_FUNC(godot_variant_as_vector3, godot_vector3, const godot_variant *p_self) \ + GDAPI_FUNC(godot_variant_as_transform2d, godot_transform2d, const godot_variant *p_self) \ + GDAPI_FUNC(godot_variant_as_plane, godot_plane, const godot_variant *p_self) \ + GDAPI_FUNC(godot_variant_as_quat, godot_quat, const godot_variant *p_self) \ + GDAPI_FUNC(godot_variant_as_rect3, godot_rect3, const godot_variant *p_self) \ + GDAPI_FUNC(godot_variant_as_basis, godot_basis, const godot_variant *p_self) \ + GDAPI_FUNC(godot_variant_as_transform, godot_transform, const godot_variant *p_self) \ + GDAPI_FUNC(godot_variant_as_color, godot_color, const godot_variant *p_self) \ + GDAPI_FUNC(godot_variant_as_node_path, godot_node_path, const godot_variant *p_self) \ + GDAPI_FUNC(godot_variant_as_rid, godot_rid, const godot_variant *p_self) \ + GDAPI_FUNC(godot_variant_as_object, godot_object *, const godot_variant *p_self) \ + GDAPI_FUNC(godot_variant_as_dictionary, godot_dictionary, const godot_variant *p_self) \ + GDAPI_FUNC(godot_variant_as_array, godot_array, const godot_variant *p_self) \ + GDAPI_FUNC(godot_variant_as_pool_byte_array, godot_pool_byte_array, const godot_variant *p_self) \ + GDAPI_FUNC(godot_variant_as_pool_int_array, godot_pool_int_array, const godot_variant *p_self) \ + GDAPI_FUNC(godot_variant_as_pool_real_array, godot_pool_real_array, const godot_variant *p_self) \ + GDAPI_FUNC(godot_variant_as_pool_string_array, godot_pool_string_array, const godot_variant *p_self) \ + GDAPI_FUNC(godot_variant_as_pool_vector2_array, godot_pool_vector2_array, const godot_variant *p_self) \ + GDAPI_FUNC(godot_variant_as_pool_vector3_array, godot_pool_vector3_array, const godot_variant *p_self) \ + GDAPI_FUNC(godot_variant_as_pool_color_array, godot_pool_color_array, const godot_variant *p_self) \ + GDAPI_FUNC(godot_variant_call, godot_variant, godot_variant *p_self, const godot_string *p_method, const godot_variant **p_args, const godot_int p_argcount, godot_variant_call_error *r_error) \ + GDAPI_FUNC(godot_variant_has_method, godot_bool, const godot_variant *p_self, const godot_string *p_method) \ + GDAPI_FUNC(godot_variant_operator_equal, godot_bool, const godot_variant *p_self, const godot_variant *p_other) \ + GDAPI_FUNC(godot_variant_operator_less, godot_bool, const godot_variant *p_self, const godot_variant *p_other) \ + GDAPI_FUNC(godot_variant_hash_compare, godot_bool, const godot_variant *p_self, const godot_variant *p_other) \ + GDAPI_FUNC(godot_variant_booleanize, godot_bool, const godot_variant *p_self, godot_bool *r_valid) \ + GDAPI_FUNC_VOID(godot_variant_destroy, godot_variant *p_self) \ + GDAPI_FUNC_VOID(godot_string_new, godot_string *r_dest) \ + GDAPI_FUNC_VOID(godot_string_new_copy, godot_string *r_dest, const godot_string *p_src) \ + GDAPI_FUNC_VOID(godot_string_new_data, godot_string *r_dest, const char *p_contents, const int p_size) \ + GDAPI_FUNC_VOID(godot_string_new_unicode_data, godot_string *r_dest, const wchar_t *p_contents, const int p_size) \ + GDAPI_FUNC_VOID(godot_string_get_data, const godot_string *p_self, char *p_dest, int *p_size) \ + GDAPI_FUNC(godot_string_operator_index, wchar_t *, godot_string *p_self, const godot_int p_idx) \ + GDAPI_FUNC(godot_string_c_str, const char *, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_unicode_str, const wchar_t *, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_operator_equal, godot_bool, const godot_string *p_self, const godot_string *p_b) \ + GDAPI_FUNC(godot_string_operator_less, godot_bool, const godot_string *p_self, const godot_string *p_b) \ + GDAPI_FUNC(godot_string_operator_plus, godot_string, const godot_string *p_self, const godot_string *p_b) \ + GDAPI_FUNC(godot_string_length, godot_int, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_begins_with, godot_bool, const godot_string *p_self, const godot_string *p_string) \ + GDAPI_FUNC(godot_string_begins_with_char_array, godot_bool, const godot_string *p_self, const char *p_char_array) \ + GDAPI_FUNC(godot_string_bigrams, godot_array, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_chr, godot_string, wchar_t p_character) \ + GDAPI_FUNC(godot_string_ends_with, godot_bool, const godot_string *p_self, const godot_string *p_string) \ + GDAPI_FUNC(godot_string_find, godot_int, const godot_string *p_self, godot_string p_what) \ + GDAPI_FUNC(godot_string_find_from, godot_int, const godot_string *p_self, godot_string p_what, godot_int p_from) \ + GDAPI_FUNC(godot_string_findmk, godot_int, const godot_string *p_self, const godot_array *p_keys) \ + GDAPI_FUNC(godot_string_findmk_from, godot_int, const godot_string *p_self, const godot_array *p_keys, godot_int p_from) \ + GDAPI_FUNC(godot_string_findmk_from_in_place, godot_int, const godot_string *p_self, const godot_array *p_keys, godot_int p_from, godot_int *r_key) \ + GDAPI_FUNC(godot_string_findn, godot_int, const godot_string *p_self, godot_string p_what) \ + GDAPI_FUNC(godot_string_findn_from, godot_int, const godot_string *p_self, godot_string p_what, godot_int p_from) \ + GDAPI_FUNC(godot_string_find_last, godot_int, const godot_string *p_self, godot_string p_what) \ + GDAPI_FUNC(godot_string_format, godot_string, const godot_string *p_self, const godot_variant *p_values) \ + GDAPI_FUNC(godot_string_format_with_custom_placeholder, godot_string, const godot_string *p_self, const godot_variant *p_values, const char *p_placeholder) \ + GDAPI_FUNC(godot_string_hex_encode_buffer, godot_string, const uint8_t *p_buffer, godot_int p_len) \ + GDAPI_FUNC(godot_string_hex_to_int, godot_int, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_hex_to_int_without_prefix, godot_int, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_insert, godot_string, const godot_string *p_self, godot_int p_at_pos, godot_string p_string) \ + GDAPI_FUNC(godot_string_is_numeric, godot_bool, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_is_subsequence_of, godot_bool, const godot_string *p_self, const godot_string *p_string) \ + GDAPI_FUNC(godot_string_is_subsequence_ofi, godot_bool, const godot_string *p_self, const godot_string *p_string) \ + GDAPI_FUNC(godot_string_lpad, godot_string, const godot_string *p_self, godot_int p_min_length) \ + GDAPI_FUNC(godot_string_lpad_with_custom_character, godot_string, const godot_string *p_self, godot_int p_min_length, const godot_string *p_character) \ + GDAPI_FUNC(godot_string_match, godot_bool, const godot_string *p_self, const godot_string *p_wildcard) \ + GDAPI_FUNC(godot_string_matchn, godot_bool, const godot_string *p_self, const godot_string *p_wildcard) \ + GDAPI_FUNC(godot_string_md5, godot_string, const uint8_t *p_md5) \ + GDAPI_FUNC(godot_string_num, godot_string, double p_num) \ + GDAPI_FUNC(godot_string_num_int64, godot_string, int64_t p_num, godot_int p_base) \ + GDAPI_FUNC(godot_string_num_int64_capitalized, godot_string, int64_t p_num, godot_int p_base, godot_bool p_capitalize_hex) \ + GDAPI_FUNC(godot_string_num_real, godot_string, double p_num) \ + GDAPI_FUNC(godot_string_num_scientific, godot_string, double p_num) \ + GDAPI_FUNC(godot_string_num_with_decimals, godot_string, double p_num, godot_int p_decimals) \ + GDAPI_FUNC(godot_string_pad_decimals, godot_string, const godot_string *p_self, godot_int p_digits) \ + GDAPI_FUNC(godot_string_pad_zeros, godot_string, const godot_string *p_self, godot_int p_digits) \ + GDAPI_FUNC(godot_string_replace_first, godot_string, const godot_string *p_self, godot_string p_key, godot_string p_with) \ + GDAPI_FUNC(godot_string_replace, godot_string, const godot_string *p_self, godot_string p_key, godot_string p_with) \ + GDAPI_FUNC(godot_string_replacen, godot_string, const godot_string *p_self, godot_string p_key, godot_string p_with) \ + GDAPI_FUNC(godot_string_rfind, godot_int, const godot_string *p_self, godot_string p_what) \ + GDAPI_FUNC(godot_string_rfindn, godot_int, const godot_string *p_self, godot_string p_what) \ + GDAPI_FUNC(godot_string_rfind_from, godot_int, const godot_string *p_self, godot_string p_what, godot_int p_from) \ + GDAPI_FUNC(godot_string_rfindn_from, godot_int, const godot_string *p_self, godot_string p_what, godot_int p_from) \ + GDAPI_FUNC(godot_string_rpad, godot_string, const godot_string *p_self, godot_int p_min_length) \ + GDAPI_FUNC(godot_string_rpad_with_custom_character, godot_string, const godot_string *p_self, godot_int p_min_length, const godot_string *p_character) \ + GDAPI_FUNC(godot_string_similarity, godot_real, const godot_string *p_self, const godot_string *p_string) \ + GDAPI_FUNC(godot_string_sprintf, godot_string, const godot_string *p_self, const godot_array *p_values, godot_bool *p_error) \ + GDAPI_FUNC(godot_string_substr, godot_string, const godot_string *p_self, godot_int p_from, godot_int p_chars) \ + GDAPI_FUNC(godot_string_to_double, double, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_to_float, godot_real, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_to_int, godot_int, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_camelcase_to_underscore, godot_string, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_camelcase_to_underscore_lowercased, godot_string, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_capitalize, godot_string, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_char_to_double, double, const char *p_what) \ + GDAPI_FUNC(godot_string_char_to_int, godot_int, const char *p_what) \ + GDAPI_FUNC(godot_string_wchar_to_int, int64_t, const wchar_t *p_str) \ + GDAPI_FUNC(godot_string_char_to_int_with_len, godot_int, const char *p_what, godot_int p_len) \ + GDAPI_FUNC(godot_string_char_to_int64_with_len, int64_t, const wchar_t *p_str, int p_len) \ + GDAPI_FUNC(godot_string_hex_to_int64, int64_t, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_hex_to_int64_with_prefix, int64_t, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_to_int64, int64_t, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_unicode_char_to_double, double, const wchar_t *p_str, const wchar_t **r_end) \ + GDAPI_FUNC(godot_string_get_slice_count, godot_int, const godot_string *p_self, godot_string p_splitter) \ + GDAPI_FUNC(godot_string_get_slice, godot_string, const godot_string *p_self, godot_string p_splitter, godot_int p_slice) \ + GDAPI_FUNC(godot_string_get_slicec, godot_string, const godot_string *p_self, wchar_t p_splitter, godot_int p_slice) \ + GDAPI_FUNC(godot_string_split, godot_array, const godot_string *p_self, const godot_string *p_splitter) \ + GDAPI_FUNC(godot_string_split_allow_empty, godot_array, const godot_string *p_self, const godot_string *p_splitter) \ + GDAPI_FUNC(godot_string_split_floats, godot_array, const godot_string *p_self, const godot_string *p_splitter) \ + GDAPI_FUNC(godot_string_split_floats_allows_empty, godot_array, const godot_string *p_self, const godot_string *p_splitter) \ + GDAPI_FUNC(godot_string_split_floats_mk, godot_array, const godot_string *p_self, const godot_array *p_splitters) \ + GDAPI_FUNC(godot_string_split_floats_mk_allows_empty, godot_array, const godot_string *p_self, const godot_array *p_splitters) \ + GDAPI_FUNC(godot_string_split_ints, godot_array, const godot_string *p_self, const godot_string *p_splitter) \ + GDAPI_FUNC(godot_string_split_ints_allows_empty, godot_array, const godot_string *p_self, const godot_string *p_splitter) \ + GDAPI_FUNC(godot_string_split_ints_mk, godot_array, const godot_string *p_self, const godot_array *p_splitters) \ + GDAPI_FUNC(godot_string_split_ints_mk_allows_empty, godot_array, const godot_string *p_self, const godot_array *p_splitters) \ + GDAPI_FUNC(godot_string_split_spaces, godot_array, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_char_lowercase, wchar_t, wchar_t p_char) \ + GDAPI_FUNC(godot_string_char_uppercase, wchar_t, wchar_t p_char) \ + GDAPI_FUNC(godot_string_to_lower, godot_string, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_to_upper, godot_string, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_get_basename, godot_string, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_get_extension, godot_string, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_left, godot_string, const godot_string *p_self, godot_int p_pos) \ + GDAPI_FUNC(godot_string_ord_at, wchar_t, const godot_string *p_self, godot_int p_idx) \ + GDAPI_FUNC(godot_string_plus_file, godot_string, const godot_string *p_self, const godot_string *p_file) \ + GDAPI_FUNC(godot_string_right, godot_string, const godot_string *p_self, godot_int p_pos) \ + GDAPI_FUNC(godot_string_strip_edges, godot_string, const godot_string *p_self, godot_bool p_left, godot_bool p_right) \ + GDAPI_FUNC(godot_string_strip_escapes, godot_string, const godot_string *p_self) \ + GDAPI_FUNC_VOID(godot_string_erase, godot_string *p_self, godot_int p_pos, godot_int p_chars) \ + GDAPI_FUNC_VOID(godot_string_ascii, godot_string *p_self, char *result) \ + GDAPI_FUNC_VOID(godot_string_ascii_extended, godot_string *p_self, char *result) \ + GDAPI_FUNC_VOID(godot_string_utf8, godot_string *p_self, char *result) \ + GDAPI_FUNC(godot_string_parse_utf8, godot_bool, godot_string *p_self, const char *p_utf8) \ + GDAPI_FUNC(godot_string_parse_utf8_with_len, godot_bool, godot_string *p_self, const char *p_utf8, godot_int p_len) \ + GDAPI_FUNC(godot_string_chars_to_utf8, godot_string, const char *p_utf8) \ + GDAPI_FUNC(godot_string_chars_to_utf8_with_len, godot_string, const char *p_utf8, godot_int p_len) \ + GDAPI_FUNC(godot_string_hash, uint32_t, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_hash64, uint64_t, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_hash_chars, uint32_t, const char *p_cstr) \ + GDAPI_FUNC(godot_string_hash_chars_with_len, uint32_t, const char *p_cstr, godot_int p_len) \ + GDAPI_FUNC(godot_string_hash_utf8_chars, uint32_t, const wchar_t *p_str) \ + GDAPI_FUNC(godot_string_hash_utf8_chars_with_len, uint32_t, const wchar_t *p_str, godot_int p_len) \ + GDAPI_FUNC(godot_string_md5_buffer, godot_pool_byte_array, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_md5_text, godot_string, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_sha256_buffer, godot_pool_byte_array, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_sha256_text, godot_string, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_empty, godot_bool, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_get_base_dir, godot_string, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_get_file, godot_string, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_humanize_size, godot_string, size_t p_size) \ + GDAPI_FUNC(godot_string_is_abs_path, godot_bool, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_is_rel_path, godot_bool, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_is_resource_file, godot_bool, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_path_to, godot_string, const godot_string *p_self, const godot_string *p_path) \ + GDAPI_FUNC(godot_string_path_to_file, godot_string, const godot_string *p_self, const godot_string *p_path) \ + GDAPI_FUNC(godot_string_simplify_path, godot_string, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_c_escape, godot_string, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_c_escape_multiline, godot_string, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_c_unescape, godot_string, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_http_escape, godot_string, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_http_unescape, godot_string, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_json_escape, godot_string, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_word_wrap, godot_string, const godot_string *p_self, godot_int p_chars_per_line) \ + GDAPI_FUNC(godot_string_xml_escape, godot_string, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_xml_escape_with_quotes, godot_string, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_xml_unescape, godot_string, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_percent_decode, godot_string, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_percent_encode, godot_string, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_is_valid_float, godot_bool, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_is_valid_hex_number, godot_bool, const godot_string *p_self, godot_bool p_with_prefix) \ + GDAPI_FUNC(godot_string_is_valid_html_color, godot_bool, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_is_valid_identifier, godot_bool, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_is_valid_integer, godot_bool, const godot_string *p_self) \ + GDAPI_FUNC(godot_string_is_valid_ip_address, godot_bool, const godot_string *p_self) \ + GDAPI_FUNC_VOID(godot_string_destroy, godot_string *p_self) \ + GDAPI_FUNC_VOID(godot_object_destroy, godot_object *p_o) \ + GDAPI_FUNC(godot_global_get_singleton, godot_object *, char *p_name) \ + GDAPI_FUNC(godot_get_stack_bottom, void *) \ + GDAPI_FUNC(godot_method_bind_get_method, godot_method_bind *, const char *p_classname, const char *p_methodname) \ + GDAPI_FUNC_VOID(godot_method_bind_ptrcall, godot_method_bind *p_method_bind, godot_object *p_instance, const void **p_args, void *p_ret) \ + GDAPI_FUNC(godot_method_bind_call, godot_variant, godot_method_bind *p_method_bind, godot_object *p_instance, const godot_variant **p_args, const int p_arg_count, godot_variant_call_error *p_call_error) \ + GDAPI_FUNC(godot_get_class_constructor, godot_class_constructor, const char *p_classname) \ + GDAPI_FUNC(godot_get_global_constants, godot_dictionary) \ + GDAPI_FUNC(godot_alloc, void *, int p_bytes) \ + GDAPI_FUNC(godot_realloc, void *, void *p_ptr, int p_bytes) \ + GDAPI_FUNC_VOID(godot_free, void *p_ptr) \ + GDAPI_FUNC_VOID(godot_print_error, const char *p_description, const char *p_function, const char *p_file, int p_line) \ + GDAPI_FUNC_VOID(godot_print_warning, const char *p_description, const char *p_function, const char *p_file, int p_line) \ + GDAPI_FUNC_VOID(godot_print, const godot_string *p_message) \ + GDAPI_FUNC_VOID(godot_nativescript_register_class, void *p_gdnative_handle, const char *p_name, const char *p_base, godot_instance_create_func p_create_func, godot_instance_destroy_func p_destroy_func) \ + GDAPI_FUNC_VOID(godot_nativescript_register_tool_class, void *p_gdnative_handle, const char *p_name, const char *p_base, godot_instance_create_func p_create_func, godot_instance_destroy_func p_destroy_func) \ + GDAPI_FUNC_VOID(godot_nativescript_register_method, void *p_gdnative_handle, const char *p_name, const char *p_function_name, godot_method_attributes p_attr, godot_instance_method p_method) \ + GDAPI_FUNC_VOID(godot_nativescript_register_property, void *p_gdnative_handle, const char *p_name, const char *p_path, godot_property_attributes *p_attr, godot_property_set_func p_set_func, godot_property_get_func p_get_func) \ + GDAPI_FUNC_VOID(godot_nativescript_register_signal, void *p_gdnative_handle, const char *p_name, const godot_signal *p_signal) \ + GDAPI_FUNC(godot_nativescript_get_userdata, void *, godot_object *p_instance) + +#define GDAPI_FUNC(name, ret_type, ...) \ + ret_type (*name)(__VA_ARGS__); +#define GDAPI_FUNC_VOID(name, ...) \ + void (*name)(__VA_ARGS__); + +typedef struct godot_gdnative_api_struct { + GODOT_GDNATIVE_API_FUNCTIONS +} godot_gdnative_api_struct; + +#undef GDAPI_FUNC +#undef GDAPI_FUNC_VOID + +#ifdef __cplusplus +} +#endif + +#endif // GODOT_GDNATIVE_API_STRUCT_H diff --git a/modules/gdnative/register_types.cpp b/modules/gdnative/register_types.cpp index dc0da5021d..997c342045 100644 --- a/modules/gdnative/register_types.cpp +++ b/modules/gdnative/register_types.cpp @@ -99,7 +99,6 @@ Set<String> get_gdnative_singletons(EditorFileSystemDirectory *p_dir) { void actual_discoverer_handler() { EditorFileSystemDirectory *dir = EditorFileSystem::get_singleton()->get_filesystem(); - Set<String> file_paths = get_gdnative_singletons(dir); Array files; @@ -118,11 +117,10 @@ GDNativeSingletonDiscover *discoverer = NULL; static void editor_init_callback() { - GDNativeLibraryEditor *library_editor = memnew( GDNativeLibraryEditor ); + GDNativeLibraryEditor *library_editor = memnew(GDNativeLibraryEditor); library_editor->set_name(TTR("GDNative")); ProjectSettingsEditor::get_singleton()->get_tabs()->add_child(library_editor); - discoverer = memnew(GDNativeSingletonDiscover); EditorFileSystem::get_singleton()->connect("filesystem_changed", discoverer, "get_class"); } diff --git a/modules/regex/regex.h b/modules/regex/regex.h index 0d97bcce54..bfa9c84042 100644 --- a/modules/regex/regex.h +++ b/modules/regex/regex.h @@ -87,8 +87,8 @@ public: Error compile(const String &p_pattern); void _init(const String &p_pattern = ""); - Ref<RegExMatch> search(const String &p_subject, int offset = 0, int end = -1) const; - String sub(const String &p_subject, const String &p_replacement, bool p_all = false, int p_start = 0, int p_end = -1) const; + Ref<RegExMatch> search(const String &p_subject, int p_offset = 0, int p_end = -1) const; + String sub(const String &p_subject, const String &p_replacement, bool p_all = false, int p_offset = 0, int p_end = -1) const; bool is_valid() const; String get_pattern() const; diff --git a/modules/svg/image_loader_svg.cpp b/modules/svg/image_loader_svg.cpp index c575edbba3..e27452354b 100644 --- a/modules/svg/image_loader_svg.cpp +++ b/modules/svg/image_loader_svg.cpp @@ -128,13 +128,13 @@ Error ImageLoaderSVG::_create_image(Ref<Image> p_image, const PoolVector<uint8_t return OK; } -Error ImageLoaderSVG::create_image_from_string(Ref<Image> p_image, const char *svg_str, float p_scale, bool upsample, bool convert_colors) { +Error ImageLoaderSVG::create_image_from_string(Ref<Image> p_image, const char *p_svg_str, float p_scale, bool upsample, bool convert_colors) { - size_t str_len = strlen(svg_str); + size_t str_len = strlen(p_svg_str); PoolVector<uint8_t> src_data; src_data.resize(str_len + 1); PoolVector<uint8_t>::Write src_w = src_data.write(); - memcpy(src_w.ptr(), svg_str, str_len + 1); + memcpy(src_w.ptr(), p_svg_str, str_len + 1); return _create_image(p_image, &src_data, p_scale, upsample, convert_colors); } @@ -160,4 +160,4 @@ void ImageLoaderSVG::get_recognized_extensions(List<String> *p_extensions) const ImageLoaderSVG::ImageLoaderSVG() { } -ImageLoaderSVG::ReplaceColors ImageLoaderSVG::replace_colors;
\ No newline at end of file +ImageLoaderSVG::ReplaceColors ImageLoaderSVG::replace_colors; diff --git a/modules/svg/image_loader_svg.h b/modules/svg/image_loader_svg.h index 332ac214a5..cf44cd8c50 100644 --- a/modules/svg/image_loader_svg.h +++ b/modules/svg/image_loader_svg.h @@ -57,7 +57,7 @@ class ImageLoaderSVG : public ImageFormatLoader { List<uint32_t> new_colors; } replace_colors; static SVGRasterizer rasterizer; - static void _convert_colors(NSVGimage *p_svg_imge); + static void _convert_colors(NSVGimage *p_svg_image); static Error _create_image(Ref<Image> p_image, const PoolVector<uint8_t> *p_data, float p_scale, bool upsample, bool convert_colors = false); public: diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp index 1de2608b9e..dbea2d7531 100644 --- a/platform/android/os_android.cpp +++ b/platform/android/os_android.cpp @@ -137,12 +137,7 @@ void OS_Android::initialize(const VideoMode &p_desired, int p_video_driver, int visual_server->init(); // visual_server->cursor_set_visible(false, 0); - AudioDriverManager::get_driver(p_audio_driver)->set_singleton(); - - if (AudioDriverManager::get_driver(p_audio_driver)->init() != OK) { - - ERR_PRINT("Initializing audio failed."); - } + AudioDriverManager::initialize(p_audio_driver); physics_server = memnew(PhysicsServerSW); physics_server->init(); diff --git a/platform/haiku/os_haiku.cpp b/platform/haiku/os_haiku.cpp index de2f79a0ac..9f2f88bb4e 100644 --- a/platform/haiku/os_haiku.cpp +++ b/platform/haiku/os_haiku.cpp @@ -137,11 +137,7 @@ void OS_Haiku::initialize(const VideoMode &p_desired, int p_video_driver, int p_ //physics_2d_server = Physics2DServerWrapMT::init_server<Physics2DServerSW>(); physics_2d_server->init(); - AudioDriverManager::get_driver(p_audio_driver)->set_singleton(); - - if (AudioDriverManager::get_driver(p_audio_driver)->init() != OK) { - ERR_PRINT("Initializing audio failed."); - } + AudioDriverManager::initialize(p_audio_driver); power_manager = memnew(PowerHaiku); } diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp index 543d028576..67d2a6e369 100644 --- a/platform/javascript/os_javascript.cpp +++ b/platform/javascript/os_javascript.cpp @@ -464,11 +464,7 @@ void OS_JavaScript::initialize(const VideoMode &p_desired, int p_video_driver, i print_line("Init Audio"); AudioDriverManager::add_driver(&audio_driver_javascript); - audio_driver_javascript.set_singleton(); - if (audio_driver_javascript.init() != OK) { - - ERR_PRINT("Initializing audio failed."); - } + AudioDriverManager::initialize(p_audio_driver); RasterizerGLES3::register_config(); RasterizerGLES3::make_current(); diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 5a23d76755..111cdb0cf1 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -1088,12 +1088,7 @@ void OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_au visual_server->init(); // visual_server->cursor_set_visible(false, 0); - AudioDriverManager::get_driver(p_audio_driver)->set_singleton(); - - if (AudioDriverManager::get_driver(p_audio_driver)->init() != OK) { - - ERR_PRINT("Initializing audio failed."); - } + AudioDriverManager::initialize(p_audio_driver); // physics_server = memnew(PhysicsServerSW); diff --git a/platform/server/os_server.cpp b/platform/server/os_server.cpp index e2bb464e76..300c5cffcc 100644 --- a/platform/server/os_server.cpp +++ b/platform/server/os_server.cpp @@ -62,12 +62,7 @@ void OS_Server::initialize(const VideoMode &p_desired, int p_video_driver, int p //visual_server = memnew( VisualServerRaster(rasterizer) ); - AudioDriverManager::get_driver(p_audio_driver)->set_singleton(); - - if (AudioDriverManager::get_driver(p_audio_driver)->init() != OK) { - - ERR_PRINT("Initializing audio failed."); - } + AudioDriverManager::initialize(p_audio_driver); sample_manager = memnew(SampleManagerMallocSW); audio_server = memnew(AudioServerSW(sample_manager)); @@ -232,7 +227,6 @@ void OS_Server::run() { OS_Server::OS_Server() { - AudioDriverManager::add_driver(&driver_dummy); //adriver here grab = false; }; diff --git a/platform/server/os_server.h b/platform/server/os_server.h index 8c0ca1a58d..ba12f649be 100644 --- a/platform/server/os_server.h +++ b/platform/server/os_server.h @@ -34,7 +34,6 @@ #include "drivers/rtaudio/audio_driver_rtaudio.h" #include "drivers/unix/os_unix.h" #include "main/input_default.h" -#include "servers/audio/audio_driver_dummy.h" #include "servers/audio_server.h" #include "servers/physics_2d/physics_2d_server_sw.h" #include "servers/physics_server.h" @@ -55,7 +54,6 @@ class OS_Server : public OS_Unix { List<String> args; MainLoop *main_loop; - AudioDriverDummy driver_dummy; bool grab; PhysicsServer *physics_server; diff --git a/platform/uwp/os_uwp.cpp b/platform/uwp/os_uwp.cpp index fd8904fa0a..b909ccccd6 100644 --- a/platform/uwp/os_uwp.cpp +++ b/platform/uwp/os_uwp.cpp @@ -268,12 +268,7 @@ void OSUWP::initialize(const VideoMode &p_desired, int p_video_driver, int p_aud joypad = ref new JoypadUWP(input); joypad->register_events(); - AudioDriverManager::get_driver(p_audio_driver)->set_singleton(); - - if (AudioDriverManager::get_driver(p_audio_driver)->init() != OK) { - - ERR_PRINT("Initializing audio failed."); - } + AudioDriverManager::initialize(p_audio_driver); power_manager = memnew(PowerUWP); diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 62954e1a56..461caf479c 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -1081,12 +1081,7 @@ void OS_Windows::initialize(const VideoMode &p_desired, int p_video_driver, int power_manager = memnew(PowerWindows); - AudioDriverManager::get_driver(p_audio_driver)->set_singleton(); - - if (AudioDriverManager::get_driver(p_audio_driver)->init() != OK) { - - ERR_PRINT("Initializing audio failed."); - } + AudioDriverManager::initialize(p_audio_driver); TRACKMOUSEEVENT tme; tme.cbSize = sizeof(TRACKMOUSEEVENT); diff --git a/platform/x11/export/export.cpp b/platform/x11/export/export.cpp index 59b1a44247..fdb43c9ae0 100644 --- a/platform/x11/export/export.cpp +++ b/platform/x11/export/export.cpp @@ -50,6 +50,7 @@ void register_x11_exporter() { platform->set_release_64("linux_x11_64_release"); platform->set_debug_64("linux_x11_64_debug"); platform->set_os_name("X11"); + platform->set_chmod_flags(0755); EditorExport::get_singleton()->add_export_platform(platform); } diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 4e78e0318c..3e8709a11e 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -313,29 +313,7 @@ void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_au XFree(xsh); } - AudioDriverManager::get_driver(p_audio_driver)->set_singleton(); - - audio_driver_index = p_audio_driver; - if (AudioDriverManager::get_driver(p_audio_driver)->init() != OK) { - - bool success = false; - audio_driver_index = -1; - for (int i = 0; i < AudioDriverManager::get_driver_count(); i++) { - if (i == p_audio_driver) - continue; - AudioDriverManager::get_driver(i)->set_singleton(); - if (AudioDriverManager::get_driver(i)->init() == OK) { - success = true; - print_line("Audio Driver Failed: " + String(AudioDriverManager::get_driver(p_audio_driver)->get_name())); - print_line("Using alternate audio driver: " + String(AudioDriverManager::get_driver(i)->get_name())); - audio_driver_index = i; - break; - } - } - if (!success) { - ERR_PRINT("Initializing audio failed."); - } - } + AudioDriverManager::initialize(p_audio_driver); ERR_FAIL_COND(!visual_server); ERR_FAIL_COND(x11_window == 0); @@ -2189,10 +2167,6 @@ bool OS_X11::is_disable_crash_handler() const { OS_X11::OS_X11() { -#ifdef RTAUDIO_ENABLED - AudioDriverManager::add_driver(&driver_rtaudio); -#endif - #ifdef PULSEAUDIO_ENABLED AudioDriverManager::add_driver(&driver_pulseaudio); #endif @@ -2201,11 +2175,6 @@ OS_X11::OS_X11() { AudioDriverManager::add_driver(&driver_alsa); #endif - if (AudioDriverManager::get_driver_count() == 0) { - WARN_PRINT("No sound driver found... Defaulting to dummy driver"); - AudioDriverManager::add_driver(&driver_dummy); - } - minimized = false; xim_style = 0L; mouse_mode = MOUSE_MODE_VISIBLE; diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h index 2ba7f07cef..0e2430c650 100644 --- a/platform/x11/os_x11.h +++ b/platform/x11/os_x11.h @@ -38,11 +38,9 @@ //#include "servers/visual/visual_server_wrap_mt.h" #include "drivers/alsa/audio_driver_alsa.h" #include "drivers/pulseaudio/audio_driver_pulseaudio.h" -#include "drivers/rtaudio/audio_driver_rtaudio.h" #include "joypad_linux.h" #include "main/input_default.h" #include "power_x11.h" -#include "servers/audio/audio_driver_dummy.h" #include "servers/audio_server.h" #include "servers/physics_2d/physics_2d_server_sw.h" #include "servers/physics_2d/physics_2d_server_wrap_mt.h" @@ -154,10 +152,6 @@ class OS_X11 : public OS_Unix { JoypadLinux *joypad; #endif -#ifdef RTAUDIO_ENABLED - AudioDriverRtAudio driver_rtaudio; -#endif - #ifdef ALSA_ENABLED AudioDriverALSA driver_alsa; #endif @@ -165,7 +159,6 @@ class OS_X11 : public OS_Unix { #ifdef PULSEAUDIO_ENABLED AudioDriverPulseAudio driver_pulseaudio; #endif - AudioDriverDummy driver_dummy; Atom net_wm_icon; diff --git a/scene/3d/light.h b/scene/3d/light.h index 6aa0220265..2f3ac8a5e7 100644 --- a/scene/3d/light.h +++ b/scene/3d/light.h @@ -150,7 +150,7 @@ public: void set_shadow_mode(ShadowMode p_mode); ShadowMode get_shadow_mode() const; - void set_shadow_depth_range(ShadowDepthRange p_mode); + void set_shadow_depth_range(ShadowDepthRange p_range); ShadowDepthRange get_shadow_depth_range() const; void set_blend_splits(bool p_enable); diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 87dfd95724..2d5b54257a 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -809,9 +809,9 @@ Ref<StyleBox> Control::get_stylebox(const StringName &p_name, const StringName & // try with custom themes Control *theme_owner = data.theme_owner; - while (theme_owner) { + StringName class_name = type; - StringName class_name = type; + while (theme_owner) { while (class_name != StringName()) { if (theme_owner->data.theme->has_stylebox(p_name, class_name)) { @@ -829,6 +829,14 @@ Ref<StyleBox> Control::get_stylebox(const StringName &p_name, const StringName & theme_owner = NULL; } + class_name = type; + + while (class_name != StringName()) { + if (Theme::get_default()->has_stylebox(p_name, class_name)) + return Theme::get_default()->get_stylebox(p_name, class_name); + + class_name = ClassDB::get_parent_class_nocheck(class_name); + } return Theme::get_default()->get_stylebox(p_name, type); } Ref<Font> Control::get_font(const StringName &p_name, const StringName &p_type) const { diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index ab2c2f445f..71b9c4ec72 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -540,14 +540,6 @@ void RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int it = _get_next_item(it); - if (p_mode == PROCESS_POINTER && r_click_item && itp && !it && p_click_pos.y > p_ofs.y + y + lh) { - //at the end of all, return this - if (r_outside) *r_outside = true; - *r_click_item = itp; - *r_click_char = rchar; - return; - } - if (it && (p_line + 1 < p_frame->lines.size()) && p_frame->lines[p_line + 1].from == it) { if (p_mode == PROCESS_POINTER && r_click_item && p_click_pos.y >= p_ofs.y + y && p_click_pos.y <= p_ofs.y + y + lh) { diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp index 657e8590d4..98a8db336e 100644 --- a/scene/gui/tab_container.cpp +++ b/scene/gui/tab_container.cpp @@ -208,6 +208,9 @@ void TabContainer::_notification(int p_what) { break; } + // Draw the tab area. + panel->draw(canvas, Rect2(0, header_height, size.width, size.height - header_height)); + // Draw all visible tabs. int x = 0; for (int i = 0; i < tab_widths.size(); i++) { @@ -280,9 +283,6 @@ void TabContainer::_notification(int p_what) { Point2(x, y_center - (decrement->get_height() / 2)), Color(1, 1, 1, first_tab_cache > 0 ? 1.0 : 0.5)); } - - // Draw the tab area. - panel->draw(canvas, Rect2(0, header_height, size.width, size.height - header_height)); } break; case NOTIFICATION_THEME_CHANGED: { if (get_tab_count() > 0) { diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 1738e303aa..2ca4c81319 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -36,6 +36,10 @@ #include "project_settings.h" #include "scene/main/viewport.h" +#ifdef TOOLS_ENABLED +#include "editor/editor_scale.h" +#endif + #define TAB_PIXELS static bool _is_text_char(CharType c) { @@ -729,15 +733,18 @@ void TextEdit::_notification(int p_what) { VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg, ofs_y, xmargin_end - xmargin_beg, get_row_height()), cache.mark_color); } - if (text.is_breakpoint(line)) { - - VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg, ofs_y, xmargin_end - xmargin_beg, get_row_height()), cache.breakpoint_color); - } - if (line == cursor.line) { VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(0, ofs_y, xmargin_end, get_row_height()), cache.current_line_color); } + if (text.is_breakpoint(line) && !draw_breakpoint_gutter) { +#ifdef TOOLS_ENABLED + VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg, ofs_y + get_row_height() - EDSCALE, xmargin_end - xmargin_beg, EDSCALE), cache.breakpoint_color); +#else + VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg, ofs_y, xmargin_end - xmargin_beg, get_row_height()), cache.breakpoint_color); +#endif + } + // draw breakpoint marker if (text.is_breakpoint(line)) { if (draw_breakpoint_gutter) { @@ -2793,12 +2800,16 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { int ini = selection.from_line; int end = selection.to_line; for (int i = ini; i <= end; i++) { - if (text[i][0] == '#') + if (get_line(i).begins_with("#")) _remove_text(i, 0, i, 1); } } else { - if (text[cursor.line][0] == '#') + if (get_line(cursor.line).begins_with("#")) { _remove_text(cursor.line, 0, cursor.line, 1); + if (cursor.column >= get_line(cursor.line).length()) { + cursor.column = MAX(0, get_line(cursor.line).length() - 1); + } + } } update(); } diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 7fa29d312e..1aaea98798 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -2010,7 +2010,7 @@ void Tree::_gui_input(Ref<InputEvent> p_event) { if (!k->is_pressed()) return; - if (k->get_alt() || k->get_command() || (k->get_shift() && k->get_unicode() == 0) || k->get_metakey()) + if (k->get_command() || (k->get_shift() && k->get_unicode() == 0) || k->get_metakey()) return; if (!root) return; @@ -2025,48 +2025,47 @@ void Tree::_gui_input(Ref<InputEvent> p_event) { break; \ } case KEY_RIGHT: { + bool dobreak = true; //TreeItem *next = NULL; if (!selected_item) break; - if (select_mode == SELECT_ROW) + if (select_mode == SELECT_ROW) { EXIT_BREAK; - if (selected_col >= (columns.size() - 1)) + } + if (selected_col > (columns.size() - 1)) { EXIT_BREAK; - if (select_mode == SELECT_MULTI) { - selected_col++; - emit_signal("cell_selected"); + } + if (k->get_alt()) { + selected_item->set_collapsed(false); + TreeItem *next = selected_item->get_children(); + while (next && next != selected_item->next) { + next->set_collapsed(false); + next = next->get_next_visible(); + } + } else if (selected_col == (columns.size() - 1)) { + if (selected_item->get_children() != NULL && selected_item->is_collapsed()) { + selected_item->set_collapsed(false); + } else { + selected_col = 0; + dobreak = false; // fall through to key_down + } } else { + if (select_mode == SELECT_MULTI) { + selected_col++; + emit_signal("cell_selected"); + } else { - selected_item->select(selected_col + 1); + selected_item->select(selected_col + 1); + } } - update(); ensure_cursor_is_visible(); accept_event(); - - } break; - case KEY_LEFT: { - - //TreeItem *next = NULL; - if (!selected_item) + if (dobreak) { break; - if (select_mode == SELECT_ROW) - EXIT_BREAK; - if (selected_col <= 0) - EXIT_BREAK; - if (select_mode == SELECT_MULTI) { - selected_col--; - emit_signal("cell_selected"); - } else { - - selected_item->select(selected_col - 1); } - - update(); - accept_event(); - - } break; + } case KEY_DOWN: { TreeItem *next = NULL; @@ -2113,6 +2112,48 @@ void Tree::_gui_input(Ref<InputEvent> p_event) { accept_event(); } break; + case KEY_LEFT: { + bool dobreak = true; + + //TreeItem *next = NULL; + if (!selected_item) + break; + if (select_mode == SELECT_ROW) { + EXIT_BREAK; + } + if (selected_col < 0) { + EXIT_BREAK; + } + if (k->get_alt()) { + selected_item->set_collapsed(true); + TreeItem *next = selected_item->get_children(); + while (next && next != selected_item->next) { + next->set_collapsed(true); + next = next->get_next_visible(); + } + } else if (selected_col == 0) { + if (selected_item->get_children() != NULL && !selected_item->is_collapsed()) { + selected_item->set_collapsed(true); + } else { + selected_col = columns.size() - 1; + dobreak = false; // fall through to key_up + } + } else { + if (select_mode == SELECT_MULTI) { + selected_col--; + emit_signal("cell_selected"); + } else { + + selected_item->select(selected_col - 1); + } + } + update(); + accept_event(); + + if (dobreak) { + break; + } + } case KEY_UP: { TreeItem *prev = NULL; diff --git a/scene/resources/sky_box.cpp b/scene/resources/sky_box.cpp index 9af8c42110..2ef20f67f5 100644 --- a/scene/resources/sky_box.cpp +++ b/scene/resources/sky_box.cpp @@ -419,10 +419,10 @@ void ProceduralSky::_queue_update() { call_deferred("_update_sky"); } -void ProceduralSky::_thread_done(const Ref<Image> &image) { +void ProceduralSky::_thread_done(const Ref<Image> &p_image) { - VS::get_singleton()->texture_allocate(texture, image->get_width(), image->get_height(), Image::FORMAT_RGBE9995, VS::TEXTURE_FLAG_FILTER | VS::TEXTURE_FLAG_REPEAT); - VS::get_singleton()->texture_set_data(texture, image); + VS::get_singleton()->texture_allocate(texture, p_image->get_width(), p_image->get_height(), Image::FORMAT_RGBE9995, VS::TEXTURE_FLAG_FILTER | VS::TEXTURE_FLAG_REPEAT); + VS::get_singleton()->texture_set_data(texture, p_image); _radiance_changed(); Thread::wait_to_finish(sky_thread); memdelete(sky_thread); diff --git a/scene/resources/style_box.h b/scene/resources/style_box.h index 3d085f7166..4627c900ff 100644 --- a/scene/resources/style_box.h +++ b/scene/resources/style_box.h @@ -178,7 +178,7 @@ public: void set_border_width_all(int p_size); int get_border_width_min() const; - void set_border_width(Margin p_margin, int p_size); + void set_border_width(Margin p_margin, int p_width); int get_border_width(Margin p_margin) const; //blend @@ -214,7 +214,7 @@ public: int get_shadow_size() const; //ANTI_ALIASING - void set_anti_aliased(const bool &p_anit_aliasing); + void set_anti_aliased(const bool &p_anti_aliased); bool is_anti_aliased() const; //tempAA void set_aa_size(const int &p_aa_size); diff --git a/servers/audio_server.cpp b/servers/audio_server.cpp index 4b728f821a..78efe85e16 100644 --- a/servers/audio_server.cpp +++ b/servers/audio_server.cpp @@ -32,6 +32,7 @@ #include "os/file_access.h" #include "os/os.h" #include "project_settings.h" +#include "servers/audio/audio_driver_dummy.h" #include "servers/audio/effects/audio_effect_compressor.h" #ifdef TOOLS_ENABLED @@ -107,6 +108,7 @@ AudioDriver::AudioDriver() { AudioDriver *AudioDriverManager::drivers[MAX_DRIVERS]; int AudioDriverManager::driver_count = 0; +AudioDriverDummy AudioDriverManager::dummy_driver; void AudioDriverManager::add_driver(AudioDriver *p_driver) { @@ -118,6 +120,43 @@ int AudioDriverManager::get_driver_count() { return driver_count; } + +void AudioDriverManager::initialize(int p_driver) { + AudioDriver *driver; + int failed_driver = -1; + + // Check if there is a selected driver + if (p_driver >= 0 && p_driver < driver_count) { + if (drivers[p_driver]->init() == OK) { + drivers[p_driver]->set_singleton(); + return; + } else { + failed_driver = p_driver; + } + } + + // No selected driver, try them all in order + for (int i = 0; i < driver_count; i++) { + // Don't re-init the driver if it failed above + if (i == failed_driver) { + continue; + } + + if (drivers[i]->init() == OK) { + drivers[i]->set_singleton(); + return; + } + } + + // Fallback to our dummy driver + if (dummy_driver.init() == OK) { + ERR_PRINT("AudioDriverManager: all drivers failed, falling back to dummy driver"); + dummy_driver.set_singleton(); + } else { + ERR_PRINT("AudioDriverManager: dummy driver faild to init()"); + } +} + AudioDriver *AudioDriverManager::get_driver(int p_driver) { ERR_FAIL_INDEX_V(p_driver, driver_count, NULL); diff --git a/servers/audio_server.h b/servers/audio_server.h index c479d09a3c..55e9367308 100644 --- a/servers/audio_server.h +++ b/servers/audio_server.h @@ -35,6 +35,8 @@ #include "servers/audio/audio_effect.h" #include "variant.h" +class AudioDriverDummy; + class AudioDriver { static AudioDriver *singleton; @@ -90,8 +92,11 @@ class AudioDriverManager { static AudioDriver *drivers[MAX_DRIVERS]; static int driver_count; + static AudioDriverDummy dummy_driver; + public: static void add_driver(AudioDriver *p_driver); + static void initialize(int p_driver); static int get_driver_count(); static AudioDriver *get_driver(int p_driver); }; diff --git a/servers/physics/broad_phase_basic.h b/servers/physics/broad_phase_basic.h index 51a24f4678..5c124c1792 100644 --- a/servers/physics/broad_phase_basic.h +++ b/servers/physics/broad_phase_basic.h @@ -82,7 +82,7 @@ class BroadPhaseBasic : public BroadPhaseSW { public: // 0 is an invalid ID - virtual ID create(CollisionObjectSW *p_object_, int p_subindex = 0); + virtual ID create(CollisionObjectSW *p_object, int p_subindex = 0); virtual void move(ID p_id, const Rect3 &p_aabb); virtual void set_static(ID p_id, bool p_static); virtual void remove(ID p_id); diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp index 779f0d54ac..8f22d1cd44 100644 --- a/servers/physics_2d/space_2d_sw.cpp +++ b/servers/physics_2d/space_2d_sw.cpp @@ -518,7 +518,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co body_aabb = body_aabb.grow(p_margin); static const int max_excluded_shape_pairs = 32; - Pair<Shape2DSW *, Shape2DSW *> excluded_shape_pairs[max_excluded_shape_pairs]; + ExcludedShapeSW excluded_shape_pairs[max_excluded_shape_pairs]; int excluded_shape_pair_count = 0; Transform2D body_transform = p_from; @@ -577,7 +577,11 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co if (!collided && cbk.invalid_by_dir > 0) { //this shape must be excluded if (excluded_shape_pair_count < max_excluded_shape_pairs) { - excluded_shape_pairs[excluded_shape_pair_count++] = Pair<Shape2DSW *, Shape2DSW *>(body_shape, against_shape); + ExcludedShapeSW esp; + esp.local_shape = body_shape; + esp.against_object = col_obj; + esp.against_shape_index = shape_idx; + excluded_shape_pairs[excluded_shape_pair_count++] = esp; } } } @@ -645,7 +649,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co for (int k = 0; k < excluded_shape_pair_count; k++) { - if (excluded_shape_pairs[k].first == body_shape && excluded_shape_pairs[k].second == against_shape) { + if (excluded_shape_pairs[k].local_shape == body_shape && excluded_shape_pairs[k].against_object == col_obj && excluded_shape_pairs[k].against_shape_index == shape_idx) { excluded = true; break; } @@ -776,7 +780,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co bool excluded = false; for (int k = 0; k < excluded_shape_pair_count; k++) { - if (excluded_shape_pairs[k].first == body_shape && excluded_shape_pairs[k].second == against_shape) { + if (excluded_shape_pairs[k].local_shape == body_shape && excluded_shape_pairs[k].against_object == col_obj && excluded_shape_pairs[k].against_shape_index == shape_idx) { excluded = true; break; } diff --git a/servers/physics_2d/space_2d_sw.h b/servers/physics_2d/space_2d_sw.h index ed6136e372..c7e7497397 100644 --- a/servers/physics_2d/space_2d_sw.h +++ b/servers/physics_2d/space_2d_sw.h @@ -71,6 +71,12 @@ public: }; private: + struct ExcludedShapeSW { + Shape2DSW *local_shape; + const CollisionObject2DSW *against_object; + int against_shape_index; + }; + uint64_t elapsed_time[ELAPSED_TIME_MAX]; Physics2DDirectSpaceStateSW *direct_access; |