diff options
264 files changed, 1494 insertions, 1313 deletions
diff --git a/.clang-format b/.clang-format index 0407a7aeb3..bc69a6a3a6 100644 --- a/.clang-format +++ b/.clang-format @@ -1,15 +1,14 @@ ---- -BasedOnStyle: LLVM # Commented out parameters are those with the same value as base LLVM style # We can uncomment them if we want to change their value, or enforce the -# chosen value in case the base style changes (initial sync: Clang 3.9.1). -... -Language: Cpp +# chosen value in case the base style changes (last sync: Clang 5.0.0). +--- +### General config, applies to all languages ### +BasedOnStyle: LLVM AccessModifierOffset: -4 AlignAfterOpenBracket: DontAlign # AlignConsecutiveAssignments: false # AlignConsecutiveDeclarations: false -# AlignEscapedNewlinesLeft: false +# AlignEscapedNewlines: Right # AlignOperands: true AlignTrailingComments: false AllowAllParametersOfDeclarationOnNextLine: false @@ -36,22 +35,32 @@ AllowShortIfStatementsOnASingleLine: true # BeforeCatch: false # BeforeElse: false # IndentBraces: false +# SplitEmptyFunction: true +# SplitEmptyRecord: true +# SplitEmptyNamespace: true # BreakBeforeBinaryOperators: None # BreakBeforeBraces: Attach +# BreakBeforeInheritanceComma: false BreakBeforeTernaryOperators: false # BreakConstructorInitializersBeforeComma: false +BreakConstructorInitializers: AfterColon # BreakAfterJavaFieldAnnotations: false # BreakStringLiterals: true ColumnLimit: 0 # CommentPragmas: '^ IWYU pragma:' -# ConstructorInitializerAllOnOneLineOrOnePerLine: false -# ConstructorInitializerIndentWidth: 4 +# CompactNamespaces: false +ConstructorInitializerAllOnOneLineOrOnePerLine: true +ConstructorInitializerIndentWidth: 8 ContinuationIndentWidth: 8 Cpp11BracedListStyle: false # DerivePointerAlignment: false # DisableFormat: false # ExperimentalAutoDetectBinPacking: false -# ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] +# FixNamespaceComments: true +# ForEachMacros: +# - foreach +# - Q_FOREACH +# - BOOST_FOREACH IncludeCategories: - Regex: '".*"' Priority: 1 @@ -59,7 +68,7 @@ IncludeCategories: Priority: 2 - Regex: '^<.*' Priority: 3 -# IncludeIsMainRegex: '$' +# IncludeIsMainRegex: '(Test)?$' IndentCaseLabels: true IndentWidth: 4 # IndentWrappedFunctionNames: false @@ -70,19 +79,19 @@ IndentWidth: 4 # MacroBlockEnd: '' # MaxEmptyLinesToKeep: 1 # NamespaceIndentation: None -ObjCBlockIndentWidth: 4 -# ObjCSpaceAfterProperty: false -# ObjCSpaceBeforeProtocolList: true +# PenaltyBreakAssignment: 2 # PenaltyBreakBeforeFirstCallParameter: 19 # PenaltyBreakComment: 300 # PenaltyBreakFirstLessLess: 120 # PenaltyBreakString: 1000 # PenaltyExcessCharacter: 1000000 # PenaltyReturnTypeOnItsOwnLine: 60 -PointerAlignment: Right +# PointerAlignment: Right # ReflowComments: true -SortIncludes: true +# SortIncludes: true +# SortUsingDeclarations: true # SpaceAfterCStyleCast: false +# SpaceAfterTemplateKeyword: true # SpaceBeforeAssignmentOperators: true # SpaceBeforeParens: ControlStatements # SpaceInEmptyParentheses: false @@ -92,7 +101,16 @@ SortIncludes: true # SpacesInCStyleCastParentheses: false # SpacesInParentheses: false # SpacesInSquareBrackets: false -Standard: Cpp03 TabWidth: 4 UseTab: Always +--- +### C++ specific config ### +Language: Cpp +Standard: Cpp03 +--- +### ObjC specific config ### +Language: ObjC +ObjCBlockIndentWidth: 4 +# ObjCSpaceAfterProperty: false +# ObjCSpaceBeforeProtocolList: true ... diff --git a/.travis.yml b/.travis.yml index 2c4eda9105..c11a21aeef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,7 +41,7 @@ addons: apt: sources: - ubuntu-toolchain-r-test - - llvm-toolchain-trusty-3.9 + - llvm-toolchain-trusty-5.0 packages: - build-essential - scons @@ -55,6 +55,7 @@ addons: - libssl-dev - libxinerama-dev - libxrandr-dev + - libxi-dev # For cross-compiling to Windows. #- binutils-mingw-w64-i686 @@ -66,7 +67,7 @@ addons: #- mingw-w64 # For style checks. - - clang-format-3.9 + - clang-format-5.0 install: - if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$GODOT_TARGET" = "android" ]; then diff --git a/core/class_db.h b/core/class_db.h index 24db4c61bb..b8b681301d 100644 --- a/core/class_db.h +++ b/core/class_db.h @@ -49,10 +49,10 @@ struct MethodDefinition { StringName name; Vector<StringName> args; MethodDefinition() {} - MethodDefinition(const char *p_name) - : name(p_name) {} - MethodDefinition(const StringName &p_name) - : name(p_name) {} + MethodDefinition(const char *p_name) : + name(p_name) {} + MethodDefinition(const StringName &p_name) : + name(p_name) {} }; MethodDefinition D_METHOD(const char *p_name); diff --git a/core/core_string_names.cpp b/core/core_string_names.cpp index feee39225f..3091c80607 100644 --- a/core/core_string_names.cpp +++ b/core/core_string_names.cpp @@ -31,22 +31,22 @@ CoreStringNames *CoreStringNames::singleton = NULL; -CoreStringNames::CoreStringNames() - : _free(StaticCString::create("free")), - changed(StaticCString::create("changed")), - _meta(StaticCString::create("__meta__")), - _script(StaticCString::create("script")), - script_changed(StaticCString::create("script_changed")), - ___pdcdata(StaticCString::create("___pdcdata")), - __getvar(StaticCString::create("__getvar")), - _iter_init(StaticCString::create("_iter_init")), - _iter_next(StaticCString::create("_iter_next")), - _iter_get(StaticCString::create("_iter_get")), - get_rid(StaticCString::create("get_rid")), +CoreStringNames::CoreStringNames() : + _free(StaticCString::create("free")), + changed(StaticCString::create("changed")), + _meta(StaticCString::create("__meta__")), + _script(StaticCString::create("script")), + script_changed(StaticCString::create("script_changed")), + ___pdcdata(StaticCString::create("___pdcdata")), + __getvar(StaticCString::create("__getvar")), + _iter_init(StaticCString::create("_iter_init")), + _iter_next(StaticCString::create("_iter_next")), + _iter_get(StaticCString::create("_iter_get")), + get_rid(StaticCString::create("get_rid")), #ifdef TOOLS_ENABLED - _sections_unfolded(StaticCString::create("_sections_unfolded")), + _sections_unfolded(StaticCString::create("_sections_unfolded")), #endif - _custom_features(StaticCString::create("_custom_features")) { + _custom_features(StaticCString::create("_custom_features")) { x = StaticCString::create("x"); y = StaticCString::create("y"); diff --git a/core/dvector.h b/core/dvector.h index 1b81ceec5e..66bf0e7862 100644 --- a/core/dvector.h +++ b/core/dvector.h @@ -149,7 +149,7 @@ class PoolVector { } if (old_alloc->refcount.unref() == true) { -//this should never happen but.. + //this should never happen but.. #ifdef DEBUG_ENABLED MemoryPool::alloc_mutex->lock(); diff --git a/core/engine.h b/core/engine.h index 4a573c1539..1becebe34a 100644 --- a/core/engine.h +++ b/core/engine.h @@ -41,9 +41,9 @@ public: struct Singleton { StringName name; Object *ptr; - Singleton(const StringName &p_name = StringName(), Object *p_ptr = NULL) - : name(p_name), - ptr(p_ptr) { + Singleton(const StringName &p_name = StringName(), Object *p_ptr = NULL) : + name(p_name), + ptr(p_ptr) { } }; diff --git a/core/global_constants.cpp b/core/global_constants.cpp index fb432b85db..a8f6e4da6c 100644 --- a/core/global_constants.cpp +++ b/core/global_constants.cpp @@ -45,15 +45,15 @@ struct _GlobalConstant { _GlobalConstant() {} #ifdef DEBUG_METHODS_ENABLED - _GlobalConstant(const StringName &p_enum_name, const char *p_name, int p_value) - : enum_name(p_enum_name), - name(p_name), - value(p_value) { + _GlobalConstant(const StringName &p_enum_name, const char *p_name, int p_value) : + enum_name(p_enum_name), + name(p_name), + value(p_value) { } #else - _GlobalConstant(const char *p_name, int p_value) - : name(p_name), - value(p_value) { + _GlobalConstant(const char *p_name, int p_value) : + name(p_name), + value(p_value) { } #endif }; diff --git a/core/hash_map.h b/core/hash_map.h index e100d7a904..a53cb53c84 100644 --- a/core/hash_map.h +++ b/core/hash_map.h @@ -63,9 +63,9 @@ public: TData data; Pair() {} - Pair(const TKey &p_key, const TData &p_data) - : key(p_key), - data(p_data) { + Pair(const TKey &p_key, const TData &p_data) : + key(p_key), + data(p_data) { } }; diff --git a/core/helper/math_fieldwise.cpp b/core/helper/math_fieldwise.cpp index 2cd8a4f392..9e5eab2ee8 100644 --- a/core/helper/math_fieldwise.cpp +++ b/core/helper/math_fieldwise.cpp @@ -44,10 +44,10 @@ Variant fieldwise_assign(const Variant &p_target, const Variant &p_source, const ERR_FAIL_COND_V(p_target.get_type() != p_source.get_type(), p_target); - switch (p_source.get_type()) { + /* clang-format makes a mess of this macro usage */ + /* clang-format off */ - /* clang-format makes a mess of this macro usage */ - /* clang-format off */ + switch (p_source.get_type()) { case Variant::VECTOR2: { @@ -174,9 +174,8 @@ Variant fieldwise_assign(const Variant &p_target, const Variant &p_source, const default: { ERR_FAIL_V(p_target); } - - /* clang-format on */ } + /* clang-format on */ } #endif // TOOLS_ENABLED diff --git a/core/io/file_access_pack.cpp b/core/io/file_access_pack.cpp index a7eb8ce6a9..c46e645ed8 100644 --- a/core/io/file_access_pack.cpp +++ b/core/io/file_access_pack.cpp @@ -313,9 +313,9 @@ bool FileAccessPack::file_exists(const String &p_name) { return false; } -FileAccessPack::FileAccessPack(const String &p_path, const PackedData::PackedFile &p_file) - : pf(p_file), - f(FileAccess::open(pf.pack, FileAccess::READ)) { +FileAccessPack::FileAccessPack(const String &p_path, const PackedData::PackedFile &p_file) : + pf(p_file), + f(FileAccess::open(pf.pack, FileAccess::READ)) { if (!f) { ERR_EXPLAIN("Can't open pack-referenced file: " + String(pf.pack)); ERR_FAIL_COND(!f); diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp index 37320d7a77..7dd3468c48 100644 --- a/core/io/marshalls.cpp +++ b/core/io/marshalls.cpp @@ -159,8 +159,8 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int r_variant = str; } break; - // math types + // math types case Variant::VECTOR2: { ERR_FAIL_COND_V(len < (int)4 * 2, ERR_INVALID_DATA); @@ -959,8 +959,8 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo _encode_string(p_variant, buf, r_len); } break; - // math types + // math types case Variant::VECTOR2: { if (buf) { diff --git a/core/io/resource_import.h b/core/io/resource_import.h index 28489b5d34..166fff85cf 100644 --- a/core/io/resource_import.h +++ b/core/io/resource_import.h @@ -90,9 +90,9 @@ public: PropertyInfo option; Variant default_value; - ImportOption(const PropertyInfo &p_info, const Variant &p_default) - : option(p_info), - default_value(p_default) { + ImportOption(const PropertyInfo &p_info, const Variant &p_default) : + option(p_info), + default_value(p_default) { } ImportOption() {} }; diff --git a/core/math/a_star.h b/core/math/a_star.h index b7b7e54125..1f13f4fae8 100644 --- a/core/math/a_star.h +++ b/core/math/a_star.h @@ -59,8 +59,8 @@ class AStar : public Reference { Point *prev_point; real_t distance; - Point() - : list(this) {} + Point() : + list(this) {} }; Map<int, Point *> points; diff --git a/core/math/aabb.h b/core/math/aabb.h index c60213496a..c5ba79e172 100644 --- a/core/math/aabb.h +++ b/core/math/aabb.h @@ -101,9 +101,9 @@ public: operator String() const; _FORCE_INLINE_ AABB() {} - inline AABB(const Vector3 &p_pos, const Vector3 &p_size) - : position(p_pos), - size(p_size) { + inline AABB(const Vector3 &p_pos, const Vector3 &p_size) : + position(p_pos), + size(p_size) { } }; diff --git a/core/math/bsp_tree.cpp b/core/math/bsp_tree.cpp index bdc040160f..ecda777583 100644 --- a/core/math/bsp_tree.cpp +++ b/core/math/bsp_tree.cpp @@ -577,11 +577,11 @@ BSP_Tree::BSP_Tree(const PoolVector<Face3> &p_faces, real_t p_error_radius) { error_radius = p_error_radius; } -BSP_Tree::BSP_Tree(const Vector<Node> &p_nodes, const Vector<Plane> &p_planes, const AABB &p_aabb, real_t p_error_radius) - : nodes(p_nodes), - planes(p_planes), - aabb(p_aabb), - error_radius(p_error_radius) { +BSP_Tree::BSP_Tree(const Vector<Node> &p_nodes, const Vector<Plane> &p_planes, const AABB &p_aabb, real_t p_error_radius) : + nodes(p_nodes), + planes(p_planes), + aabb(p_aabb), + error_radius(p_error_radius) { } BSP_Tree::~BSP_Tree() { diff --git a/core/math/face3.cpp b/core/math/face3.cpp index 070ce77db4..7e586a1fd2 100644 --- a/core/math/face3.cpp +++ b/core/math/face3.cpp @@ -195,9 +195,8 @@ bool Face3::intersects_aabb(const AABB &p_aabb) const { if (!p_aabb.intersects_plane(get_plane())) return false; - /** TEST FACE AXIS */ - #define TEST_AXIS(m_ax) \ + /** TEST FACE AXIS */ \ { \ real_t aabb_min = p_aabb.position.m_ax; \ real_t aabb_max = p_aabb.position.m_ax + p_aabb.size.m_ax; \ diff --git a/core/math/face3.h b/core/math/face3.h index 561fa31238..9a1f6b2c2e 100644 --- a/core/math/face3.h +++ b/core/math/face3.h @@ -256,6 +256,4 @@ bool Face3::intersects_aabb2(const AABB &p_aabb) const { return true; } - //this sucks... - #endif // FACE3_H diff --git a/core/math/math_2d.h b/core/math/math_2d.h index d215df8a43..d788318f5e 100644 --- a/core/math/math_2d.h +++ b/core/math/math_2d.h @@ -385,13 +385,13 @@ struct Rect2 { operator String() const { return String(position) + ", " + String(size); } Rect2() {} - Rect2(real_t p_x, real_t p_y, real_t p_width, real_t p_height) - : position(Point2(p_x, p_y)), - size(Size2(p_width, p_height)) { + Rect2(real_t p_x, real_t p_y, real_t p_width, real_t p_height) : + position(Point2(p_x, p_y)), + size(Size2(p_width, p_height)) { } - Rect2(const Point2 &p_pos, const Size2 &p_size) - : position(p_pos), - size(p_size) { + Rect2(const Point2 &p_pos, const Size2 &p_size) : + position(p_pos), + size(p_size) { } }; @@ -578,18 +578,18 @@ struct Rect2i { operator String() const { return String(position) + ", " + String(size); } operator Rect2() const { return Rect2(position, size); } - Rect2i(const Rect2 &p_r2) - : position(p_r2.position), - size(p_r2.size) { + Rect2i(const Rect2 &p_r2) : + position(p_r2.position), + size(p_r2.size) { } Rect2i() {} - Rect2i(int p_x, int p_y, int p_width, int p_height) - : position(Point2(p_x, p_y)), - size(Size2(p_width, p_height)) { + Rect2i(int p_x, int p_y, int p_width, int p_height) : + position(Point2(p_x, p_y)), + size(Size2(p_width, p_height)) { } - Rect2i(const Point2 &p_pos, const Size2 &p_size) - : position(p_pos), - size(p_size) { + Rect2i(const Point2 &p_pos, const Size2 &p_size) : + position(p_pos), + size(p_size) { } }; diff --git a/core/math/math_funcs.h b/core/math/math_funcs.h index bc0b3717ed..80e5805451 100644 --- a/core/math/math_funcs.h +++ b/core/math/math_funcs.h @@ -272,7 +272,7 @@ public: #elif defined(_MSC_VER) && _MSC_VER < 1800 __asm fld a __asm fistp b -/*#elif defined( __GNUC__ ) && ( defined( __i386__ ) || defined( __x86_64__ ) ) + /*#elif defined( __GNUC__ ) && ( defined( __i386__ ) || defined( __x86_64__ ) ) // use AT&T inline assembly style, document that // we use memory as output (=m) and input (m) __asm__ __volatile__ ( diff --git a/core/math/plane.h b/core/math/plane.h index 559a735817..1d02b5d523 100644 --- a/core/math/plane.h +++ b/core/math/plane.h @@ -74,9 +74,9 @@ public: operator String() const; _FORCE_INLINE_ Plane() { d = 0; } - _FORCE_INLINE_ Plane(real_t p_a, real_t p_b, real_t p_c, real_t p_d) - : normal(p_a, p_b, p_c), - d(p_d){}; + _FORCE_INLINE_ Plane(real_t p_a, real_t p_b, real_t p_c, real_t p_d) : + normal(p_a, p_b, p_c), + d(p_d){}; _FORCE_INLINE_ Plane(const Vector3 &p_normal, real_t p_d); _FORCE_INLINE_ Plane(const Vector3 &p_point, const Vector3 &p_normal); @@ -100,14 +100,14 @@ bool Plane::has_point(const Vector3 &p_point, real_t _epsilon) const { return (dist <= _epsilon); } -Plane::Plane(const Vector3 &p_normal, real_t p_d) - : normal(p_normal), - d(p_d) { +Plane::Plane(const Vector3 &p_normal, real_t p_d) : + normal(p_normal), + d(p_d) { } -Plane::Plane(const Vector3 &p_point, const Vector3 &p_normal) - : normal(p_normal), - d(p_normal.dot(p_point)) { +Plane::Plane(const Vector3 &p_point, const Vector3 &p_normal) : + normal(p_normal), + d(p_normal.dot(p_point)) { } Plane::Plane(const Vector3 &p_point1, const Vector3 &p_point2, const Vector3 &p_point3, ClockDirection p_dir) { diff --git a/core/math/transform.cpp b/core/math/transform.cpp index 638a39ab73..fb4ca16565 100644 --- a/core/math/transform.cpp +++ b/core/math/transform.cpp @@ -208,7 +208,7 @@ Transform::operator String() const { return basis.operator String() + " - " + origin.operator String(); } -Transform::Transform(const Basis &p_basis, const Vector3 &p_origin) - : basis(p_basis), - origin(p_origin) { +Transform::Transform(const Basis &p_basis, const Vector3 &p_origin) : + basis(p_basis), + origin(p_origin) { } diff --git a/core/object.cpp b/core/object.cpp index 1be7337d96..cf1472243b 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -126,9 +126,9 @@ MethodInfo::operator Dictionary() const { return d; } -MethodInfo::MethodInfo() - : flags(METHOD_FLAG_NORMAL), - id(0) { +MethodInfo::MethodInfo() : + flags(METHOD_FLAG_NORMAL), + id(0) { } MethodInfo MethodInfo::from_dict(const Dictionary &p_dict) { @@ -164,48 +164,48 @@ MethodInfo MethodInfo::from_dict(const Dictionary &p_dict) { return mi; } -MethodInfo::MethodInfo(const String &p_name) - : name(p_name), - flags(METHOD_FLAG_NORMAL), - id(0) { +MethodInfo::MethodInfo(const String &p_name) : + name(p_name), + flags(METHOD_FLAG_NORMAL), + id(0) { } -MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1) - : name(p_name), - flags(METHOD_FLAG_NORMAL), - id(0) { +MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1) : + name(p_name), + flags(METHOD_FLAG_NORMAL), + id(0) { arguments.push_back(p_param1); } -MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2) - : name(p_name), - flags(METHOD_FLAG_NORMAL), - id(0) { +MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2) : + name(p_name), + flags(METHOD_FLAG_NORMAL), + id(0) { arguments.push_back(p_param1); arguments.push_back(p_param2); } -MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3) - : name(p_name), - flags(METHOD_FLAG_NORMAL), - id(0) { +MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3) : + name(p_name), + flags(METHOD_FLAG_NORMAL), + id(0) { arguments.push_back(p_param1); arguments.push_back(p_param2); arguments.push_back(p_param3); } -MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4) - : name(p_name), - flags(METHOD_FLAG_NORMAL), - id(0) { +MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4) : + name(p_name), + flags(METHOD_FLAG_NORMAL), + id(0) { arguments.push_back(p_param1); arguments.push_back(p_param2); arguments.push_back(p_param3); arguments.push_back(p_param4); } -MethodInfo::MethodInfo(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), - flags(METHOD_FLAG_NORMAL), - id(0) { +MethodInfo::MethodInfo(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), + flags(METHOD_FLAG_NORMAL), + id(0) { arguments.push_back(p_param1); arguments.push_back(p_param2); arguments.push_back(p_param3); @@ -213,48 +213,48 @@ MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const arguments.push_back(p_param5); } -MethodInfo::MethodInfo(Variant::Type ret) - : flags(METHOD_FLAG_NORMAL), - id(0) { +MethodInfo::MethodInfo(Variant::Type ret) : + flags(METHOD_FLAG_NORMAL), + id(0) { return_val.type = ret; } -MethodInfo::MethodInfo(Variant::Type ret, const String &p_name) - : name(p_name), - flags(METHOD_FLAG_NORMAL), - id(0) { +MethodInfo::MethodInfo(Variant::Type ret, const String &p_name) : + name(p_name), + flags(METHOD_FLAG_NORMAL), + id(0) { return_val.type = ret; } -MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1) - : name(p_name), - flags(METHOD_FLAG_NORMAL), - id(0) { +MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1) : + name(p_name), + flags(METHOD_FLAG_NORMAL), + id(0) { return_val.type = ret; arguments.push_back(p_param1); } -MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2) - : name(p_name), - flags(METHOD_FLAG_NORMAL), - id(0) { +MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2) : + name(p_name), + flags(METHOD_FLAG_NORMAL), + id(0) { return_val.type = ret; arguments.push_back(p_param1); arguments.push_back(p_param2); } -MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3) - : name(p_name), - flags(METHOD_FLAG_NORMAL), - id(0) { +MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3) : + name(p_name), + flags(METHOD_FLAG_NORMAL), + id(0) { return_val.type = ret; arguments.push_back(p_param1); arguments.push_back(p_param2); arguments.push_back(p_param3); } -MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4) - : name(p_name), - flags(METHOD_FLAG_NORMAL), - id(0) { +MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4) : + name(p_name), + flags(METHOD_FLAG_NORMAL), + id(0) { return_val.type = ret; arguments.push_back(p_param1); arguments.push_back(p_param2); @@ -262,10 +262,10 @@ MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyIn arguments.push_back(p_param4); } -MethodInfo::MethodInfo(Variant::Type 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), - flags(METHOD_FLAG_NORMAL), - id(0) { +MethodInfo::MethodInfo(Variant::Type 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), + flags(METHOD_FLAG_NORMAL), + id(0) { return_val.type = ret; arguments.push_back(p_param1); arguments.push_back(p_param2); @@ -274,56 +274,56 @@ MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyIn arguments.push_back(p_param5); } -MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name) - : name(p_name), - flags(METHOD_FLAG_NORMAL), - return_val(p_ret), - id(0) { +MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name) : + name(p_name), + flags(METHOD_FLAG_NORMAL), + return_val(p_ret), + id(0) { } -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) { +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) { 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) { +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) { 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) { +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) { arguments.push_back(p_param1); arguments.push_back(p_param2); arguments.push_back(p_param3); } -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) { +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) { arguments.push_back(p_param1); arguments.push_back(p_param2); arguments.push_back(p_param3); arguments.push_back(p_param4); } -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) { +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) { 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 0a0c781649..3d93953227 100644 --- a/core/object.h +++ b/core/object.h @@ -1,4 +1,4 @@ -/*************************************************************************/ +/*************************************************************************/ /* object.h */ /*************************************************************************/ /* This file is part of: */ @@ -144,18 +144,18 @@ struct PropertyInfo { static PropertyInfo from_dict(const Dictionary &p_dict); - PropertyInfo() - : type(Variant::NIL), - hint(PROPERTY_HINT_NONE), - usage(PROPERTY_USAGE_DEFAULT) { + PropertyInfo() : + type(Variant::NIL), + 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), - hint(p_hint), - hint_string(p_hint_string), - usage(p_usage) { + 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), + hint(p_hint), + hint_string(p_hint_string), + usage(p_usage) { if (hint == PROPERTY_HINT_RESOURCE_TYPE) { class_name = hint_string; @@ -164,11 +164,11 @@ struct PropertyInfo { } } - PropertyInfo(const StringName &p_class_name) - : type(Variant::OBJECT), - class_name(p_class_name), - hint(PROPERTY_HINT_NONE), - usage(PROPERTY_USAGE_DEFAULT) { + PropertyInfo(const StringName &p_class_name) : + type(Variant::OBJECT), + class_name(p_class_name), + hint(PROPERTY_HINT_NONE), + usage(PROPERTY_USAGE_DEFAULT) { } bool operator<(const PropertyInfo &p_info) const { @@ -428,9 +428,9 @@ private: _FORCE_INLINE_ bool operator<(const Target &p_target) const { return (_id == p_target._id) ? (method < p_target.method) : (_id < p_target._id); } - Target(const ObjectID &p_id, const StringName &p_method) - : _id(p_id), - method(p_method) { + Target(const ObjectID &p_id, const StringName &p_method) : + _id(p_id), + method(p_method) { } Target() { _id = 0; } }; diff --git a/core/ordered_hash_map.h b/core/ordered_hash_map.h index 1ed5a5d369..fed16809e6 100644 --- a/core/ordered_hash_map.h +++ b/core/ordered_hash_map.h @@ -68,8 +68,10 @@ public: } public: - _FORCE_INLINE_ Element() - : list_element(NULL), prev_element(NULL), next_element(NULL) { + _FORCE_INLINE_ Element() : + list_element(NULL), + prev_element(NULL), + next_element(NULL) { } Element next() const { @@ -80,10 +82,10 @@ public: return Element(prev_element); } - Element(const Element &other) - : list_element(other.list_element), - prev_element(other.prev_element), - next_element(other.next_element) { + Element(const Element &other) : + list_element(other.list_element), + prev_element(other.prev_element), + next_element(other.next_element) { } Element &operator=(const Element &other) { @@ -135,17 +137,17 @@ public: const typename InternalList::Element *list_element; - ConstElement(const typename InternalList::Element *p_element) - : list_element(p_element) { + ConstElement(const typename InternalList::Element *p_element) : + list_element(p_element) { } public: - _FORCE_INLINE_ ConstElement() - : list_element(NULL) { + _FORCE_INLINE_ ConstElement() : + list_element(NULL) { } - ConstElement(const ConstElement &other) - : list_element(other.list_element) { + ConstElement(const ConstElement &other) : + list_element(other.list_element) { } ConstElement &operator=(const ConstElement &other) { diff --git a/core/os/os.h b/core/os/os.h index 91fbf082bf..4f968020cc 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -195,7 +195,7 @@ public: virtual void set_ime_position(const Point2 &p_pos) {} virtual void set_ime_intermediate_text_callback(ImeCallback p_callback, void *p_inp) {} - virtual Error open_dynamic_library(const String p_path, void *&p_library_handle,bool p_also_set_library_path=false) { return ERR_UNAVAILABLE; } + virtual Error open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path = false) { return ERR_UNAVAILABLE; } virtual Error close_dynamic_library(void *p_library_handle) { return ERR_UNAVAILABLE; } virtual Error get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle, bool p_optional = false) { return ERR_UNAVAILABLE; } diff --git a/core/pair.h b/core/pair.h index 535c3355b6..aa51b77a4f 100644 --- a/core/pair.h +++ b/core/pair.h @@ -37,9 +37,9 @@ struct Pair { S second; Pair() {} - Pair(F p_first, const S &p_second) - : first(p_first), - second(p_second) { + Pair(F p_first, const S &p_second) : + first(p_first), + second(p_second) { } }; diff --git a/core/project_settings.h b/core/project_settings.h index 1c4078cebb..d8a1ea1f7a 100644 --- a/core/project_settings.h +++ b/core/project_settings.h @@ -58,18 +58,18 @@ protected: Variant initial; bool hide_from_editor; bool overrided; - VariantContainer() - : order(0), - persist(false), - hide_from_editor(false), - overrided(false) { + VariantContainer() : + order(0), + persist(false), + hide_from_editor(false), + overrided(false) { } - VariantContainer(const Variant &p_variant, int p_order, bool p_persist = false) - : order(p_order), - persist(p_persist), - variant(p_variant), - hide_from_editor(false), - overrided(false) { + VariantContainer(const Variant &p_variant, int p_order, bool p_persist = false) : + order(p_order), + persist(p_persist), + variant(p_variant), + hide_from_editor(false), + overrided(false) { } }; diff --git a/core/resource.cpp b/core/resource.cpp index d339eb78ad..be6da792ad 100644 --- a/core/resource.cpp +++ b/core/resource.cpp @@ -378,8 +378,8 @@ void Resource::_bind_methods() { BIND_VMETHOD(MethodInfo("_setup_local_to_scene")); } -Resource::Resource() - : remapped_list(this) { +Resource::Resource() : + remapped_list(this) { #ifdef TOOLS_ENABLED last_modified_time = 0; diff --git a/core/safe_refcount.cpp b/core/safe_refcount.cpp index c9acdb7970..908c8a34b5 100644 --- a/core/safe_refcount.cpp +++ b/core/safe_refcount.cpp @@ -57,7 +57,7 @@ return m_val; \ } -_ALWAYS_INLINE_ uint32_t _atomic_conditional_increment_impl(register uint32_t *pw) { +_ALWAYS_INLINE_ uint32_t _atomic_conditional_increment_impl(register uint32_t *pw){ ATOMIC_CONDITIONAL_INCREMENT_BODY(pw, LONG, InterlockedCompareExchange, uint32_t) } @@ -82,12 +82,12 @@ _ALWAYS_INLINE_ uint32_t _atomic_add_impl(register uint32_t *pw, register uint32 return InterlockedAdd((LONG volatile *)pw, val); } -_ALWAYS_INLINE_ uint32_t _atomic_exchange_if_greater_impl(register uint32_t *pw, register uint32_t val) { +_ALWAYS_INLINE_ uint32_t _atomic_exchange_if_greater_impl(register uint32_t *pw, register uint32_t val){ ATOMIC_EXCHANGE_IF_GREATER_BODY(pw, val, LONG, InterlockedCompareExchange, uint32_t) } -_ALWAYS_INLINE_ uint64_t _atomic_conditional_increment_impl(register uint64_t *pw) { +_ALWAYS_INLINE_ uint64_t _atomic_conditional_increment_impl(register uint64_t *pw){ ATOMIC_CONDITIONAL_INCREMENT_BODY(pw, LONGLONG, InterlockedCompareExchange64, uint64_t) } @@ -112,7 +112,7 @@ _ALWAYS_INLINE_ uint64_t _atomic_add_impl(register uint64_t *pw, register uint64 return InterlockedAdd64((LONGLONG volatile *)pw, val); } -_ALWAYS_INLINE_ uint64_t _atomic_exchange_if_greater_impl(register uint64_t *pw, register uint64_t val) { +_ALWAYS_INLINE_ uint64_t _atomic_exchange_if_greater_impl(register uint64_t *pw, register uint64_t val){ ATOMIC_EXCHANGE_IF_GREATER_BODY(pw, val, LONGLONG, InterlockedCompareExchange64, uint64_t) } diff --git a/core/script_debugger_remote.cpp b/core/script_debugger_remote.cpp index 495c99c122..658b72b47a 100644 --- a/core/script_debugger_remote.cpp +++ b/core/script_debugger_remote.cpp @@ -989,25 +989,25 @@ void ScriptDebuggerRemote::profiling_set_frame_times(float p_frame_time, float p ScriptDebuggerRemote::ResourceUsageFunc ScriptDebuggerRemote::resource_usage_func = NULL; -ScriptDebuggerRemote::ScriptDebuggerRemote() - : profiling(false), - max_frame_functions(16), - skip_profile_frame(false), - reload_all_scripts(false), - tcp_client(StreamPeerTCP::create_ref()), - packet_peer_stream(Ref<PacketPeerStream>(memnew(PacketPeerStream))), - last_perf_time(0), - performance(Engine::get_singleton()->get_singleton_object("Performance")), - requested_quit(false), - mutex(Mutex::create()), - max_cps(GLOBAL_GET("network/limits/debugger_stdout/max_chars_per_second")), - char_count(0), - last_msec(0), - msec_count(0), - locking(false), - poll_every(0), - request_scene_tree(NULL), - live_edit_funcs(NULL) { +ScriptDebuggerRemote::ScriptDebuggerRemote() : + profiling(false), + max_frame_functions(16), + skip_profile_frame(false), + reload_all_scripts(false), + tcp_client(StreamPeerTCP::create_ref()), + packet_peer_stream(Ref<PacketPeerStream>(memnew(PacketPeerStream))), + last_perf_time(0), + performance(Engine::get_singleton()->get_singleton_object("Performance")), + requested_quit(false), + mutex(Mutex::create()), + max_cps(GLOBAL_GET("network/limits/debugger_stdout/max_chars_per_second")), + char_count(0), + last_msec(0), + msec_count(0), + locking(false), + poll_every(0), + request_scene_tree(NULL), + live_edit_funcs(NULL) { packet_peer_stream->set_stream_peer(tcp_client); packet_peer_stream->set_output_buffer_max_size(1024 * 1024 * 8); //8mb should be way more than enough diff --git a/core/script_language.cpp b/core/script_language.cpp index 384e41e4bd..c1e9d55872 100644 --- a/core/script_language.cpp +++ b/core/script_language.cpp @@ -387,10 +387,10 @@ void PlaceHolderScriptInstance::update(const List<PropertyInfo> &p_properties, c //change notify } -PlaceHolderScriptInstance::PlaceHolderScriptInstance(ScriptLanguage *p_language, Ref<Script> p_script, Object *p_owner) - : owner(p_owner), - language(p_language), - script(p_script) { +PlaceHolderScriptInstance::PlaceHolderScriptInstance(ScriptLanguage *p_language, Ref<Script> p_script, Object *p_owner) : + owner(p_owner), + language(p_language), + script(p_script) { } PlaceHolderScriptInstance::~PlaceHolderScriptInstance() { diff --git a/core/translation.cpp b/core/translation.cpp index dcca58692a..515b5f1134 100644 --- a/core/translation.cpp +++ b/core/translation.cpp @@ -876,8 +876,8 @@ void Translation::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::STRING, "locale"), "set_locale", "get_locale"); } -Translation::Translation() - : locale("en") { +Translation::Translation() : + locale("en") { } /////////////////////////////////////////////// @@ -1163,9 +1163,9 @@ void TranslationServer::load_translations() { } } -TranslationServer::TranslationServer() - : locale("en"), - enabled(true) { +TranslationServer::TranslationServer() : + locale("en"), + enabled(true) { singleton = this; for (int i = 0; locale_list[i]; ++i) { diff --git a/core/typedefs.h b/core/typedefs.h index c509edf9fe..889513ddc9 100644 --- a/core/typedefs.h +++ b/core/typedefs.h @@ -73,7 +73,7 @@ T *_nullptr() { #define OFFSET_OF(st, m) \ ((size_t)((char *)&(_nullptr<st>()->m) - (char *)0)) -/** + /** * Some platforms (devices) not define NULL */ @@ -81,7 +81,7 @@ T *_nullptr() { #define NULL 0 #endif -/** + /** * Windows defines a lot of badly stuff we'll never ever use. undefine it. */ @@ -103,7 +103,7 @@ T *_nullptr() { #include "error_list.h" #include "error_macros.h" -/** Generic ABS function, for math uses please use Math::abs */ + /** Generic ABS function, for math uses please use Math::abs */ #ifndef ABS #define ABS(m_v) ((m_v < 0) ? (-(m_v)) : (m_v)) diff --git a/core/variant.cpp b/core/variant.cpp index 0f97b98a6f..7f0cabbce4 100644 --- a/core/variant.cpp +++ b/core/variant.cpp @@ -67,7 +67,6 @@ String Variant::get_type_name(Variant::Type p_type) { } break; // math types - case VECTOR2: { return "Vector2"; @@ -725,7 +724,6 @@ bool Variant::is_zero() const { } break; // math types - case VECTOR2: { return *reinterpret_cast<const Vector2 *>(_data._mem) == Vector2(); @@ -934,7 +932,6 @@ void Variant::reference(const Variant &p_variant) { } break; // math types - case VECTOR2: { memnew_placement(_data._mem, Vector2(*reinterpret_cast<const Vector2 *>(p_variant._data._mem))); @@ -2506,7 +2503,6 @@ void Variant::operator=(const Variant &p_variant) { } break; // math types - case VECTOR2: { *reinterpret_cast<Vector2 *>(_data._mem) = *reinterpret_cast<const Vector2 *>(p_variant._data._mem); @@ -2645,8 +2641,8 @@ uint32_t Variant::hash() const { return reinterpret_cast<const String *>(_data._mem)->hash(); } break; - // math types + // math types case VECTOR2: { uint32_t hash = hash_djb2_one_float(reinterpret_cast<const Vector2 *>(_data._mem)->x); diff --git a/core/variant_call.cpp b/core/variant_call.cpp index 10f5ca0ce1..991573e8d7 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -130,9 +130,9 @@ struct _VariantCall { StringName name; Variant::Type type; Arg() { type = Variant::NIL; } - Arg(Variant::Type p_type, const StringName &p_name) - : name(p_name), - type(p_type) { + Arg(Variant::Type p_type, const StringName &p_name) : + name(p_name), + type(p_type) { } }; diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index deddaffdc6..de5dc18702 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -1277,7 +1277,7 @@ </constant> <constant name="PROPERTY_USAGE_DEFAULT_INTL" value="71" enum="PropertyUsageFlags"> </constant> - <constant name="PROPERTY_USAGE_NOEDITOR" value="5" enum="PropertyUsageFlags"> + <constant name="PROPERTY_USAGE_NOEDITOR" value="1048581" enum="PropertyUsageFlags"> </constant> <constant name="METHOD_FLAG_NORMAL" value="1" enum="MethodFlags"> Flag for normal method diff --git a/doc/classes/ARVRController.xml b/doc/classes/ARVRController.xml index d813479cf1..47a9341643 100644 --- a/doc/classes/ARVRController.xml +++ b/doc/classes/ARVRController.xml @@ -31,7 +31,7 @@ <return type="bool"> </return> <description> - Returns true if the controller bound to this node is currently active and being tracked. + Returns [code]true[/code] if the bound controller is active. ARVR systems attempt to track active controllers. </description> </method> <method name="get_joystick_axis" qualifiers="const"> @@ -56,7 +56,7 @@ <argument index="0" name="button" type="int"> </argument> <description> - Is the given button currently pressed? + Returns [code]true[/code] if the button at index [code]button[/code] is pressed. </description> </method> </methods> @@ -65,6 +65,7 @@ The controller's id. The first controller that the [ARVRServer] detects will have id 1, the second id 2, the third id 3, etc. When a controller is turned off, it's slot is freed. This ensures controllers will keep the same id even when controllers with lower ids are turned off. </member> <member name="rumble" type="float" setter="set_rumble" getter="get_rumble"> + The degree to which the tracker rumbles. Ranges from [code]0.0[/code] to [code]1.0[/code] with precision [code].01[/code]. If changed, updates [member ARVRPositionalTracker.rumble] accordingly. </member> </members> <signals> @@ -72,14 +73,14 @@ <argument index="0" name="button" type="int"> </argument> <description> - When a button on this controller is pressed, this signal is given. + Emitted when a button on this controller is pressed. </description> </signal> <signal name="button_release"> <argument index="0" name="button" type="int"> </argument> <description> - When a button on this controller is released, this signal is given. + Emitted when a button on this controller is released. </description> </signal> </signals> diff --git a/doc/classes/ARVRPositionalTracker.xml b/doc/classes/ARVRPositionalTracker.xml index f171e4fc5a..88740f5dc1 100644 --- a/doc/classes/ARVRPositionalTracker.xml +++ b/doc/classes/ARVRPositionalTracker.xml @@ -31,35 +31,35 @@ <return type="String"> </return> <description> - If available this returns the name of the controller or anchor point. + Returns the controller or anchor point's name if available. </description> </method> <method name="get_orientation" qualifiers="const"> <return type="Basis"> </return> <description> - Returns the orientation matrix of the controller. + Returns the controller's orientation matrix. </description> </method> <method name="get_position" qualifiers="const"> <return type="Vector3"> </return> <description> - Returns the position of the controller adjusted by world scale. + Returns the world-space controller position. </description> </method> <method name="get_tracks_orientation" qualifiers="const"> <return type="bool"> </return> <description> - Returns true if the orientation of this device is being tracked. + Returns [code]true[/code] if this device tracks orientation. </description> </method> <method name="get_tracks_position" qualifiers="const"> <return type="bool"> </return> <description> - Returns true if the position of this device is being tracked. + Returns [code]true[/code] if this device tracks position. </description> </method> <method name="get_transform" qualifiers="const"> @@ -68,19 +68,20 @@ <argument index="0" name="adjust_by_reference_frame" type="bool"> </argument> <description> - Returns the transform combining the orientation and position of this device. + Returns the transform combining this device's orientation and position. </description> </method> <method name="get_type" qualifiers="const"> <return type="int" enum="ARVRServer.TrackerType"> </return> <description> - Type of tracker. + Returns the tracker's type. </description> </method> </methods> <members> <member name="rumble" type="float" setter="set_rumble" getter="get_rumble"> + The degree to which the tracker rumbles. Ranges from [code]0.0[/code] to [code]1.0[/code] with precision [code].01[/code]. </member> </members> <constants> diff --git a/doc/classes/AStar.xml b/doc/classes/AStar.xml index acbd49afb9..eefdf4d7a7 100644 --- a/doc/classes/AStar.xml +++ b/doc/classes/AStar.xml @@ -47,7 +47,7 @@ Adds a new point at the given position with the given identifier. The algorithm prefers points with lower [code]weight_scale[/code] to form a path. The [code]id[/code] must be 0 or larger, and the [code]weight_scale[/code] must be 1 or larger. [codeblock] var as = AStar.new() - + as.add_point(1, Vector3(1,0,0), 4) # Adds the point (1,0,0) with weight_scale=4 and id=1 [/codeblock] If there already exists a point for the given id, its position and weight scale are updated to the given values. @@ -84,10 +84,10 @@ Creates a segment between the given points. [codeblock] var as = AStar.new() - + as.add_point(1, Vector3(1,1,0)) as.add_point(2, Vector3(0,5,0)) - + as.connect_points(1, 2, false) # If bidirectional=false it's only possible to go from point 1 to point 2 # and not from point 2 to point 1. [/codeblock] @@ -129,12 +129,12 @@ Returns the closest position to [code]to_position[/code] that resides inside a segment between two connected points. [codeblock] var as = AStar.new() - + as.add_point(1, Vector3(0,0,0)) as.add_point(2, Vector3(0,5,0)) - + as.connect_points(1, 2) - + var res = as.get_closest_position_in_segment(Vector3(3,3,0)) # returns (0, 3, 0) [/codeblock] The result is in the segment that goes from [code]y=0[/code] to [code]y=5[/code]. It's the closest position in the segment to the given point. @@ -151,18 +151,18 @@ Returns an array with the ids of the points that form the path found by AStar between the given points. The array is ordered from the starting point to the ending point of the path. [codeblock] var as = AStar.new() - + as.add_point(1, Vector3(0,0,0)) as.add_point(2, Vector3(0,1,0), 1) # default weight is 1 as.add_point(3, Vector3(1,1,0)) as.add_point(4, Vector3(2,0,0)) - + as.connect_points(1, 2, false) as.connect_points(2, 3, false) as.connect_points(4, 3, false) as.connect_points(1, 4, false) as.connect_points(5, 4, false) - + var res = as.get_id_path(1, 3) # returns [1, 2, 3] [/codeblock] If you change the 2nd point's weight to 3, then the result will be [code][1, 4, 3][/code] instead, because now even though the distance is longer, it's "easier" to get through point 4 than through point 2. @@ -223,6 +223,7 @@ <return type="Array"> </return> <description> + Returns an array of all points. </description> </method> <method name="has_point" qualifiers="const"> diff --git a/doc/classes/AnimationPlayer.xml b/doc/classes/AnimationPlayer.xml index 09ace05bfb..3b1ce37619 100644 --- a/doc/classes/AnimationPlayer.xml +++ b/doc/classes/AnimationPlayer.xml @@ -74,6 +74,20 @@ Returns the name of [code]animation[/code] or empty string if not found. </description> </method> + <method name="get_anim_length" qualifiers="const"> + <return type="float"> + </return> + <description> + Get the length (in seconds) of the currently playing animation. + </description> + </method> + <method name="get_anim_position" qualifiers="const"> + <return type="float"> + </return> + <description> + Get the position (in seconds) of the currently playing animation. + </description> + </method> <method name="get_animation" qualifiers="const"> <return type="Animation"> </return> @@ -90,13 +104,6 @@ Returns the list of stored animation names. </description> </method> - <method name="get_autoplay" qualifiers="const"> - <return type="String"> - </return> - <description> - Returns the name of the animation played when the scene loads. - </description> - </method> <method name="get_blend_time" qualifiers="const"> <return type="float"> </return> @@ -115,27 +122,6 @@ Returns the name of the currently playing animation. </description> </method> - <method name="get_anim_length" qualifiers="const"> - <return type="float"> - </return> - <description> - Get the length (in seconds) of the currently playing animation. - </description> - </method> - <method name="get_anim_position" qualifiers="const"> - <return type="float"> - </return> - <description> - Get the position (in seconds) of the currently playing animation. - </description> - </method> - <method name="get_speed_scale" qualifiers="const"> - <return type="float"> - </return> - <description> - Get the speed scaling ratio in a given animation channel (or channel 0 if none is provided). Default ratio is [i]1[/i] (no scaling). - </description> - </method> <method name="has_animation" qualifiers="const"> <return type="bool"> </return> @@ -145,13 +131,6 @@ Returns [code]true[/code] if the [code]AnimationPlayer[/code] stores an [Animation] with key [code]name[/code]. </description> </method> - <method name="is_active" qualifiers="const"> - <return type="bool"> - </return> - <description> - Returns true if the player is active. - </description> - </method> <method name="is_playing" qualifiers="const"> <return type="bool"> </return> @@ -225,24 +204,6 @@ Seek the animation to the [code]seconds[/code] point in time (in seconds). If 'update' is true, the animation updates too, otherwise it updates at process time. </description> </method> - <method name="set_active"> - <return type="void"> - </return> - <argument index="0" name="active" type="bool"> - </argument> - <description> - Set the player as active (playing). If false, it will do nothing. - </description> - </method> - <method name="set_autoplay"> - <return type="void"> - </return> - <argument index="0" name="name" type="String"> - </argument> - <description> - Set the name of the animation that will be automatically played when the scene is loaded. - </description> - </method> <method name="set_blend_time"> <return type="void"> </return> @@ -265,15 +226,6 @@ Set the current animation (even if no playback occurs). Using set_current_animation() and set_active() are similar to calling play(). </description> </method> - <method name="set_speed_scale"> - <return type="void"> - </return> - <argument index="0" name="speed" type="float"> - </argument> - <description> - Set a speed scaling ratio in a given animation channel (or channel 0 if none is provided). Default ratio is [i]1[/i] (no scaling). - </description> - </method> <method name="stop"> <return type="void"> </return> @@ -292,6 +244,12 @@ </method> </methods> <members> + <member name="active" type="bool" setter="set_active" getter="is_active"> + If [code]true[/code] updates animations in response to process-related notifications. Default value: [code]true[/code]. + </member> + <member name="autoplay" type="String" setter="set_autoplay" getter="get_autoplay"> + The name of the animation to play when the scene loads. Default value: [code]""[/code]. + </member> <member name="playback_default_blend_time" type="float" setter="set_default_blend_time" getter="get_default_blend_time"> The default time in which to blend animations. Ranges from 0 to 4096 with 0.01 precision. Default value: [code]0[/code]. </member> @@ -301,18 +259,9 @@ <member name="root_node" type="NodePath" setter="set_root" getter="get_root"> The node from which node path references will travel. Default value: [code]".."[/code]. </member> - <member name="autoplay" type="String" setter="set_autoplay" getter="get_autoplay"> - The name of the animation to play when the scene loads. Default value: [code]""[/code]. - </member> <member name="speed_scale" type="float" setter="set_speed_scale" getter="get_speed_scale"> The speed scaling ratio in a given animation channel (or channel 0 if none is provided). Default value: [code]1[/code]. </member> - <member name="active" type="bool" setter="set_active" getter="is_active"> - If [code]true[/code] updates animations in response to process-related notifications. Default value: [code]true[/code]. - </member> - <member name="current_anim" type="String" setter="set_current_anim" getter="get_current_anim"> - The name of the current animation. If already playing, restarts the animation. Ensure [member active] is [code]true[/code] to simulate [method play]. Default value: [code]""[/code]. - </member> </members> <signals> <signal name="animation_changed"> diff --git a/doc/classes/AtlasTexture.xml b/doc/classes/AtlasTexture.xml index 33566d9ec1..f1a79bc312 100644 --- a/doc/classes/AtlasTexture.xml +++ b/doc/classes/AtlasTexture.xml @@ -18,6 +18,7 @@ The texture that contains the atlas. Can be any [Texture] subtype. </member> <member name="filter_clip" type="bool" setter="set_filter_clip" getter="has_filter_clip"> + If [code]true[/code] clips the area outside of the region to avoid bleeding of the surrounding texture pixels. </member> <member name="margin" type="Rect2" setter="set_margin" getter="get_margin"> The margin around the region. The [Rect2]'s 'size' parameter ('w' and 'h' in the editor) resizes the texture so it fits within the margin. diff --git a/doc/classes/AudioStreamSample.xml b/doc/classes/AudioStreamSample.xml index ac8cc7a445..83e9729bc1 100644 --- a/doc/classes/AudioStreamSample.xml +++ b/doc/classes/AudioStreamSample.xml @@ -11,11 +11,22 @@ <demos> </demos> <methods> + <method name="get_data" qualifiers="const"> + <return type="PoolByteArray"> + </return> + <description> + </description> + </method> + <method name="set_data"> + <return type="void"> + </return> + <argument index="0" name="data" type="PoolByteArray"> + </argument> + <description> + </description> + </method> </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> diff --git a/doc/classes/Basis.xml b/doc/classes/Basis.xml index 5b3b27ec60..a873bd9a27 100644 --- a/doc/classes/Basis.xml +++ b/doc/classes/Basis.xml @@ -171,10 +171,13 @@ </methods> <members> <member name="x" type="Vector3" setter="" getter=""> + The basis matrix's x vector. </member> <member name="y" type="Vector3" setter="" getter=""> + The basis matrix's y vector. </member> <member name="z" type="Vector3" setter="" getter=""> + The basis matrix's z vector. </member> </members> <constants> diff --git a/doc/classes/BitMap.xml b/doc/classes/BitMap.xml index 9e2cd616f2..39bf46ac3d 100644 --- a/doc/classes/BitMap.xml +++ b/doc/classes/BitMap.xml @@ -75,13 +75,6 @@ </description> </method> </methods> - <members> - <member name="data" type="Dictionary" setter="_set_data" getter="_get_data"> - Returns a [Dictionary] with two keys : - [code]data[/code] : [PoolByteArray] with [code]true[/code]/[code]false[/code] [code]BitMap[/code] data. - [code]size[/code] : The [code]Bitmap[/code]'s size. - </member> - </members> <constants> </constants> </class> diff --git a/doc/classes/BitmapFont.xml b/doc/classes/BitmapFont.xml index 6d98c5e629..2fb7d7d87a 100644 --- a/doc/classes/BitmapFont.xml +++ b/doc/classes/BitmapFont.xml @@ -109,9 +109,6 @@ <member name="ascent" type="float" setter="set_ascent" getter="get_ascent"> Ascent (number of pixels above the baseline). </member> - <member name="chars" type="PoolIntArray" setter="_set_chars" getter="_get_chars"> - The characters in the BitmapFont. - </member> <member name="distance_field" type="bool" setter="set_distance_field_hint" getter="is_distance_field_hint"> If [code]true[/code] distance field hint is enabled. </member> @@ -121,12 +118,6 @@ <member name="height" type="float" setter="set_height" getter="get_height"> Total font height (ascent plus descent) in pixels. </member> - <member name="kernings" type="PoolIntArray" setter="_set_kernings" getter="_get_kernings"> - The font's kernings as [PoolIntArray]. - </member> - <member name="textures" type="Array" setter="_set_textures" getter="_get_textures"> - The font's [Texture]s. - </member> </members> <constants> </constants> diff --git a/doc/classes/ColorPickerButton.xml b/doc/classes/ColorPickerButton.xml index ee34b2bcd1..185460eef2 100644 --- a/doc/classes/ColorPickerButton.xml +++ b/doc/classes/ColorPickerButton.xml @@ -22,7 +22,7 @@ <return type="PopupPanel"> </return> <description> - Returns the control's [PopupPanel] which allows you to connect to Popup Signals. This allows you to handle events when the ColorPicker is shown or hidden. + Returns the control's [PopupPanel] which allows you to connect to Popup Signals. This allows you to handle events when the ColorPicker is shown or hidden. </description> </method> </methods> diff --git a/doc/classes/Curve.xml b/doc/classes/Curve.xml index 4c9ced63c8..3e1158ca3b 100644 --- a/doc/classes/Curve.xml +++ b/doc/classes/Curve.xml @@ -169,8 +169,6 @@ </method> </methods> <members> - <member name="_data" type="Array" setter="_set_data" getter="_get_data"> - </member> <member name="bake_resolution" type="int" setter="set_bake_resolution" getter="get_bake_resolution"> </member> <member name="max_value" type="float" setter="set_max_value" getter="get_max_value"> diff --git a/doc/classes/Curve2D.xml b/doc/classes/Curve2D.xml index 8b86359cc5..8a857799e6 100644 --- a/doc/classes/Curve2D.xml +++ b/doc/classes/Curve2D.xml @@ -175,9 +175,6 @@ </method> </methods> <members> - <member name="_data" type="Dictionary" setter="_set_data" getter="_get_data"> - The points describing the curve. Value is a [Dictionary] with the keys [code]in[/code], [code]out[/code], and [code]pos[/code]. The key pos is the position of a vertex of the curve, the key in is the vector from that position to the control point before this vertex, the key out is the vector from that position to the controlpoint after this vertex. - </member> <member name="bake_interval" type="float" setter="set_bake_interval" getter="get_bake_interval"> The distance in pixels between two adjacent cached points. Changing it forces the cache to be recomputed the next time the [method get_baked_points] or [method get_baked_length] function is called. The smaller the distance, the more points in the cache and the more memory it will consume, so use with care. </member> diff --git a/doc/classes/Curve3D.xml b/doc/classes/Curve3D.xml index c758e1d9da..e30ae85617 100644 --- a/doc/classes/Curve3D.xml +++ b/doc/classes/Curve3D.xml @@ -202,8 +202,6 @@ </method> </methods> <members> - <member name="_data" type="Dictionary" setter="_set_data" getter="_get_data"> - </member> <member name="bake_interval" type="float" setter="set_bake_interval" getter="get_bake_interval"> </member> </members> diff --git a/doc/classes/EditorFileDialog.xml b/doc/classes/EditorFileDialog.xml index 4529a473c6..1a1c382e59 100644 --- a/doc/classes/EditorFileDialog.xml +++ b/doc/classes/EditorFileDialog.xml @@ -26,42 +26,6 @@ Removes all filters except for "All Files (*)". </description> </method> - <method name="get_access" qualifiers="const"> - <return type="int" enum="EditorFileDialog.Access"> - </return> - <description> - </description> - </method> - <method name="get_current_dir" qualifiers="const"> - <return type="String"> - </return> - <description> - </description> - </method> - <method name="get_current_file" qualifiers="const"> - <return type="String"> - </return> - <description> - </description> - </method> - <method name="get_current_path" qualifiers="const"> - <return type="String"> - </return> - <description> - </description> - </method> - <method name="get_display_mode" qualifiers="const"> - <return type="int" enum="EditorFileDialog.DisplayMode"> - </return> - <description> - </description> - </method> - <method name="get_mode" qualifiers="const"> - <return type="int" enum="EditorFileDialog.Mode"> - </return> - <description> - </description> - </method> <method name="get_vbox"> <return type="VBoxContainer"> </return> @@ -76,93 +40,11 @@ Notify the [code]EditorFileDialog[/code] that its view of the data is no longer accurate. Updates the view contents on next view update. </description> </method> - <method name="is_overwrite_warning_disabled" qualifiers="const"> - <return type="bool"> - </return> - <description> - </description> - </method> - <method name="is_showing_hidden_files" qualifiers="const"> - <return type="bool"> - </return> - <description> - </description> - </method> - <method name="set_access"> - <return type="void"> - </return> - <argument index="0" name="access" type="int" enum="EditorFileDialog.Access"> - </argument> - <description> - </description> - </method> - <method name="set_current_dir"> - <return type="void"> - </return> - <argument index="0" name="dir" type="String"> - </argument> - <description> - </description> - </method> - <method name="set_current_file"> - <return type="void"> - </return> - <argument index="0" name="file" type="String"> - </argument> - <description> - </description> - </method> - <method name="set_current_path"> - <return type="void"> - </return> - <argument index="0" name="path" type="String"> - </argument> - <description> - </description> - </method> - <method name="set_disable_overwrite_warning"> - <return type="void"> - </return> - <argument index="0" name="disable" type="bool"> - </argument> - <description> - </description> - </method> - <method name="set_display_mode"> - <return type="void"> - </return> - <argument index="0" name="mode" type="int" enum="EditorFileDialog.DisplayMode"> - </argument> - <description> - </description> - </method> - <method name="set_mode"> - <return type="void"> - </return> - <argument index="0" name="mode" type="int" enum="EditorFileDialog.Mode"> - </argument> - <description> - </description> - </method> - <method name="set_show_hidden_files"> - <return type="void"> - </return> - <argument index="0" name="show" type="bool"> - </argument> - <description> - </description> - </method> </methods> <members> - <member name="access" type="int" enum="EditorFileDialog.Access" setter="set_access" getter="get_access"> + <member name="access" type="int" setter="set_access" getter="get_access" enum="EditorFileDialog.Access"> The location from which the user may select a file, including [code]res://[/code], [code]user://[/code], and the local file system. </member> - <member name="display_mode" type="int" enum="EditorFileDialog.DisplayMode" setter="set_display_mode" getter="get_display_mode"> - The view format in which the [code]EditorFileDialog[/code] displays resources to the user. - </member> - <member name="mode" type="int" enum="EditorFileDialog.Mode" setter="set_mode" getter="get_mode"> - The purpose of the [code]EditorFileDialog[/code]. Changes allowed behaviors. - </member> <member name="current_dir" type="String" setter="set_current_dir" getter="get_current_dir"> The currently occupied directory. </member> @@ -172,12 +54,18 @@ <member name="current_path" type="String" setter="set_current_path" getter="get_current_path"> The file system path in the address bar. </member> - <member name="show_hidden_files" type="bool" setter="set_show_hidden_files" getter="is_showing_hidden_files"> - If [code]true[/code] hidden files and directories will be visible in the [code]EditorFileDialog[/code]. - </member> <member name="disable_overwrite_warning" type="bool" setter="set_disable_overwrite_warning" getter="is_overwrite_warning_disabled"> If [code]true[/code] the [code]EditorFileDialog[/code] will not warn the user before overwriting files. </member> + <member name="display_mode" type="int" setter="set_display_mode" getter="get_display_mode" enum="EditorFileDialog.DisplayMode"> + The view format in which the [code]EditorFileDialog[/code] displays resources to the user. + </member> + <member name="mode" type="int" setter="set_mode" getter="get_mode" enum="EditorFileDialog.Mode"> + The purpose of the [code]EditorFileDialog[/code]. Changes allowed behaviors. + </member> + <member name="show_hidden_files" type="bool" setter="set_show_hidden_files" getter="is_showing_hidden_files"> + If [code]true[/code] hidden files and directories will be visible in the [code]EditorFileDialog[/code]. + </member> </members> <signals> <signal name="dir_selected"> diff --git a/doc/classes/FileDialog.xml b/doc/classes/FileDialog.xml index 0f7038238e..8057e95d44 100644 --- a/doc/classes/FileDialog.xml +++ b/doc/classes/FileDialog.xml @@ -160,6 +160,8 @@ </theme_item> <theme_item name="folder" type="Texture"> </theme_item> + <theme_item name="parent_folder" type="Texture"> + </theme_item> <theme_item name="reload" type="Texture"> </theme_item> </theme_items> diff --git a/doc/classes/GIProbeData.xml b/doc/classes/GIProbeData.xml index 2ac591889c..aba59f57ea 100644 --- a/doc/classes/GIProbeData.xml +++ b/doc/classes/GIProbeData.xml @@ -9,31 +9,161 @@ <demos> </demos> <methods> + <method name="get_bias" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> + <method name="get_bounds" qualifiers="const"> + <return type="AABB"> + </return> + <description> + </description> + </method> + <method name="get_cell_size" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> + <method name="get_dynamic_data" qualifiers="const"> + <return type="PoolIntArray"> + </return> + <description> + </description> + </method> + <method name="get_dynamic_range" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="get_energy" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> + <method name="get_normal_bias" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> + <method name="get_propagation" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> + <method name="get_to_cell_xform" qualifiers="const"> + <return type="Transform"> + </return> + <description> + </description> + </method> + <method name="is_compressed" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="is_interior" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="set_bias"> + <return type="void"> + </return> + <argument index="0" name="bias" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_bounds"> + <return type="void"> + </return> + <argument index="0" name="bounds" type="AABB"> + </argument> + <description> + </description> + </method> + <method name="set_cell_size"> + <return type="void"> + </return> + <argument index="0" name="cell_size" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_compress"> + <return type="void"> + </return> + <argument index="0" name="compress" type="bool"> + </argument> + <description> + </description> + </method> + <method name="set_dynamic_data"> + <return type="void"> + </return> + <argument index="0" name="dynamic_data" type="PoolIntArray"> + </argument> + <description> + </description> + </method> + <method name="set_dynamic_range"> + <return type="void"> + </return> + <argument index="0" name="dynamic_range" type="int"> + </argument> + <description> + </description> + </method> + <method name="set_energy"> + <return type="void"> + </return> + <argument index="0" name="energy" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_interior"> + <return type="void"> + </return> + <argument index="0" name="interior" type="bool"> + </argument> + <description> + </description> + </method> + <method name="set_normal_bias"> + <return type="void"> + </return> + <argument index="0" name="bias" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_propagation"> + <return type="void"> + </return> + <argument index="0" name="propagation" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_to_cell_xform"> + <return type="void"> + </return> + <argument index="0" name="to_cell_xform" type="Transform"> + </argument> + <description> + </description> + </method> </methods> - <members> - <member name="bias" type="float" setter="set_bias" getter="get_bias"> - </member> - <member name="bounds" type="AABB" setter="set_bounds" getter="get_bounds"> - </member> - <member name="cell_size" type="float" setter="set_cell_size" getter="get_cell_size"> - </member> - <member name="compress" type="bool" setter="set_compress" getter="is_compressed"> - </member> - <member name="dynamic_data" type="PoolIntArray" setter="set_dynamic_data" getter="get_dynamic_data"> - </member> - <member name="dynamic_range" type="int" setter="set_dynamic_range" getter="get_dynamic_range"> - </member> - <member name="energy" type="float" setter="set_energy" getter="get_energy"> - </member> - <member name="interior" type="bool" setter="set_interior" getter="is_interior"> - </member> - <member name="normal_bias" type="float" setter="set_normal_bias" getter="get_normal_bias"> - </member> - <member name="propagation" type="float" setter="set_propagation" getter="get_propagation"> - </member> - <member name="to_cell_xform" type="Transform" setter="set_to_cell_xform" getter="get_to_cell_xform"> - </member> - </members> <constants> </constants> </class> diff --git a/doc/classes/ItemList.xml b/doc/classes/ItemList.xml index d10722d411..f3d0c271ac 100644 --- a/doc/classes/ItemList.xml +++ b/doc/classes/ItemList.xml @@ -332,8 +332,6 @@ </member> <member name="icon_scale" type="float" setter="set_icon_scale" getter="get_icon_scale"> </member> - <member name="items" type="Array" setter="_set_items" getter="_get_items"> - </member> <member name="max_columns" type="int" setter="set_max_columns" getter="get_max_columns"> </member> <member name="max_text_lines" type="int" setter="set_max_text_lines" getter="get_max_text_lines"> diff --git a/doc/classes/JSON.xml b/doc/classes/JSON.xml index bda205d294..bb48833878 100644 --- a/doc/classes/JSON.xml +++ b/doc/classes/JSON.xml @@ -25,6 +25,10 @@ </return> <argument index="0" name="value" type="Variant"> </argument> + <argument index="1" name="indent" type="String" default=""""> + </argument> + <argument index="2" name="sort_keys" type="bool" default="false"> + </argument> <description> Converts a Variant var to JSON text and returns the result. Useful for serializing data to store or send over the network. </description> diff --git a/doc/classes/LargeTexture.xml b/doc/classes/LargeTexture.xml index 3899254e9d..9d79034dea 100644 --- a/doc/classes/LargeTexture.xml +++ b/doc/classes/LargeTexture.xml @@ -87,14 +87,6 @@ </description> </method> </methods> - <members> - <member name="_data" type="Array" setter="_set_data" getter="_get_data"> - Returns an [Array] with offsets and textures data of each added piece. Schema is [offsets1, texture1, offsets2, texture2, large_texture_size]. - [code]offsets[/code] : [Vector2] offsets of the texture piece. - [code]second[/code] : [StreamTexture] data of the texture piece. - [code]last entry[/code] : [Vector2] size of the entire large texture. - </member> - </members> <constants> </constants> </class> diff --git a/doc/classes/LinkButton.xml b/doc/classes/LinkButton.xml index a6194d129a..82b3a90180 100644 --- a/doc/classes/LinkButton.xml +++ b/doc/classes/LinkButton.xml @@ -30,6 +30,8 @@ </constant> </constants> <theme_items> + <theme_item name="focus" type="StyleBox"> + </theme_item> <theme_item name="font" type="Font"> </theme_item> <theme_item name="font_color" type="Color"> diff --git a/doc/classes/MenuButton.xml b/doc/classes/MenuButton.xml index 6f41f84485..c41c86d693 100644 --- a/doc/classes/MenuButton.xml +++ b/doc/classes/MenuButton.xml @@ -19,10 +19,6 @@ </description> </method> </methods> - <members> - <member name="items" type="Array" setter="_set_items" getter="_get_items"> - </member> - </members> <signals> <signal name="about_to_show"> <description> diff --git a/doc/classes/MultiMesh.xml b/doc/classes/MultiMesh.xml index ae26641596..ff2d89b2ca 100644 --- a/doc/classes/MultiMesh.xml +++ b/doc/classes/MultiMesh.xml @@ -63,16 +63,12 @@ </method> </methods> <members> - <member name="color_array" type="PoolColorArray" setter="_set_color_array" getter="_get_color_array"> - </member> <member name="color_format" type="int" setter="set_color_format" getter="get_color_format" enum="MultiMesh.ColorFormat"> </member> <member name="instance_count" type="int" setter="set_instance_count" getter="get_instance_count"> </member> <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh"> </member> - <member name="transform_array" type="PoolVector3Array" setter="_set_transform_array" getter="_get_transform_array"> - </member> <member name="transform_format" type="int" setter="set_transform_format" getter="get_transform_format" enum="MultiMesh.TransformFormat"> </member> </members> diff --git a/doc/classes/NavigationMesh.xml b/doc/classes/NavigationMesh.xml index 5563c94b35..55a3771d79 100644 --- a/doc/classes/NavigationMesh.xml +++ b/doc/classes/NavigationMesh.xml @@ -45,6 +45,20 @@ <description> </description> </method> + <method name="get_vertices" qualifiers="const"> + <return type="PoolVector3Array"> + </return> + <description> + </description> + </method> + <method name="set_vertices"> + <return type="void"> + </return> + <argument index="0" name="vertices" type="PoolVector3Array"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="agent/height" type="float" setter="set_agent_height" getter="get_agent_height"> @@ -75,16 +89,12 @@ </member> <member name="polygon/verts_per_poly" type="float" setter="set_verts_per_poly" getter="get_verts_per_poly"> </member> - <member name="polygons" type="Array" setter="_set_polygons" getter="_get_polygons"> - </member> <member name="region/merge_size" type="float" setter="set_region_merge_size" getter="get_region_merge_size"> </member> <member name="region/min_size" type="float" setter="set_region_min_size" getter="get_region_min_size"> </member> <member name="sample_partition_type/sample_partition_type" type="int" setter="set_sample_partition_type" getter="get_sample_partition_type"> </member> - <member name="vertices" type="PoolVector3Array" setter="set_vertices" getter="get_vertices"> - </member> </members> <constants> <constant name="SAMPLE_PARTITION_WATERSHED" value="0"> diff --git a/doc/classes/NavigationPolygon.xml b/doc/classes/NavigationPolygon.xml index 585566dbf9..663ac4cd67 100644 --- a/doc/classes/NavigationPolygon.xml +++ b/doc/classes/NavigationPolygon.xml @@ -75,6 +75,12 @@ <description> </description> </method> + <method name="get_vertices" qualifiers="const"> + <return type="PoolVector2Array"> + </return> + <description> + </description> + </method> <method name="make_polygons_from_outlines"> <return type="void"> </return> @@ -99,15 +105,15 @@ <description> </description> </method> + <method name="set_vertices"> + <return type="void"> + </return> + <argument index="0" name="vertices" type="PoolVector2Array"> + </argument> + <description> + </description> + </method> </methods> - <members> - <member name="outlines" type="Array" setter="_set_outlines" getter="_get_outlines"> - </member> - <member name="polygons" type="Array" setter="_set_polygons" getter="_get_polygons"> - </member> - <member name="vertices" type="PoolVector2Array" setter="set_vertices" getter="get_vertices"> - </member> - </members> <constants> </constants> </class> diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index 13a25fa48f..e2198c3e15 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -350,6 +350,12 @@ Returns [code]true[/code] if the "node" argument is a direct or indirect child of the current node, otherwise return [code]false[code]. </description> </method> + <method name="is_displayed_folded" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> <method name="is_greater_than" qualifiers="const"> <return type="bool"> </return> @@ -641,6 +647,14 @@ Remotely changes property's value on a specific peer identified by [i]peer_id[/i] using an unreliable protocol. </description> </method> + <method name="set_display_folded"> + <return type="void"> + </return> + <argument index="0" name="fold" type="bool"> + </argument> + <description> + </description> + </method> <method name="set_filename"> <return type="void"> </return> @@ -750,10 +764,6 @@ </method> </methods> <members> - <member name="_import_path" type="NodePath" setter="_set_import_path" getter="_get_import_path"> - </member> - <member name="editor/display_folded" type="bool" setter="set_display_folded" getter="is_displayed_folded"> - </member> <member name="pause_mode" type="int" setter="set_pause_mode" getter="get_pause_mode" enum="Node.PauseMode"> </member> </members> diff --git a/doc/classes/Node2D.xml b/doc/classes/Node2D.xml index 112960d9f8..81978809d7 100644 --- a/doc/classes/Node2D.xml +++ b/doc/classes/Node2D.xml @@ -38,6 +38,12 @@ Returns the [Transform2D] relative to this node's parent. </description> </method> + <method name="get_rotation" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> <method name="global_translate"> <return type="void"> </return> @@ -87,6 +93,14 @@ Applies a rotation to the node, in radians, starting from its current rotation. </description> </method> + <method name="set_rotation"> + <return type="void"> + </return> + <argument index="0" name="radians" type="float"> + </argument> + <description> + </description> + </method> <method name="to_global" qualifiers="const"> <return type="Vector2"> </return> @@ -134,9 +148,6 @@ <member name="position" type="Vector2" setter="set_position" getter="get_position"> Position, relative to the node's parent. </member> - <member name="rotation" type="float" setter="set_rotation" getter="get_rotation"> - Rotation in radians, relative to the node's parent. - </member> <member name="rotation_degrees" type="float" setter="set_rotation_degrees" getter="get_rotation_degrees"> Rotation in degrees, relative to the node's parent. </member> diff --git a/doc/classes/OptionButton.xml b/doc/classes/OptionButton.xml index 5f1b6f328c..76265e700a 100644 --- a/doc/classes/OptionButton.xml +++ b/doc/classes/OptionButton.xml @@ -183,8 +183,6 @@ </method> </methods> <members> - <member name="items" type="Array" setter="_set_items" getter="_get_items"> - </member> <member name="selected" type="int" setter="_select_int" getter="get_selected"> </member> </members> diff --git a/doc/classes/PolygonPathFinder.xml b/doc/classes/PolygonPathFinder.xml index 58c14cc920..48c5625e6b 100644 --- a/doc/classes/PolygonPathFinder.xml +++ b/doc/classes/PolygonPathFinder.xml @@ -80,10 +80,6 @@ </description> </method> </methods> - <members> - <member name="data" type="Dictionary" setter="_set_data" getter="_get_data"> - </member> - </members> <constants> </constants> </class> diff --git a/doc/classes/PopupMenu.xml b/doc/classes/PopupMenu.xml index 6b36ff9eee..7071d64f2e 100644 --- a/doc/classes/PopupMenu.xml +++ b/doc/classes/PopupMenu.xml @@ -423,8 +423,6 @@ </member> <member name="hide_on_item_selection" type="bool" setter="set_hide_on_item_selection" getter="is_hide_on_item_selection"> </member> - <member name="items" type="Array" setter="_set_items" getter="_get_items"> - </member> </members> <signals> <signal name="id_pressed"> diff --git a/doc/classes/ProxyTexture.xml b/doc/classes/ProxyTexture.xml new file mode 100644 index 0000000000..2cdcac8775 --- /dev/null +++ b/doc/classes/ProxyTexture.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="ProxyTexture" inherits="Texture" category="Core" version="3.0-beta"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <demos> + </demos> + <methods> + </methods> + <members> + <member name="base" type="Texture" setter="set_base" getter="get_base"> + </member> + </members> + <constants> + </constants> +</class> diff --git a/doc/classes/RayCast.xml b/doc/classes/RayCast.xml index 1ec16753c2..e6f3c029af 100644 --- a/doc/classes/RayCast.xml +++ b/doc/classes/RayCast.xml @@ -139,6 +139,8 @@ <member name="enabled" type="bool" setter="set_enabled" getter="is_enabled"> If [code]true[/code], collisions will be reported. Default value: [code]false[/code]. </member> + <member name="exclude_parent" type="bool" setter="set_exclude_parent_body" getter="get_exclude_parent_body"> + </member> </members> <constants> </constants> diff --git a/doc/classes/ResourcePreloader.xml b/doc/classes/ResourcePreloader.xml index 1766845bf2..c749529a19 100644 --- a/doc/classes/ResourcePreloader.xml +++ b/doc/classes/ResourcePreloader.xml @@ -67,10 +67,6 @@ </description> </method> </methods> - <members> - <member name="resources" type="Array" setter="_set_resources" getter="_get_resources"> - </member> - </members> <constants> </constants> </class> diff --git a/doc/classes/Shader.xml b/doc/classes/Shader.xml index 543164d92e..082c48dfce 100644 --- a/doc/classes/Shader.xml +++ b/doc/classes/Shader.xml @@ -11,6 +11,12 @@ <demos> </demos> <methods> + <method name="get_code" qualifiers="const"> + <return type="String"> + </return> + <description> + </description> + </method> <method name="get_default_texture_param" qualifiers="const"> <return type="Texture"> </return> @@ -33,6 +39,14 @@ <description> </description> </method> + <method name="set_code"> + <return type="void"> + </return> + <argument index="0" name="code" type="String"> + </argument> + <description> + </description> + </method> <method name="set_default_texture_param"> <return type="void"> </return> @@ -44,10 +58,6 @@ </description> </method> </methods> - <members> - <member name="code" type="String" setter="set_code" getter="get_code"> - </member> - </members> <constants> <constant name="MODE_SPATIAL" value="0" enum="Mode"> </constant> diff --git a/doc/classes/SpatialMaterial.xml b/doc/classes/SpatialMaterial.xml index 4e63e6dd11..cf08b0daae 100644 --- a/doc/classes/SpatialMaterial.xml +++ b/doc/classes/SpatialMaterial.xml @@ -79,6 +79,8 @@ </member> <member name="emission_texture" type="Texture" setter="set_texture" getter="get_texture"> </member> + <member name="flags_albedo_tex_force_srgb" type="bool" setter="set_flag" getter="get_flag"> + </member> <member name="flags_fixed_size" type="bool" setter="set_flag" getter="get_flag"> </member> <member name="flags_no_depth_test" type="bool" setter="set_flag" getter="get_flag"> @@ -307,7 +309,9 @@ </constant> <constant name="FLAG_TRIPLANAR_USE_WORLD" value="9" enum="Flags"> </constant> - <constant name="FLAG_MAX" value="12" enum="Flags"> + <constant name="FLAG_ALBEDO_TEXTURE_FORCE_SRGB" value="12" enum="Flags"> + </constant> + <constant name="FLAG_MAX" value="13" enum="Flags"> </constant> <constant name="DIFFUSE_BURLEY" value="0" enum="DiffuseMode"> </constant> diff --git a/doc/classes/SpriteFrames.xml b/doc/classes/SpriteFrames.xml index 0157386573..883a6d4fa8 100644 --- a/doc/classes/SpriteFrames.xml +++ b/doc/classes/SpriteFrames.xml @@ -164,9 +164,6 @@ </method> </methods> <members> - <member name="animations" type="Array" setter="_set_animations" getter="_get_animations"> - An [Array] containing the [code]name[/code], [code]speed[/code], [code]loop[/code], and [code]frames[/code] of each animation. - </member> <member name="frames" type="Array" setter="_set_frames" getter="_get_frames"> </member> </members> diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index d5afe28eb8..df48ba3e23 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -470,6 +470,8 @@ </theme_item> <theme_item name="number_color" type="Color"> </theme_item> + <theme_item name="read_only" type="StyleBox"> + </theme_item> <theme_item name="selection_color" type="Color"> </theme_item> <theme_item name="symbol_color" type="Color"> diff --git a/doc/classes/Translation.xml b/doc/classes/Translation.xml index a684e63e22..cb49c66383 100644 --- a/doc/classes/Translation.xml +++ b/doc/classes/Translation.xml @@ -57,8 +57,6 @@ <members> <member name="locale" type="String" setter="set_locale" getter="get_locale"> </member> - <member name="messages" type="PoolStringArray" setter="_set_messages" getter="_get_messages"> - </member> </members> <constants> </constants> diff --git a/drivers/convex_decomp/b2d_decompose.cpp b/drivers/convex_decomp/b2d_decompose.cpp index 97d312983f..c7681ed2ad 100644 --- a/drivers/convex_decomp/b2d_decompose.cpp +++ b/drivers/convex_decomp/b2d_decompose.cpp @@ -153,7 +153,7 @@ static Vector<Vector<Vector2> > _b2d_decompose(const Vector<Vector2> &p_polygon) delete p; return res; // pdarray; //needs to be deleted after body is created } -} +} // namespace b2ConvexDecomp Vector<Vector<Vector2> > b2d_decompose(const Vector<Vector2> &p_polygon) { diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index 3031b70f70..d38ec2a1f9 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -1134,18 +1134,6 @@ bool RasterizerSceneGLES3::_setup_material(RasterizerStorageGLES3::Material *p_m state.current_depth_draw = p_material->shader->spatial.depth_draw_mode; } -//glPolygonMode(GL_FRONT_AND_BACK,GL_LINE); - -/* - if (p_material->flags[VS::MATERIAL_FLAG_WIREFRAME]) - glPolygonMode(GL_FRONT_AND_BACK,GL_LINE); - else - glPolygonMode(GL_FRONT_AND_BACK,GL_FILL); - - if (p_material->line_width) - glLineWidth(p_material->line_width); - */ - #if 0 //blend mode if (state.current_blend_mode!=p_material->shader->spatial.blend_mode) { diff --git a/drivers/gles3/rasterizer_scene_gles3.h b/drivers/gles3/rasterizer_scene_gles3.h index 99c8044e2f..ffbe10fb60 100644 --- a/drivers/gles3/rasterizer_scene_gles3.h +++ b/drivers/gles3/rasterizer_scene_gles3.h @@ -817,7 +817,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_pass,bool p_shadow_pass); + _FORCE_INLINE_ void _add_geometry(RasterizerStorageGLES3::Geometry *p_geometry, InstanceBase *p_instance, RasterizerStorageGLES3::GeometryOwner *p_owner, int p_material, bool p_depth_pass, bool p_shadow_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, bool p_shadow_pass); diff --git a/drivers/gles3/rasterizer_storage_gles3.h b/drivers/gles3/rasterizer_storage_gles3.h index d5efd5307c..25327af0a5 100644 --- a/drivers/gles3/rasterizer_storage_gles3.h +++ b/drivers/gles3/rasterizer_storage_gles3.h @@ -486,8 +486,8 @@ public: bool uses_vertex_time; bool uses_fragment_time; - Shader() - : dirty_list(this) { + Shader() : + dirty_list(this) { shader = NULL; ubo_size = 0; @@ -540,8 +540,9 @@ public: bool can_cast_shadow_cache; bool is_animated_cache; - Material() - : list(this), dirty_list(this) { + Material() : + list(this), + dirty_list(this) { can_cast_shadow_cache = false; is_animated_cache = false; shader = NULL; @@ -764,8 +765,9 @@ public: bool dirty_aabb; bool dirty_data; - MultiMesh() - : update_list(this), mesh_list(this) { + MultiMesh() : + update_list(this), + mesh_list(this) { dirty_aabb = true; dirty_data = true; xform_floats = 0; @@ -865,8 +867,8 @@ public: SelfList<Skeleton> update_list; Set<RasterizerScene::InstanceBase *> instances; //instances using skeleton - Skeleton() - : update_list(this) { + Skeleton() : + update_list(this) { size = 0; use_2d = false; @@ -1116,8 +1118,8 @@ public: Transform emission_transform; - Particles() - : particle_element(this) { + Particles() : + particle_element(this) { cycle_number = 0; emitting = false; one_shot = false; diff --git a/drivers/unix/ip_unix.cpp b/drivers/unix/ip_unix.cpp index 77c942c673..6254466efc 100644 --- a/drivers/unix/ip_unix.cpp +++ b/drivers/unix/ip_unix.cpp @@ -149,10 +149,7 @@ void IP_Unix::get_local_addresses(List<IP_Address> *r_addresses) const { while (true) { addrs = (IP_ADAPTER_ADDRESSES *)memalloc(buf_size); - int err = GetAdaptersAddresses(AF_UNSPEC, GAA_FLAG_SKIP_ANYCAST | - GAA_FLAG_SKIP_MULTICAST | - GAA_FLAG_SKIP_DNS_SERVER | - GAA_FLAG_SKIP_FRIENDLY_NAME, + int err = GetAdaptersAddresses(AF_UNSPEC, GAA_FLAG_SKIP_ANYCAST | GAA_FLAG_SKIP_MULTICAST | GAA_FLAG_SKIP_DNS_SERVER | GAA_FLAG_SKIP_FRIENDLY_NAME, NULL, addrs, &buf_size); if (err == NO_ERROR) { break; diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp index fa208f40ec..5a06a58b80 100644 --- a/drivers/unix/os_unix.cpp +++ b/drivers/unix/os_unix.cpp @@ -391,7 +391,7 @@ String OS_Unix::get_locale() const { return locale; } -Error OS_Unix::open_dynamic_library(const String p_path, void *&p_library_handle,bool p_also_set_library_path) { +Error OS_Unix::open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path) { p_library_handle = dlopen(p_path.utf8().get_data(), RTLD_NOW); if (!p_library_handle) { ERR_EXPLAIN("Can't open dynamic library: " + p_path + ". Error: " + dlerror()); diff --git a/drivers/unix/os_unix.h b/drivers/unix/os_unix.h index 325aaf7550..1a4c73ce4c 100644 --- a/drivers/unix/os_unix.h +++ b/drivers/unix/os_unix.h @@ -77,7 +77,7 @@ public: //virtual VideoMode get_video_mode() const; //virtual void get_fullscreen_mode_list(List<VideoMode> *p_list) const; - virtual Error open_dynamic_library(const String p_path, void *&p_library_handle,bool p_also_set_library_path=false); + virtual Error open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path = false); virtual Error close_dynamic_library(void *p_library_handle); virtual Error get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle, bool p_optional = false); diff --git a/drivers/xaudio2/audio_driver_xaudio2.h b/drivers/xaudio2/audio_driver_xaudio2.h index 27ef2ebcb8..dd4fc76047 100644 --- a/drivers/xaudio2/audio_driver_xaudio2.h +++ b/drivers/xaudio2/audio_driver_xaudio2.h @@ -48,8 +48,8 @@ class AudioDriverXAudio2 : public AudioDriver { struct XAudio2DriverVoiceCallback : public IXAudio2VoiceCallback { HANDLE buffer_end_event; - XAudio2DriverVoiceCallback() - : buffer_end_event(CreateEvent(NULL, FALSE, FALSE, NULL)) {} + XAudio2DriverVoiceCallback() : + buffer_end_event(CreateEvent(NULL, FALSE, FALSE, NULL)) {} void STDMETHODCALLTYPE OnBufferEnd(void *pBufferContext) { /*print_line("buffer ended");*/ SetEvent(buffer_end_event); } diff --git a/editor/editor_export.h b/editor/editor_export.h index 346c3b58e1..215a770a12 100644 --- a/editor/editor_export.h +++ b/editor/editor_export.h @@ -122,8 +122,9 @@ struct SharedObject { String path; Vector<String> tags; - SharedObject(const String &p_path, const Vector<String> &p_tags) - : path(p_path), tags(p_tags) { + SharedObject(const String &p_path, const Vector<String> &p_tags) : + path(p_path), + tags(p_tags) { } SharedObject() {} diff --git a/editor/filesystem_dock.h b/editor/filesystem_dock.h index f1fd342052..b004b1974d 100644 --- a/editor/filesystem_dock.h +++ b/editor/filesystem_dock.h @@ -128,10 +128,12 @@ private: String path; bool is_file; - FileOrFolder() - : path(""), is_file(false) {} - FileOrFolder(const String &p_path, bool p_is_file) - : path(p_path), is_file(p_is_file) {} + FileOrFolder() : + path(""), + is_file(false) {} + FileOrFolder(const String &p_path, bool p_is_file) : + path(p_path), + is_file(p_is_file) {} }; FileOrFolder to_rename; Vector<FileOrFolder> to_move; diff --git a/editor/import/editor_import_collada.cpp b/editor/import/editor_import_collada.cpp index 3c73411dee..f51bc2d6be 100644 --- a/editor/import/editor_import_collada.cpp +++ b/editor/import/editor_import_collada.cpp @@ -1913,8 +1913,6 @@ void ColladaImport::create_animation(int p_clip, bool p_make_tracks_in_all_bones /*************************************** SCENE ***********************************/ /*********************************************************************************/ -#define DEBUG_ANIMATION - uint32_t EditorSceneImporterCollada::get_import_flags() const { return IMPORT_SCENE | IMPORT_ANIMATION; diff --git a/editor/plugins/abstract_polygon_2d_editor.cpp b/editor/plugins/abstract_polygon_2d_editor.cpp index 95ae3d5aed..ff72a5a25e 100644 --- a/editor/plugins/abstract_polygon_2d_editor.cpp +++ b/editor/plugins/abstract_polygon_2d_editor.cpp @@ -32,18 +32,21 @@ #include "canvas_item_editor_plugin.h" #include "core/os/keyboard.h" -AbstractPolygon2DEditor::Vertex::Vertex() - : polygon(-1), vertex(-1) { +AbstractPolygon2DEditor::Vertex::Vertex() : + polygon(-1), + vertex(-1) { // invalid vertex } -AbstractPolygon2DEditor::Vertex::Vertex(int p_vertex) - : polygon(-1), vertex(p_vertex) { +AbstractPolygon2DEditor::Vertex::Vertex(int p_vertex) : + polygon(-1), + vertex(p_vertex) { // vertex p_vertex of current wip polygon } -AbstractPolygon2DEditor::Vertex::Vertex(int p_polygon, int p_vertex) - : polygon(p_polygon), vertex(p_vertex) { +AbstractPolygon2DEditor::Vertex::Vertex(int p_polygon, int p_vertex) : + polygon(p_polygon), + vertex(p_vertex) { // vertex p_vertex of polygon p_polygon } @@ -66,12 +69,14 @@ AbstractPolygon2DEditor::PosVertex::PosVertex() { // invalid vertex } -AbstractPolygon2DEditor::PosVertex::PosVertex(const Vertex &p_vertex, const Vector2 &p_pos) - : Vertex(p_vertex.polygon, p_vertex.vertex), pos(p_pos) { +AbstractPolygon2DEditor::PosVertex::PosVertex(const Vertex &p_vertex, const Vector2 &p_pos) : + Vertex(p_vertex.polygon, p_vertex.vertex), + pos(p_pos) { } -AbstractPolygon2DEditor::PosVertex::PosVertex(int p_polygon, int p_vertex, const Vector2 &p_pos) - : Vertex(p_polygon, p_vertex), pos(p_pos) { +AbstractPolygon2DEditor::PosVertex::PosVertex(int p_polygon, int p_vertex, const Vector2 &p_pos) : + Vertex(p_polygon, p_vertex), + pos(p_pos) { } bool AbstractPolygon2DEditor::_is_empty() const { diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index ddcdb5a321..8eee9c7e7c 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -69,8 +69,8 @@ class SnapDialog : public ConfirmationDialog { SpinBox *rotation_step; public: - SnapDialog() - : ConfirmationDialog() { + SnapDialog() : + ConfirmationDialog() { const int SPIN_BOX_GRID_RANGE = 256; const int SPIN_BOX_ROTATION_RANGE = 360; Label *label; diff --git a/editor/plugins/collision_polygon_2d_editor_plugin.cpp b/editor/plugins/collision_polygon_2d_editor_plugin.cpp index 00e6d617a1..6ac80caf94 100644 --- a/editor/plugins/collision_polygon_2d_editor_plugin.cpp +++ b/editor/plugins/collision_polygon_2d_editor_plugin.cpp @@ -39,10 +39,10 @@ void CollisionPolygon2DEditor::_set_node(Node *p_polygon) { node = Object::cast_to<CollisionPolygon2D>(p_polygon); } -CollisionPolygon2DEditor::CollisionPolygon2DEditor(EditorNode *p_editor) - : AbstractPolygon2DEditor(p_editor) { +CollisionPolygon2DEditor::CollisionPolygon2DEditor(EditorNode *p_editor) : + AbstractPolygon2DEditor(p_editor) { } -CollisionPolygon2DEditorPlugin::CollisionPolygon2DEditorPlugin(EditorNode *p_node) - : AbstractPolygon2DEditorPlugin(p_node, memnew(CollisionPolygon2DEditor(p_node)), "CollisionPolygon2D") { +CollisionPolygon2DEditorPlugin::CollisionPolygon2DEditorPlugin(EditorNode *p_node) : + AbstractPolygon2DEditorPlugin(p_node, memnew(CollisionPolygon2DEditor(p_node)), "CollisionPolygon2D") { } diff --git a/editor/plugins/curve_editor_plugin.cpp b/editor/plugins/curve_editor_plugin.cpp index 2754aeed06..f77016c1d6 100644 --- a/editor/plugins/curve_editor_plugin.cpp +++ b/editor/plugins/curve_editor_plugin.cpp @@ -586,8 +586,10 @@ struct CanvasItemPlotCurve { Color color1; Color color2; - CanvasItemPlotCurve(CanvasItem &p_ci, Color p_color1, Color p_color2) - : ci(p_ci), color1(p_color1), color2(p_color2) {} + CanvasItemPlotCurve(CanvasItem &p_ci, Color p_color1, Color p_color2) : + ci(p_ci), + color1(p_color1), + color2(p_color2) {} void operator()(Vector2 pos0, Vector2 pos1, bool in_definition) { ci.draw_line(pos0, pos1, in_definition ? color1 : color2); diff --git a/editor/plugins/line_2d_editor_plugin.cpp b/editor/plugins/line_2d_editor_plugin.cpp index 51fa488b43..04d8519b2f 100644 --- a/editor/plugins/line_2d_editor_plugin.cpp +++ b/editor/plugins/line_2d_editor_plugin.cpp @@ -61,10 +61,10 @@ void Line2DEditor::_action_set_polygon(int p_idx, const Variant &p_previous, con undo_redo->add_undo_method(node, "set_points", p_previous); } -Line2DEditor::Line2DEditor(EditorNode *p_editor) - : AbstractPolygon2DEditor(p_editor) { +Line2DEditor::Line2DEditor(EditorNode *p_editor) : + AbstractPolygon2DEditor(p_editor) { } -Line2DEditorPlugin::Line2DEditorPlugin(EditorNode *p_node) - : AbstractPolygon2DEditorPlugin(p_node, memnew(Line2DEditor(p_node)), "Line2D") { +Line2DEditorPlugin::Line2DEditorPlugin(EditorNode *p_node) : + AbstractPolygon2DEditorPlugin(p_node, memnew(Line2DEditor(p_node)), "Line2D") { } diff --git a/editor/plugins/navigation_polygon_editor_plugin.cpp b/editor/plugins/navigation_polygon_editor_plugin.cpp index 6560a8dac7..36c608310b 100644 --- a/editor/plugins/navigation_polygon_editor_plugin.cpp +++ b/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -120,10 +120,10 @@ void NavigationPolygonEditor::_create_resource() { _menu_option(MODE_CREATE); } -NavigationPolygonEditor::NavigationPolygonEditor(EditorNode *p_editor) - : AbstractPolygon2DEditor(p_editor) { +NavigationPolygonEditor::NavigationPolygonEditor(EditorNode *p_editor) : + AbstractPolygon2DEditor(p_editor) { } -NavigationPolygonEditorPlugin::NavigationPolygonEditorPlugin(EditorNode *p_node) - : AbstractPolygon2DEditorPlugin(p_node, memnew(NavigationPolygonEditor(p_node)), "NavigationPolygonInstance") { +NavigationPolygonEditorPlugin::NavigationPolygonEditorPlugin(EditorNode *p_node) : + AbstractPolygon2DEditorPlugin(p_node, memnew(NavigationPolygonEditor(p_node)), "NavigationPolygonInstance") { } diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp index ebb5f57e99..25e734187d 100644 --- a/editor/plugins/polygon_2d_editor_plugin.cpp +++ b/editor/plugins/polygon_2d_editor_plugin.cpp @@ -459,8 +459,8 @@ Vector2 Polygon2DEditor::snap_point(Vector2 p_target) const { return p_target; } -Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) - : AbstractPolygon2DEditor(p_editor) { +Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) : + AbstractPolygon2DEditor(p_editor) { snap_step = Vector2(10, 10); use_snap = false; @@ -609,6 +609,6 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) uv_edit_draw->set_clip_contents(true); } -Polygon2DEditorPlugin::Polygon2DEditorPlugin(EditorNode *p_node) - : AbstractPolygon2DEditorPlugin(p_node, memnew(Polygon2DEditor(p_node)), "Polygon2D") { +Polygon2DEditorPlugin::Polygon2DEditorPlugin(EditorNode *p_node) : + AbstractPolygon2DEditorPlugin(p_node, memnew(Polygon2DEditor(p_node)), "Polygon2D") { } diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 3c2d52c128..c02b3458e5 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -586,6 +586,12 @@ void ScriptEditor::_close_docs_tab() { } } +void ScriptEditor::_copy_script_path() { + ScriptEditorBase *se = Object::cast_to<ScriptEditorBase>(tab_container->get_child(tab_container->get_current_tab())); + Ref<Script> script = se->get_edited_script(); + OS::get_singleton()->set_clipboard(script->get_path()); +} + void ScriptEditor::_close_other_tabs() { int child_count = tab_container->get_child_count(); @@ -1026,6 +1032,9 @@ void ScriptEditor::_menu_option(int p_option) { _close_current_tab(); } } break; + case FILE_COPY_PATH: { + _copy_script_path(); + } break; case CLOSE_DOCS: { _close_docs_tab(); } break; @@ -2175,6 +2184,7 @@ void ScriptEditor::_make_script_list_context_menu() { context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/close_all"), CLOSE_ALL); context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/close_other_tabs"), CLOSE_OTHER_TABS); context_menu->add_separator(); + context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/copy_path"), FILE_COPY_PATH); context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/reload_script_soft"), FILE_TOOL_RELOAD_SOFT); Ref<Script> scr = se->get_edited_script(); @@ -2507,6 +2517,7 @@ void ScriptEditor::_bind_methods() { ClassDB::bind_method("_help_search", &ScriptEditor::_help_search); ClassDB::bind_method("_help_index", &ScriptEditor::_help_index); ClassDB::bind_method("_save_history", &ScriptEditor::_save_history); + ClassDB::bind_method("_copy_script_path", &ScriptEditor::_copy_script_path); ClassDB::bind_method("_breaked", &ScriptEditor::_breaked); ClassDB::bind_method("_show_debugger", &ScriptEditor::_show_debugger); @@ -2626,6 +2637,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/save_all", TTR("Save All"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_MASK_ALT | KEY_S), FILE_SAVE_ALL); file_menu->get_popup()->add_separator(); file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/reload_script_soft", TTR("Soft Reload Script"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_R), FILE_TOOL_RELOAD_SOFT); + file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/copy_path", TTR("Copy Script Path")), FILE_COPY_PATH); file_menu->get_popup()->add_separator(); file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/history_previous", TTR("History Prev"), KEY_MASK_ALT | KEY_LEFT), WINDOW_PREV); diff --git a/editor/plugins/script_editor_plugin.h b/editor/plugins/script_editor_plugin.h index 77ca4bc9d9..ffd42d18ca 100644 --- a/editor/plugins/script_editor_plugin.h +++ b/editor/plugins/script_editor_plugin.h @@ -137,6 +137,7 @@ class ScriptEditor : public PanelContainer { CLOSE_ALL, CLOSE_OTHER_TABS, TOGGLE_SCRIPTS_PANEL, + FILE_COPY_PATH, FILE_TOOL_RELOAD, FILE_TOOL_RELOAD_SOFT, DEBUG_NEXT, @@ -255,6 +256,8 @@ class ScriptEditor : public PanelContainer { void _close_other_tabs(); void _close_all_tabs(); + void _copy_script_path(); + void _ask_close_current_unsaved_tab(ScriptEditorBase *current); bool grab_focus_block; diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 3a443e1bf7..3c5bc7ac33 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -1509,6 +1509,8 @@ void ScriptTextEditor::_make_context_menu(bool p_selection, bool p_color, bool p if (p_selection) { context_menu->add_separator(); + context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/convert_to_uppercase"), EDIT_TO_UPPERCASE); + context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/convert_to_lowercase"), EDIT_TO_LOWERCASE); context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/indent_left"), EDIT_INDENT_LEFT); context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/indent_right"), EDIT_INDENT_RIGHT); context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/toggle_comment"), EDIT_TOGGLE_COMMENT); diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index b4d89526b0..00488a2a88 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -508,7 +508,7 @@ public: } else if (current->has_setting("application/config/name")) { project_name->set_text(current->get("application/config/name")); } - + project_name->call_deferred("grab_focus"); create_dir->hide(); diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index 0c1d7b9d9c..eed1efaf9c 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -3740,8 +3740,8 @@ void PropertyEditor::_item_edited() { _edit_set(name, item->get_text(1), refresh_all); } } break; - // math types + // math types case Variant::VECTOR3: { } break; diff --git a/main/main.cpp b/main/main.cpp index c9b84d2cd1..b2f091e76a 100755..100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -168,7 +168,6 @@ static String get_full_version_string() { } //#define DEBUG_INIT - #ifdef DEBUG_INIT #define MAIN_PRINT(m_txt) print_line(m_txt) #else diff --git a/main/tests/test_gdscript.cpp b/main/tests/test_gdscript.cpp index b41b5f6452..f99fd5fd88 100644 --- a/main/tests/test_gdscript.cpp +++ b/main/tests/test_gdscript.cpp @@ -1057,7 +1057,7 @@ MainLoop *test(TestType p_type) { return NULL; } -} +} // namespace TestGDScript #else @@ -1067,6 +1067,6 @@ MainLoop *test(TestType p_type) { return NULL; } -} +} // namespace TestGDScript #endif diff --git a/main/tests/test_gdscript.h b/main/tests/test_gdscript.h index f37b175913..cbbf7f3ef4 100644 --- a/main/tests/test_gdscript.h +++ b/main/tests/test_gdscript.h @@ -42,6 +42,6 @@ enum TestType { }; MainLoop *test(TestType p_type); -} +} // namespace TestGDScript #endif // TEST_GDSCRIPT_H diff --git a/main/tests/test_image.cpp b/main/tests/test_image.cpp index b94d93b2b1..0b7ba0edcc 100644 --- a/main/tests/test_image.cpp +++ b/main/tests/test_image.cpp @@ -65,4 +65,4 @@ MainLoop *test() { return memnew(TestMainLoop); } -} +} // namespace TestImage diff --git a/main/tests/test_io.cpp b/main/tests/test_io.cpp index f96c5cfe3c..1477df4415 100644 --- a/main/tests/test_io.cpp +++ b/main/tests/test_io.cpp @@ -118,7 +118,7 @@ MainLoop *test() { return memnew(TestMainLoop); } -} +} // namespace TestIO #else @@ -128,5 +128,5 @@ MainLoop *test() { return NULL; } -} +} // namespace TestIO #endif diff --git a/main/tests/test_math.cpp b/main/tests/test_math.cpp index 3ba8ef51b4..7d88372ee6 100644 --- a/main/tests/test_math.cpp +++ b/main/tests/test_math.cpp @@ -684,4 +684,4 @@ MainLoop *test() { return NULL; } -} +} // namespace TestMath diff --git a/main/tests/test_physics.cpp b/main/tests/test_physics.cpp index 1c50470544..e374113b67 100644 --- a/main/tests/test_physics.cpp +++ b/main/tests/test_physics.cpp @@ -435,4 +435,4 @@ MainLoop *test() { return memnew(TestPhysicsMainLoop); } -} +} // namespace TestPhysics diff --git a/main/tests/test_physics_2d.cpp b/main/tests/test_physics_2d.cpp index 7d596fbda3..41b7893032 100644 --- a/main/tests/test_physics_2d.cpp +++ b/main/tests/test_physics_2d.cpp @@ -431,4 +431,4 @@ MainLoop *test() { return memnew(TestPhysics2DMainLoop); } -} +} // namespace TestPhysics2D diff --git a/main/tests/test_render.cpp b/main/tests/test_render.cpp index cbf1a57855..9860a4a447 100644 --- a/main/tests/test_render.cpp +++ b/main/tests/test_render.cpp @@ -241,4 +241,4 @@ MainLoop *test() { return memnew(TestMainLoop); } -} +} // namespace TestRender diff --git a/main/tests/test_shader_lang.cpp b/main/tests/test_shader_lang.cpp index ddb2ed5e75..679e54451e 100644 --- a/main/tests/test_shader_lang.cpp +++ b/main/tests/test_shader_lang.cpp @@ -339,4 +339,4 @@ MainLoop *test() { return NULL; } -} +} // namespace TestShaderLang diff --git a/main/tests/test_string.cpp b/main/tests/test_string.cpp index 88d7702acc..db57788ade 100644 --- a/main/tests/test_string.cpp +++ b/main/tests/test_string.cpp @@ -919,4 +919,4 @@ MainLoop *test() { return NULL; } -} +} // namespace TestString diff --git a/misc/travis/clang-format.sh b/misc/travis/clang-format.sh index 741d3bff1b..2b30cf5ada 100755 --- a/misc/travis/clang-format.sh +++ b/misc/travis/clang-format.sh @@ -1,6 +1,6 @@ #!/bin/sh -CLANG_FORMAT=clang-format-3.9 +CLANG_FORMAT=clang-format-5.0 if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then # Check the whole commit range against $TRAVIS_BRANCH, the base merge branch diff --git a/modules/bullet/area_bullet.cpp b/modules/bullet/area_bullet.cpp index 54024b4f90..fad6f52cea 100644 --- a/modules/bullet/area_bullet.cpp +++ b/modules/bullet/area_bullet.cpp @@ -37,19 +37,19 @@ #include "collision_object_bullet.h" #include "space_bullet.h" -AreaBullet::AreaBullet() - : RigidCollisionObjectBullet(CollisionObjectBullet::TYPE_AREA), - monitorable(true), - isScratched(false), - spOv_mode(PhysicsServer::AREA_SPACE_OVERRIDE_DISABLED), - spOv_gravityPoint(false), - spOv_gravityPointDistanceScale(0), - spOv_gravityPointAttenuation(1), - spOv_gravityVec(0, -1, 0), - spOv_gravityMag(10), - spOv_linearDump(0.1), - spOv_angularDump(1), - spOv_priority(0) { +AreaBullet::AreaBullet() : + RigidCollisionObjectBullet(CollisionObjectBullet::TYPE_AREA), + monitorable(true), + isScratched(false), + spOv_mode(PhysicsServer::AREA_SPACE_OVERRIDE_DISABLED), + spOv_gravityPoint(false), + spOv_gravityPointDistanceScale(0), + spOv_gravityPointAttenuation(1), + spOv_gravityVec(0, -1, 0), + spOv_gravityMag(10), + spOv_linearDump(0.1), + spOv_angularDump(1), + spOv_priority(0) { btGhost = bulletnew(btGhostObject); btGhost->setCollisionShape(compoundShape); diff --git a/modules/bullet/area_bullet.h b/modules/bullet/area_bullet.h index f6e3b7e902..95ce62bfed 100644 --- a/modules/bullet/area_bullet.h +++ b/modules/bullet/area_bullet.h @@ -47,8 +47,8 @@ public: ObjectID event_callback_id; StringName event_callback_method; - InOutEventCallback() - : event_callback_id(0) {} + InOutEventCallback() : + event_callback_id(0) {} }; enum OverlapState { @@ -62,10 +62,12 @@ public: CollisionObjectBullet *object; OverlapState state; - OverlappingObjectData() - : object(NULL), state(OVERLAP_STATE_ENTER) {} - OverlappingObjectData(CollisionObjectBullet *p_object, OverlapState p_state) - : object(p_object), state(p_state) {} + OverlappingObjectData() : + object(NULL), + state(OVERLAP_STATE_ENTER) {} + OverlappingObjectData(CollisionObjectBullet *p_object, OverlapState p_state) : + object(p_object), + state(p_state) {} OverlappingObjectData(const OverlappingObjectData &other) { operator=(other); } diff --git a/modules/bullet/btRayShape.cpp b/modules/bullet/btRayShape.cpp index ac95faaac6..bbd2b19677 100644 --- a/modules/bullet/btRayShape.cpp +++ b/modules/bullet/btRayShape.cpp @@ -33,9 +33,9 @@ #include "LinearMath/btAabbUtil2.h" #include "math/math_funcs.h" -btRayShape::btRayShape(btScalar length) - : btConvexInternalShape(), - m_shapeAxis(0, 0, 1) { +btRayShape::btRayShape(btScalar length) : + btConvexInternalShape(), + m_shapeAxis(0, 0, 1) { m_shapeType = CUSTOM_CONVEX_SHAPE_TYPE; setLength(length); } diff --git a/modules/bullet/bullet_physics_server.cpp b/modules/bullet/bullet_physics_server.cpp index 6e9ed0e318..26c879fddb 100644 --- a/modules/bullet/bullet_physics_server.cpp +++ b/modules/bullet/bullet_physics_server.cpp @@ -78,10 +78,10 @@ void BulletPhysicsServer::_bind_methods() { //ClassDB::bind_method(D_METHOD("DoTest"), &BulletPhysicsServer::DoTest); } -BulletPhysicsServer::BulletPhysicsServer() - : PhysicsServer(), - active(true), - active_spaces_count(0) {} +BulletPhysicsServer::BulletPhysicsServer() : + PhysicsServer(), + active(true), + active_spaces_count(0) {} BulletPhysicsServer::~BulletPhysicsServer() {} diff --git a/modules/bullet/collision_object_bullet.cpp b/modules/bullet/collision_object_bullet.cpp index 5e878b0ee4..da3a4b73cf 100644 --- a/modules/bullet/collision_object_bullet.cpp +++ b/modules/bullet/collision_object_bullet.cpp @@ -50,8 +50,14 @@ void CollisionObjectBullet::ShapeWrapper::set_transform(const btTransform &p_tra transform = p_transform; } -CollisionObjectBullet::CollisionObjectBullet(Type p_type) - : RIDBullet(), space(NULL), type(p_type), collisionsEnabled(true), m_isStatic(false), bt_collision_object(NULL), body_scale(1., 1., 1.) {} +CollisionObjectBullet::CollisionObjectBullet(Type p_type) : + RIDBullet(), + space(NULL), + type(p_type), + collisionsEnabled(true), + m_isStatic(false), + bt_collision_object(NULL), + body_scale(1., 1., 1.) {} CollisionObjectBullet::~CollisionObjectBullet() { // Remove all overlapping @@ -165,8 +171,9 @@ const btTransform &CollisionObjectBullet::get_transform__bullet() const { return bt_collision_object->getWorldTransform(); } -RigidCollisionObjectBullet::RigidCollisionObjectBullet(Type p_type) - : CollisionObjectBullet(p_type), compoundShape(bulletnew(btCompoundShape(enableDynamicAabbTree, initialChildCapacity))) { +RigidCollisionObjectBullet::RigidCollisionObjectBullet(Type p_type) : + CollisionObjectBullet(p_type), + compoundShape(bulletnew(btCompoundShape(enableDynamicAabbTree, initialChildCapacity))) { } RigidCollisionObjectBullet::~RigidCollisionObjectBullet() { diff --git a/modules/bullet/collision_object_bullet.h b/modules/bullet/collision_object_bullet.h index 153b8ea5bc..51e48909e4 100644 --- a/modules/bullet/collision_object_bullet.h +++ b/modules/bullet/collision_object_bullet.h @@ -70,16 +70,22 @@ public: btTransform transform; bool active; - ShapeWrapper() - : shape(NULL), bt_shape(NULL), active(true) {} - - ShapeWrapper(ShapeBullet *p_shape, const btTransform &p_transform, bool p_active) - : shape(p_shape), bt_shape(NULL), active(p_active) { + ShapeWrapper() : + shape(NULL), + bt_shape(NULL), + active(true) {} + + ShapeWrapper(ShapeBullet *p_shape, const btTransform &p_transform, bool p_active) : + shape(p_shape), + bt_shape(NULL), + active(p_active) { set_transform(p_transform); } - ShapeWrapper(ShapeBullet *p_shape, const Transform &p_transform, bool p_active) - : shape(p_shape), bt_shape(NULL), active(p_active) { + ShapeWrapper(ShapeBullet *p_shape, const Transform &p_transform, bool p_active) : + shape(p_shape), + bt_shape(NULL), + active(p_active) { set_transform(p_transform); } ~ShapeWrapper(); diff --git a/modules/bullet/cone_twist_joint_bullet.cpp b/modules/bullet/cone_twist_joint_bullet.cpp index f6ac40e001..7ae5e79645 100644 --- a/modules/bullet/cone_twist_joint_bullet.cpp +++ b/modules/bullet/cone_twist_joint_bullet.cpp @@ -35,8 +35,8 @@ #include "bullet_utilities.h" #include "rigid_body_bullet.h" -ConeTwistJointBullet::ConeTwistJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &rbAFrame, const Transform &rbBFrame) - : JointBullet() { +ConeTwistJointBullet::ConeTwistJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &rbAFrame, const Transform &rbBFrame) : + JointBullet() { btTransform btFrameA; G_TO_B(rbAFrame, btFrameA); if (rbB) { diff --git a/modules/bullet/constraint_bullet.cpp b/modules/bullet/constraint_bullet.cpp index 08fc36f274..505579ce9b 100644 --- a/modules/bullet/constraint_bullet.cpp +++ b/modules/bullet/constraint_bullet.cpp @@ -33,8 +33,9 @@ #include "collision_object_bullet.h" #include "space_bullet.h" -ConstraintBullet::ConstraintBullet() - : space(NULL), constraint(NULL) {} +ConstraintBullet::ConstraintBullet() : + space(NULL), + constraint(NULL) {} void ConstraintBullet::setup(btTypedConstraint *p_constraint) { constraint = p_constraint; diff --git a/modules/bullet/generic_6dof_joint_bullet.cpp b/modules/bullet/generic_6dof_joint_bullet.cpp index 647396c24c..28928bd861 100644 --- a/modules/bullet/generic_6dof_joint_bullet.cpp +++ b/modules/bullet/generic_6dof_joint_bullet.cpp @@ -35,8 +35,8 @@ #include "bullet_utilities.h" #include "rigid_body_bullet.h" -Generic6DOFJointBullet::Generic6DOFJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &frameInA, const Transform &frameInB, bool useLinearReferenceFrameA) - : JointBullet() { +Generic6DOFJointBullet::Generic6DOFJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &frameInA, const Transform &frameInB, bool useLinearReferenceFrameA) : + JointBullet() { btTransform btFrameA; G_TO_B(frameInA, btFrameA); diff --git a/modules/bullet/godot_collision_configuration.cpp b/modules/bullet/godot_collision_configuration.cpp index 4e4228cc48..136fb2ee74 100644 --- a/modules/bullet/godot_collision_configuration.cpp +++ b/modules/bullet/godot_collision_configuration.cpp @@ -34,8 +34,8 @@ #include "BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h" #include "godot_ray_world_algorithm.h" -GodotCollisionConfiguration::GodotCollisionConfiguration(const btDiscreteDynamicsWorld *world, const btDefaultCollisionConstructionInfo &constructionInfo) - : btDefaultCollisionConfiguration(constructionInfo) { +GodotCollisionConfiguration::GodotCollisionConfiguration(const btDiscreteDynamicsWorld *world, const btDefaultCollisionConstructionInfo &constructionInfo) : + btDefaultCollisionConfiguration(constructionInfo) { void *mem = NULL; diff --git a/modules/bullet/godot_collision_dispatcher.cpp b/modules/bullet/godot_collision_dispatcher.cpp index ea75e4eef4..e0ca29a8f3 100644 --- a/modules/bullet/godot_collision_dispatcher.cpp +++ b/modules/bullet/godot_collision_dispatcher.cpp @@ -34,8 +34,8 @@ const int GodotCollisionDispatcher::CASTED_TYPE_AREA = static_cast<int>(CollisionObjectBullet::TYPE_AREA); -GodotCollisionDispatcher::GodotCollisionDispatcher(btCollisionConfiguration *collisionConfiguration) - : btCollisionDispatcher(collisionConfiguration) {} +GodotCollisionDispatcher::GodotCollisionDispatcher(btCollisionConfiguration *collisionConfiguration) : + btCollisionDispatcher(collisionConfiguration) {} bool GodotCollisionDispatcher::needsCollision(const btCollisionObject *body0, const btCollisionObject *body1) { if (body0->getUserIndex() == CASTED_TYPE_AREA || body1->getUserIndex() == CASTED_TYPE_AREA) { diff --git a/modules/bullet/godot_motion_state.h b/modules/bullet/godot_motion_state.h index 5111807394..62ea472446 100644 --- a/modules/bullet/godot_motion_state.h +++ b/modules/bullet/godot_motion_state.h @@ -51,10 +51,10 @@ class GodotMotionState : public btMotionState { RigidBodyBullet *owner; public: - GodotMotionState(RigidBodyBullet *p_owner) - : bodyKinematicWorldTransf(btMatrix3x3(1., 0., 0., 0., 1., 0., 0., 0., 1.), btVector3(0., 0., 0.)), - bodyCurrentWorldTransform(btMatrix3x3(1., 0., 0., 0., 1., 0., 0., 0., 1.), btVector3(0., 0., 0.)), - owner(p_owner) {} + GodotMotionState(RigidBodyBullet *p_owner) : + bodyKinematicWorldTransf(btMatrix3x3(1., 0., 0., 0., 1., 0., 0., 0., 1.), btVector3(0., 0., 0.)), + bodyCurrentWorldTransform(btMatrix3x3(1., 0., 0., 0., 1., 0., 0., 0., 1.), btVector3(0., 0., 0.)), + owner(p_owner) {} /// IMPORTANT DON'T USE THIS FUNCTION TO KNOW THE CURRENT BODY TRANSFORM /// This class is used internally by Bullet diff --git a/modules/bullet/godot_ray_world_algorithm.cpp b/modules/bullet/godot_ray_world_algorithm.cpp index 98daf8398e..ba13903548 100644 --- a/modules/bullet/godot_ray_world_algorithm.cpp +++ b/modules/bullet/godot_ray_world_algorithm.cpp @@ -34,18 +34,18 @@ #include "btRayShape.h" #include "collision_object_bullet.h" -GodotRayWorldAlgorithm::CreateFunc::CreateFunc(const btDiscreteDynamicsWorld *world) - : m_world(world) {} - -GodotRayWorldAlgorithm::SwappedCreateFunc::SwappedCreateFunc(const btDiscreteDynamicsWorld *world) - : m_world(world) {} - -GodotRayWorldAlgorithm::GodotRayWorldAlgorithm(const btDiscreteDynamicsWorld *world, btPersistentManifold *mf, const btCollisionAlgorithmConstructionInfo &ci, const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, bool isSwapped) - : btActivatingCollisionAlgorithm(ci, body0Wrap, body1Wrap), - m_manifoldPtr(mf), - m_ownManifold(false), - m_world(world), - m_isSwapped(isSwapped) {} +GodotRayWorldAlgorithm::CreateFunc::CreateFunc(const btDiscreteDynamicsWorld *world) : + m_world(world) {} + +GodotRayWorldAlgorithm::SwappedCreateFunc::SwappedCreateFunc(const btDiscreteDynamicsWorld *world) : + m_world(world) {} + +GodotRayWorldAlgorithm::GodotRayWorldAlgorithm(const btDiscreteDynamicsWorld *world, btPersistentManifold *mf, const btCollisionAlgorithmConstructionInfo &ci, const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, bool isSwapped) : + btActivatingCollisionAlgorithm(ci, body0Wrap, body1Wrap), + m_manifoldPtr(mf), + m_ownManifold(false), + m_world(world), + m_isSwapped(isSwapped) {} GodotRayWorldAlgorithm::~GodotRayWorldAlgorithm() { if (m_ownManifold && m_manifoldPtr) { diff --git a/modules/bullet/godot_result_callbacks.h b/modules/bullet/godot_result_callbacks.h index ba5142676b..5750dc2acd 100644 --- a/modules/bullet/godot_result_callbacks.h +++ b/modules/bullet/godot_result_callbacks.h @@ -52,8 +52,10 @@ struct GodotClosestRayResultCallback : public btCollisionWorld::ClosestRayResult bool m_pickRay; public: - GodotClosestRayResultCallback(const btVector3 &rayFromWorld, const btVector3 &rayToWorld, const Set<RID> *p_exclude) - : btCollisionWorld::ClosestRayResultCallback(rayFromWorld, rayToWorld), m_exclude(p_exclude), m_pickRay(false) {} + GodotClosestRayResultCallback(const btVector3 &rayFromWorld, const btVector3 &rayToWorld, const Set<RID> *p_exclude) : + btCollisionWorld::ClosestRayResultCallback(rayFromWorld, rayToWorld), + m_exclude(p_exclude), + m_pickRay(false) {} virtual bool needsCollision(btBroadphaseProxy *proxy0) const; }; @@ -66,8 +68,11 @@ public: int count; const Set<RID> *m_exclude; - GodotAllConvexResultCallback(PhysicsDirectSpaceState::ShapeResult *p_results, int p_resultMax, const Set<RID> *p_exclude) - : m_results(p_results), m_exclude(p_exclude), m_resultMax(p_resultMax), count(0) {} + GodotAllConvexResultCallback(PhysicsDirectSpaceState::ShapeResult *p_results, int p_resultMax, const Set<RID> *p_exclude) : + m_results(p_results), + m_exclude(p_exclude), + m_resultMax(p_resultMax), + count(0) {} virtual bool needsCollision(btBroadphaseProxy *proxy0) const; @@ -79,8 +84,10 @@ public: const RigidBodyBullet *m_self_object; const bool m_ignore_areas; - GodotKinClosestConvexResultCallback(const btVector3 &convexFromWorld, const btVector3 &convexToWorld, const RigidBodyBullet *p_self_object, bool p_ignore_areas) - : btCollisionWorld::ClosestConvexResultCallback(convexFromWorld, convexToWorld), m_self_object(p_self_object), m_ignore_areas(p_ignore_areas) {} + GodotKinClosestConvexResultCallback(const btVector3 &convexFromWorld, const btVector3 &convexToWorld, const RigidBodyBullet *p_self_object, bool p_ignore_areas) : + btCollisionWorld::ClosestConvexResultCallback(convexFromWorld, convexToWorld), + m_self_object(p_self_object), + m_ignore_areas(p_ignore_areas) {} virtual bool needsCollision(btBroadphaseProxy *proxy0) const; }; @@ -90,8 +97,9 @@ public: const Set<RID> *m_exclude; int m_shapeId; - GodotClosestConvexResultCallback(const btVector3 &convexFromWorld, const btVector3 &convexToWorld, const Set<RID> *p_exclude) - : btCollisionWorld::ClosestConvexResultCallback(convexFromWorld, convexToWorld), m_exclude(p_exclude) {} + GodotClosestConvexResultCallback(const btVector3 &convexFromWorld, const btVector3 &convexToWorld, const Set<RID> *p_exclude) : + btCollisionWorld::ClosestConvexResultCallback(convexFromWorld, convexToWorld), + m_exclude(p_exclude) {} virtual bool needsCollision(btBroadphaseProxy *proxy0) const; @@ -106,8 +114,12 @@ public: int m_count; const Set<RID> *m_exclude; - GodotAllContactResultCallback(btCollisionObject *p_self_object, PhysicsDirectSpaceState::ShapeResult *p_results, int p_resultMax, const Set<RID> *p_exclude) - : m_self_object(p_self_object), m_results(p_results), m_exclude(p_exclude), m_resultMax(p_resultMax), m_count(0) {} + GodotAllContactResultCallback(btCollisionObject *p_self_object, PhysicsDirectSpaceState::ShapeResult *p_results, int p_resultMax, const Set<RID> *p_exclude) : + m_self_object(p_self_object), + m_results(p_results), + m_exclude(p_exclude), + m_resultMax(p_resultMax), + m_count(0) {} virtual bool needsCollision(btBroadphaseProxy *proxy0) const; @@ -123,8 +135,12 @@ public: int m_count; const Set<RID> *m_exclude; - GodotContactPairContactResultCallback(btCollisionObject *p_self_object, Vector3 *p_results, int p_resultMax, const Set<RID> *p_exclude) - : m_self_object(p_self_object), m_results(p_results), m_exclude(p_exclude), m_resultMax(p_resultMax), m_count(0) {} + GodotContactPairContactResultCallback(btCollisionObject *p_self_object, Vector3 *p_results, int p_resultMax, const Set<RID> *p_exclude) : + m_self_object(p_self_object), + m_results(p_results), + m_exclude(p_exclude), + m_resultMax(p_resultMax), + m_count(0) {} virtual bool needsCollision(btBroadphaseProxy *proxy0) const; @@ -141,8 +157,12 @@ public: btVector3 m_rest_info_bt_point; const Set<RID> *m_exclude; - GodotRestInfoContactResultCallback(btCollisionObject *p_self_object, PhysicsDirectSpaceState::ShapeRestInfo *p_result, const Set<RID> *p_exclude) - : m_self_object(p_self_object), m_result(p_result), m_exclude(p_exclude), m_collided(false), m_min_distance(0) {} + GodotRestInfoContactResultCallback(btCollisionObject *p_self_object, PhysicsDirectSpaceState::ShapeRestInfo *p_result, const Set<RID> *p_exclude) : + m_self_object(p_self_object), + m_result(p_result), + m_exclude(p_exclude), + m_collided(false), + m_min_distance(0) {} virtual bool needsCollision(btBroadphaseProxy *proxy0) const; @@ -158,12 +178,12 @@ struct GodotDeepPenetrationContactResultCallback : public btManifoldResult { btScalar m_most_penetrated_distance; - GodotDeepPenetrationContactResultCallback(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap) - : btManifoldResult(body0Wrap, body1Wrap), - m_pointCollisionObject(NULL), - m_penetration_distance(0), - m_other_compound_shape_index(0), - m_most_penetrated_distance(1e20) {} + GodotDeepPenetrationContactResultCallback(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap) : + btManifoldResult(body0Wrap, body1Wrap), + m_pointCollisionObject(NULL), + m_penetration_distance(0), + m_other_compound_shape_index(0), + m_most_penetrated_distance(1e20) {} void reset() { m_pointCollisionObject = NULL; diff --git a/modules/bullet/hinge_joint_bullet.cpp b/modules/bullet/hinge_joint_bullet.cpp index bb70babd99..d3288807b3 100644 --- a/modules/bullet/hinge_joint_bullet.cpp +++ b/modules/bullet/hinge_joint_bullet.cpp @@ -35,8 +35,8 @@ #include "bullet_utilities.h" #include "rigid_body_bullet.h" -HingeJointBullet::HingeJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &frameA, const Transform &frameB) - : JointBullet() { +HingeJointBullet::HingeJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &frameA, const Transform &frameB) : + JointBullet() { btTransform btFrameA; G_TO_B(frameA, btFrameA); @@ -53,8 +53,8 @@ HingeJointBullet::HingeJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, c setup(hingeConstraint); } -HingeJointBullet::HingeJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Vector3 &pivotInA, const Vector3 &pivotInB, const Vector3 &axisInA, const Vector3 &axisInB) - : JointBullet() { +HingeJointBullet::HingeJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Vector3 &pivotInA, const Vector3 &pivotInB, const Vector3 &axisInA, const Vector3 &axisInB) : + JointBullet() { btVector3 btPivotA; btVector3 btAxisA; diff --git a/modules/bullet/joint_bullet.cpp b/modules/bullet/joint_bullet.cpp index be544f89bf..c8d91aa257 100644 --- a/modules/bullet/joint_bullet.cpp +++ b/modules/bullet/joint_bullet.cpp @@ -32,7 +32,7 @@ #include "joint_bullet.h" #include "space_bullet.h" -JointBullet::JointBullet() - : ConstraintBullet() {} +JointBullet::JointBullet() : + ConstraintBullet() {} JointBullet::~JointBullet() {} diff --git a/modules/bullet/pin_joint_bullet.cpp b/modules/bullet/pin_joint_bullet.cpp index cd9e9a4557..8c74fcbc94 100644 --- a/modules/bullet/pin_joint_bullet.cpp +++ b/modules/bullet/pin_joint_bullet.cpp @@ -34,8 +34,8 @@ #include "bullet_types_converter.h" #include "rigid_body_bullet.h" -PinJointBullet::PinJointBullet(RigidBodyBullet *p_body_a, const Vector3 &p_pos_a, RigidBodyBullet *p_body_b, const Vector3 &p_pos_b) - : JointBullet() { +PinJointBullet::PinJointBullet(RigidBodyBullet *p_body_a, const Vector3 &p_pos_a, RigidBodyBullet *p_body_b, const Vector3 &p_pos_b) : + JointBullet() { if (p_body_b) { btVector3 btPivotA; diff --git a/modules/bullet/rigid_body_bullet.cpp b/modules/bullet/rigid_body_bullet.cpp index f5ab8221e3..b134bd3a36 100644 --- a/modules/bullet/rigid_body_bullet.cpp +++ b/modules/bullet/rigid_body_bullet.cpp @@ -176,9 +176,9 @@ PhysicsDirectSpaceState *BulletPhysicsDirectBodyState::get_space_state() { return body->get_space()->get_direct_state(); } -RigidBodyBullet::KinematicUtilities::KinematicUtilities(RigidBodyBullet *p_owner) - : owner(p_owner), - safe_margin(0.001) { +RigidBodyBullet::KinematicUtilities::KinematicUtilities(RigidBodyBullet *p_owner) : + owner(p_owner), + safe_margin(0.001) { } RigidBodyBullet::KinematicUtilities::~KinematicUtilities() { @@ -250,22 +250,22 @@ void RigidBodyBullet::KinematicUtilities::just_delete_shapes(int new_size) { shapes.resize(new_size); } -RigidBodyBullet::RigidBodyBullet() - : RigidCollisionObjectBullet(CollisionObjectBullet::TYPE_RIGID_BODY), - kinematic_utilities(NULL), - gravity_scale(1), - mass(1), - linearDamp(0), - angularDamp(0), - can_sleep(true), - force_integration_callback(NULL), - isTransformChanged(false), - maxCollisionsDetection(0), - collisionsCount(0), - maxAreasWhereIam(10), - areaWhereIamCount(0), - countGravityPointSpaces(0), - isScratchedSpaceOverrideModificator(false) { +RigidBodyBullet::RigidBodyBullet() : + RigidCollisionObjectBullet(CollisionObjectBullet::TYPE_RIGID_BODY), + kinematic_utilities(NULL), + gravity_scale(1), + mass(1), + linearDamp(0), + angularDamp(0), + can_sleep(true), + force_integration_callback(NULL), + isTransformChanged(false), + maxCollisionsDetection(0), + collisionsCount(0), + maxAreasWhereIam(10), + areaWhereIamCount(0), + countGravityPointSpaces(0), + isScratchedSpaceOverrideModificator(false) { godotMotionState = bulletnew(GodotMotionState(this)); diff --git a/modules/bullet/rigid_body_bullet.h b/modules/bullet/rigid_body_bullet.h index ab3c3e58b2..c54b5784b5 100644 --- a/modules/bullet/rigid_body_bullet.h +++ b/modules/bullet/rigid_body_bullet.h @@ -156,8 +156,8 @@ public: class btConvexShape *shape; btTransform transform; - KinematicShape() - : shape(NULL) {} + KinematicShape() : + shape(NULL) {} const bool is_active() const { return shape; } }; diff --git a/modules/bullet/shape_bullet.cpp b/modules/bullet/shape_bullet.cpp index f51af93a31..572a3b4476 100644 --- a/modules/bullet/shape_bullet.cpp +++ b/modules/bullet/shape_bullet.cpp @@ -130,8 +130,8 @@ btRayShape *ShapeBullet::create_shape_ray(real_t p_length) { /* PLANE */ -PlaneShapeBullet::PlaneShapeBullet() - : ShapeBullet() {} +PlaneShapeBullet::PlaneShapeBullet() : + ShapeBullet() {} void PlaneShapeBullet::set_data(const Variant &p_data) { setup(p_data); @@ -158,8 +158,8 @@ btCollisionShape *PlaneShapeBullet::create_bt_shape() { /* Sphere */ -SphereShapeBullet::SphereShapeBullet() - : ShapeBullet() {} +SphereShapeBullet::SphereShapeBullet() : + ShapeBullet() {} void SphereShapeBullet::set_data(const Variant &p_data) { setup(p_data); @@ -183,8 +183,8 @@ btCollisionShape *SphereShapeBullet::create_bt_shape() { } /* Box */ -BoxShapeBullet::BoxShapeBullet() - : ShapeBullet() {} +BoxShapeBullet::BoxShapeBullet() : + ShapeBullet() {} void BoxShapeBullet::set_data(const Variant &p_data) { setup(p_data); @@ -211,8 +211,8 @@ btCollisionShape *BoxShapeBullet::create_bt_shape() { /* Capsule */ -CapsuleShapeBullet::CapsuleShapeBullet() - : ShapeBullet() {} +CapsuleShapeBullet::CapsuleShapeBullet() : + ShapeBullet() {} void CapsuleShapeBullet::set_data(const Variant &p_data) { Dictionary d = p_data; @@ -244,8 +244,8 @@ btCollisionShape *CapsuleShapeBullet::create_bt_shape() { /* Convex polygon */ -ConvexPolygonShapeBullet::ConvexPolygonShapeBullet() - : ShapeBullet() {} +ConvexPolygonShapeBullet::ConvexPolygonShapeBullet() : + ShapeBullet() {} void ConvexPolygonShapeBullet::set_data(const Variant &p_data) { setup(p_data); @@ -286,8 +286,9 @@ btCollisionShape *ConvexPolygonShapeBullet::create_bt_shape() { /* Concave polygon */ -ConcavePolygonShapeBullet::ConcavePolygonShapeBullet() - : ShapeBullet(), meshShape(NULL) {} +ConcavePolygonShapeBullet::ConcavePolygonShapeBullet() : + ShapeBullet(), + meshShape(NULL) {} ConcavePolygonShapeBullet::~ConcavePolygonShapeBullet() { if (meshShape) { @@ -359,8 +360,8 @@ btCollisionShape *ConcavePolygonShapeBullet::create_bt_shape() { /* Height map shape */ -HeightMapShapeBullet::HeightMapShapeBullet() - : ShapeBullet() {} +HeightMapShapeBullet::HeightMapShapeBullet() : + ShapeBullet() {} void HeightMapShapeBullet::set_data(const Variant &p_data) { ERR_FAIL_COND(p_data.get_type() != Variant::DICTIONARY); @@ -411,8 +412,9 @@ btCollisionShape *HeightMapShapeBullet::create_bt_shape() { } /* Ray shape */ -RayShapeBullet::RayShapeBullet() - : ShapeBullet(), length(1) {} +RayShapeBullet::RayShapeBullet() : + ShapeBullet(), + length(1) {} void RayShapeBullet::set_data(const Variant &p_data) { setup(p_data); diff --git a/modules/bullet/slider_joint_bullet.cpp b/modules/bullet/slider_joint_bullet.cpp index 2da65677f5..f1d60679ec 100644 --- a/modules/bullet/slider_joint_bullet.cpp +++ b/modules/bullet/slider_joint_bullet.cpp @@ -35,8 +35,8 @@ #include "bullet_utilities.h" #include "rigid_body_bullet.h" -SliderJointBullet::SliderJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &frameInA, const Transform &frameInB) - : JointBullet() { +SliderJointBullet::SliderJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &frameInA, const Transform &frameInB) : + JointBullet() { btTransform btFrameA; G_TO_B(frameInA, btFrameA); if (rbB) { diff --git a/modules/bullet/soft_body_bullet.cpp b/modules/bullet/soft_body_bullet.cpp index 64ef7bfad2..ef5c8cac6f 100644 --- a/modules/bullet/soft_body_bullet.cpp +++ b/modules/bullet/soft_body_bullet.cpp @@ -36,8 +36,18 @@ #include "scene/3d/immediate_geometry.h" -SoftBodyBullet::SoftBodyBullet() - : CollisionObjectBullet(CollisionObjectBullet::TYPE_SOFT_BODY), mass(1), simulation_precision(5), stiffness(0.5f), pressure_coefficient(50), damping_coefficient(0.005), drag_coefficient(0.005), bt_soft_body(NULL), soft_shape_type(SOFT_SHAPETYPE_NONE), isScratched(false), soft_body_shape_data(NULL) { +SoftBodyBullet::SoftBodyBullet() : + CollisionObjectBullet(CollisionObjectBullet::TYPE_SOFT_BODY), + mass(1), + simulation_precision(5), + stiffness(0.5f), + pressure_coefficient(50), + damping_coefficient(0.005), + drag_coefficient(0.005), + bt_soft_body(NULL), + soft_shape_type(SOFT_SHAPETYPE_NONE), + isScratched(false), + soft_body_shape_data(NULL) { test_geometry = memnew(ImmediateGeometry); diff --git a/modules/bullet/space_bullet.cpp b/modules/bullet/space_bullet.cpp index d8c8cab17a..c1f6e81734 100644 --- a/modules/bullet/space_bullet.cpp +++ b/modules/bullet/space_bullet.cpp @@ -50,8 +50,9 @@ #include "ustring.h" #include <assert.h> -BulletPhysicsDirectSpaceState::BulletPhysicsDirectSpaceState(SpaceBullet *p_space) - : PhysicsDirectSpaceState(), space(p_space) {} +BulletPhysicsDirectSpaceState::BulletPhysicsDirectSpaceState(SpaceBullet *p_space) : + PhysicsDirectSpaceState(), + space(p_space) {} int BulletPhysicsDirectSpaceState::intersect_point(const Vector3 &p_point, ShapeResult *r_results, int p_result_max, const Set<RID> &p_exclude, uint32_t p_collision_mask) { @@ -330,18 +331,18 @@ Vector3 BulletPhysicsDirectSpaceState::get_closest_point_to_object_volume(RID p_ } } -SpaceBullet::SpaceBullet(bool p_create_soft_world) - : broadphase(NULL), - dispatcher(NULL), - solver(NULL), - collisionConfiguration(NULL), - dynamicsWorld(NULL), - soft_body_world_info(NULL), - ghostPairCallback(NULL), - godotFilterCallback(NULL), - gravityDirection(0, -1, 0), - gravityMagnitude(10), - contactDebugCount(0) { +SpaceBullet::SpaceBullet(bool p_create_soft_world) : + broadphase(NULL), + dispatcher(NULL), + solver(NULL), + collisionConfiguration(NULL), + dynamicsWorld(NULL), + soft_body_world_info(NULL), + ghostPairCallback(NULL), + godotFilterCallback(NULL), + gravityDirection(0, -1, 0), + gravityMagnitude(10), + contactDebugCount(0) { create_empty_world(p_create_soft_world); direct_access = memnew(BulletPhysicsDirectSpaceState(this)); @@ -939,14 +940,14 @@ bool SpaceBullet::test_body_motion(RigidBodyBullet *p_body, const Transform &p_f r_result->collider_shape = r_recover_result.other_compound_shape_index; r_result->collision_local_shape = r_recover_result.local_shape_most_recovered; -//{ /// Add manifold point to manage collisions -// btPersistentManifold* manifold = dynamicsWorld->getDispatcher()->getNewManifold(p_body->getBtBody(), btRigid); -// btManifoldPoint manifoldPoint(result_callabck.m_pointWorld, result_callabck.m_pointWorld, result_callabck.m_pointNormalWorld, result_callabck.m_penetration_distance); -// manifoldPoint.m_index0 = r_result->collision_local_shape; -// manifoldPoint.m_index1 = r_result->collider_shape; -// manifold->addManifoldPoint(manifoldPoint); -// p_body->get_kinematic_utilities()->m_generatedManifold.push_back(manifold); -//} + //{ /// Add manifold point to manage collisions + // btPersistentManifold* manifold = dynamicsWorld->getDispatcher()->getNewManifold(p_body->getBtBody(), btRigid); + // btManifoldPoint manifoldPoint(result_callabck.m_pointWorld, result_callabck.m_pointWorld, result_callabck.m_pointNormalWorld, result_callabck.m_penetration_distance); + // manifoldPoint.m_index0 = r_result->collision_local_shape; + // manifoldPoint.m_index1 = r_result->collider_shape; + // manifold->addManifoldPoint(manifoldPoint); + // p_body->get_kinematic_utilities()->m_generatedManifold.push_back(manifold); + //} #if debug_test_motion Vector3 sup_line2; @@ -979,10 +980,10 @@ public: Vector<btCollisionObject *> result_collision_objects; public: - RecoverPenetrationBroadPhaseCallback(const btCollisionObject *p_self_collision_object, uint32_t p_collision_layer, uint32_t p_collision_mask) - : self_collision_object(p_self_collision_object), - collision_layer(p_collision_layer), - collision_mask(p_collision_mask) {} + RecoverPenetrationBroadPhaseCallback(const btCollisionObject *p_self_collision_object, uint32_t p_collision_layer, uint32_t p_collision_mask) : + self_collision_object(p_self_collision_object), + collision_layer(p_collision_layer), + collision_mask(p_collision_mask) {} virtual ~RecoverPenetrationBroadPhaseCallback() {} diff --git a/modules/bullet/space_bullet.h b/modules/bullet/space_bullet.h index 99bcfb8563..e5267c01a9 100644 --- a/modules/bullet/space_bullet.h +++ b/modules/bullet/space_bullet.h @@ -185,8 +185,8 @@ private: const btCollisionObject *other_collision_object; int local_shape_most_recovered; - RecoverResult() - : hasPenetration(false) {} + RecoverResult() : + hasPenetration(false) {} }; bool recover_from_penetration(RigidBodyBullet *p_body, const btTransform &p_from, btVector3 &r_recover_position, RecoverResult *r_recover_result = NULL); diff --git a/modules/gdnative/arvr/arvr_interface_gdnative.cpp b/modules/gdnative/arvr/arvr_interface_gdnative.cpp index 9b0d1ebb31..29e4775e62 100644 --- a/modules/gdnative/arvr/arvr_interface_gdnative.cpp +++ b/modules/gdnative/arvr/arvr_interface_gdnative.cpp @@ -219,7 +219,7 @@ extern "C" { void GDAPI godot_arvr_register_interface(const godot_arvr_interface_gdnative *p_interface) { Ref<ARVRInterfaceGDNative> new_interface; new_interface.instance(); - new_interface->set_interface((godot_arvr_interface_gdnative * const)p_interface); + new_interface->set_interface((godot_arvr_interface_gdnative *const)p_interface); ARVRServer::get_singleton()->add_interface(new_interface); } diff --git a/modules/gdnative/gdnative.cpp b/modules/gdnative/gdnative.cpp index 21c24fabd8..9c0041cbe0 100644 --- a/modules/gdnative/gdnative.cpp +++ b/modules/gdnative/gdnative.cpp @@ -144,7 +144,7 @@ bool GDNative::initialize() { } } - Error err = OS::get_singleton()->open_dynamic_library(path, native_handle,true); + Error err = OS::get_singleton()->open_dynamic_library(path, native_handle, true); if (err != OK) { return false; } diff --git a/modules/gdnative/gdnative.h b/modules/gdnative/gdnative.h index bb260bdd1b..993cd0ece7 100644 --- a/modules/gdnative/gdnative.h +++ b/modules/gdnative/gdnative.h @@ -106,8 +106,8 @@ struct GDNativeCallRegistry { return singleton; } - inline GDNativeCallRegistry() - : native_calls() {} + inline GDNativeCallRegistry() : + native_calls() {} Map<StringName, native_call_cb> native_calls; diff --git a/modules/gdnative/nativescript/api_generator.cpp b/modules/gdnative/nativescript/api_generator.cpp index f9d699fb59..653445c2db 100644 --- a/modules/gdnative/nativescript/api_generator.cpp +++ b/modules/gdnative/nativescript/api_generator.cpp @@ -468,8 +468,6 @@ static List<String> generate_c_api_json(const List<ClassAPI> &p_api) { return source; } -// - #endif /* diff --git a/modules/gdnative/nativescript/nativescript.cpp b/modules/gdnative/nativescript/nativescript.cpp index c2c7c27f25..965de062e3 100644 --- a/modules/gdnative/nativescript/nativescript.cpp +++ b/modules/gdnative/nativescript/nativescript.cpp @@ -437,11 +437,11 @@ NativeScript::~NativeScript() { #endif } -// -// -// ScriptInstance stuff -// -// + // + // + // ScriptInstance stuff + // + // #define GET_SCRIPT_DESC() script->get_script_desc() diff --git a/modules/gdnative/nativescript/nativescript.h b/modules/gdnative/nativescript/nativescript.h index f0f14e2f30..30fa400cb0 100644 --- a/modules/gdnative/nativescript/nativescript.h +++ b/modules/gdnative/nativescript/nativescript.h @@ -76,12 +76,12 @@ struct NativeScriptDesc { bool is_tool; - inline NativeScriptDesc() - : methods(), - properties(), - signals_(), - base(), - base_native_type() { + inline NativeScriptDesc() : + methods(), + properties(), + signals_(), + base(), + base_native_type() { zeromem(&create_func, sizeof(godot_instance_create_func)); zeromem(&destroy_func, sizeof(godot_instance_destroy_func)); } diff --git a/modules/gdnative/pluginscript/pluginscript_language.cpp b/modules/gdnative/pluginscript/pluginscript_language.cpp index 40feb5ae43..e358c2fb69 100644 --- a/modules/gdnative/pluginscript/pluginscript_language.cpp +++ b/modules/gdnative/pluginscript/pluginscript_language.cpp @@ -410,8 +410,8 @@ void PluginScriptLanguage::unlock() { #endif } -PluginScriptLanguage::PluginScriptLanguage(const godot_pluginscript_language_desc *desc) - : _desc(*desc) { +PluginScriptLanguage::PluginScriptLanguage(const godot_pluginscript_language_desc *desc) : + _desc(*desc) { _resource_loader = memnew(ResourceFormatLoaderPluginScript(this)); _resource_saver = memnew(ResourceFormatSaverPluginScript(this)); diff --git a/modules/gdnative/pluginscript/pluginscript_script.cpp b/modules/gdnative/pluginscript/pluginscript_script.cpp index 4169b07f63..0b71b3b10d 100644 --- a/modules/gdnative/pluginscript/pluginscript_script.cpp +++ b/modules/gdnative/pluginscript/pluginscript_script.cpp @@ -423,8 +423,11 @@ ScriptInstance::RPCMode PluginScript::get_rset_mode(const StringName &p_variable } } -PluginScript::PluginScript() - : _data(NULL), _tool(false), _valid(false), _script_list(this) { +PluginScript::PluginScript() : + _data(NULL), + _tool(false), + _valid(false), + _script_list(this) { } void PluginScript::init(PluginScriptLanguage *language) { diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index 9496d0b310..b75f670906 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -100,7 +100,7 @@ GDScriptInstance *GDScript::_create_instance(const Variant **p_args, int p_argco #endif instance->owner->set_script_instance(instance); -/* STEP 2, INITIALIZE AND CONSRTUCT */ + /* STEP 2, INITIALIZE AND CONSRTUCT */ #ifndef NO_THREADS GDScriptLanguage::singleton->lock->lock(); @@ -876,8 +876,8 @@ void GDScript::get_script_signal_list(List<MethodInfo> *r_signals) const { #endif } -GDScript::GDScript() - : script_list(this) { +GDScript::GDScript() : + script_list(this) { _static_ref = this; valid = false; diff --git a/modules/gdscript/gdscript_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp index 4cd6472b7f..f9385d7a11 100644 --- a/modules/gdscript/gdscript_compiler.cpp +++ b/modules/gdscript/gdscript_compiler.cpp @@ -806,8 +806,8 @@ int GDScriptCompiler::_parse_expression(CodeGen &codegen, const GDScriptParser:: ERR_FAIL_COND_V(on->arguments.size() != 2, -1); if (on->arguments[0]->type == GDScriptParser::Node::TYPE_OPERATOR && (static_cast<GDScriptParser::OperatorNode *>(on->arguments[0])->op == GDScriptParser::OperatorNode::OP_INDEX || static_cast<GDScriptParser::OperatorNode *>(on->arguments[0])->op == GDScriptParser::OperatorNode::OP_INDEX_NAMED)) { -//SET (chained) MODE!! + // SET (chained) MODE! #ifdef DEBUG_ENABLED if (static_cast<GDScriptParser::OperatorNode *>(on->arguments[0])->op == GDScriptParser::OperatorNode::OP_INDEX_NAMED) { const GDScriptParser::OperatorNode *inon = static_cast<GDScriptParser::OperatorNode *>(on->arguments[0]); diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index e7100d835c..adf6780278 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -1795,8 +1795,8 @@ static void _find_type_arguments(GDScriptCompletionContext &context, const GDScr } } else { -//regular method + //regular method #if defined(DEBUG_METHODS_ENABLED) && defined(TOOLS_ENABLED) if (p_argidx < m->get_argument_count()) { PropertyInfo pi = m->get_argument_info(p_argidx); diff --git a/modules/gdscript/gdscript_function.cpp b/modules/gdscript/gdscript_function.cpp index 765a76fec4..f00ac1f7e6 100644 --- a/modules/gdscript/gdscript_function.cpp +++ b/modules/gdscript/gdscript_function.cpp @@ -250,7 +250,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a #ifdef DEBUG_ENABLED -//GDScriptLanguage::get_singleton()->calls++; + //GDScriptLanguage::get_singleton()->calls++; #endif @@ -1432,8 +1432,8 @@ void GDScriptFunction::debug_get_stack_member_state(int p_line, List<Pair<String } } -GDScriptFunction::GDScriptFunction() - : function_list(this) { +GDScriptFunction::GDScriptFunction() : + function_list(this) { _stack_size = 0; _call_size = 0; diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index bee9ef1998..e48b03968b 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -2976,10 +2976,9 @@ void GDScriptParser::_parse_extends(ClassNode *p_class) { case GDScriptTokenizer::TK_IDENTIFIER: { - StringName identifier = tokenizer->get_token_identifier(); - p_class->extends_class.push_back(identifier); - } - break; + StringName identifier = tokenizer->get_token_identifier(); + p_class->extends_class.push_back(identifier); + } break; case GDScriptTokenizer::TK_PERIOD: break; diff --git a/modules/mobile_vr/mobile_interface.cpp b/modules/mobile_vr/mobile_interface.cpp index 3a0b83d534..35253d5a77 100644 --- a/modules/mobile_vr/mobile_interface.cpp +++ b/modules/mobile_vr/mobile_interface.cpp @@ -461,6 +461,7 @@ MobileVRInterface::MobileVRInterface() { glGenBuffers(1, &half_screen_quad); glBindBuffer(GL_ARRAY_BUFFER, half_screen_quad); { + /* clang-format off */ const float qv[16] = { 0, -1, -1, -1, @@ -471,6 +472,7 @@ MobileVRInterface::MobileVRInterface() { 1, -1, 1, -1, }; + /* clang-format on */ glBufferData(GL_ARRAY_BUFFER, sizeof(float) * 16, qv, GL_STATIC_DRAW); } diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index 6fbc309fa3..af5a0334c3 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -1885,8 +1885,8 @@ StringName CSharpScript::get_script_name() const { return name; } -CSharpScript::CSharpScript() - : script_list(this) { +CSharpScript::CSharpScript() : + script_list(this) { _clear(); diff --git a/modules/mono/editor/csharp_project.cpp b/modules/mono/editor/csharp_project.cpp index bde5f0fd0b..9a1efb4423 100644 --- a/modules/mono/editor/csharp_project.cpp +++ b/modules/mono/editor/csharp_project.cpp @@ -117,4 +117,4 @@ void add_item(const String &p_project_path, const String &p_item_type, const Str ERR_FAIL(); } } -} // CSharpProject +} // namespace CSharpProject diff --git a/modules/mono/editor/csharp_project.h b/modules/mono/editor/csharp_project.h index 4832d2251e..44e8325a59 100644 --- a/modules/mono/editor/csharp_project.h +++ b/modules/mono/editor/csharp_project.h @@ -39,6 +39,6 @@ String generate_editor_api_project(const String &p_dir, const String &p_core_dll String generate_game_project(const String &p_dir, const String &p_name, const Vector<String> &p_files = Vector<String>()); void add_item(const String &p_project_path, const String &p_item_type, const String &p_include); -} +} // namespace CSharpProject #endif // CSHARP_PROJECT_H diff --git a/modules/mono/godotsharp_dirs.cpp b/modules/mono/godotsharp_dirs.cpp index a0c2508b0d..0f6245a37c 100644 --- a/modules/mono/godotsharp_dirs.cpp +++ b/modules/mono/godotsharp_dirs.cpp @@ -192,4 +192,4 @@ String get_project_csproj_path() { return _GodotSharpDirs::get_singleton().csproj_filepath; } #endif -} +} // namespace GodotSharpDirs diff --git a/modules/mono/godotsharp_dirs.h b/modules/mono/godotsharp_dirs.h index ba2c065210..914df40629 100644 --- a/modules/mono/godotsharp_dirs.h +++ b/modules/mono/godotsharp_dirs.h @@ -53,6 +53,6 @@ String get_custom_project_settings_dir(); String get_project_sln_path(); String get_project_csproj_path(); -} +} // namespace GodotSharpDirs #endif // GODOTSHARP_DIRS_H diff --git a/modules/mono/mono_gc_handle.cpp b/modules/mono/mono_gc_handle.cpp index e10e06df0e..121392b3f8 100644 --- a/modules/mono/mono_gc_handle.cpp +++ b/modules/mono/mono_gc_handle.cpp @@ -36,7 +36,7 @@ uint32_t MonoGCHandle::make_strong_handle(MonoObject *p_object) { return mono_gchandle_new( p_object, false /* do not pin the object */ - ); + ); } uint32_t MonoGCHandle::make_weak_handle(MonoObject *p_object) { @@ -44,7 +44,7 @@ uint32_t MonoGCHandle::make_weak_handle(MonoObject *p_object) { return mono_gchandle_new_weakref( p_object, true /* track_resurrection: allows us to invoke _notification(NOTIFICATION_PREDELETE) while disposing */ - ); + ); } Ref<MonoGCHandle> MonoGCHandle::create_strong(MonoObject *p_object) { diff --git a/modules/mono/mono_gd/gd_mono_internals.cpp b/modules/mono/mono_gd/gd_mono_internals.cpp index cfe2148b80..56e8a01567 100644 --- a/modules/mono/mono_gd/gd_mono_internals.cpp +++ b/modules/mono/mono_gd/gd_mono_internals.cpp @@ -63,4 +63,4 @@ void tie_managed_to_unmanaged(MonoObject *managed, Object *unmanaged) { return; } -} +} // namespace GDMonoInternals diff --git a/modules/mono/signal_awaiter_utils.cpp b/modules/mono/signal_awaiter_utils.cpp index 7e99df29a1..47cc11cc0a 100644 --- a/modules/mono/signal_awaiter_utils.cpp +++ b/modules/mono/signal_awaiter_utils.cpp @@ -62,7 +62,7 @@ Error connect_signal_awaiter(Object *p_source, const String &p_signal, Object *p return err; } -} +} // namespace SignalAwaiterUtils Variant SignalAwaiterHandle::_signal_callback(const Variant **p_args, int p_argcount, Variant::CallError &r_error) { @@ -116,8 +116,8 @@ void SignalAwaiterHandle::_bind_methods() { ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "_signal_callback", &SignalAwaiterHandle::_signal_callback, MethodInfo("_signal_callback")); } -SignalAwaiterHandle::SignalAwaiterHandle(uint32_t p_managed_handle) - : MonoGCHandle(p_managed_handle) { +SignalAwaiterHandle::SignalAwaiterHandle(uint32_t p_managed_handle) : + MonoGCHandle(p_managed_handle) { #ifdef DEBUG_ENABLED conn_target_id = 0; diff --git a/modules/mono/utils/mono_reg_utils.h b/modules/mono/utils/mono_reg_utils.h index 4cc4965acb..599828aa80 100644 --- a/modules/mono/utils/mono_reg_utils.h +++ b/modules/mono/utils/mono_reg_utils.h @@ -47,7 +47,7 @@ namespace MonoRegUtils { MonoRegInfo find_mono(); String find_msbuild_tools_path(); -} // MonoRegUtils +} // namespace MonoRegUtils #endif // WINDOWS_ENABLED diff --git a/modules/mono/utils/string_utils.cpp b/modules/mono/utils/string_utils.cpp index f26663ea11..8f817771ac 100644 --- a/modules/mono/utils/string_utils.cpp +++ b/modules/mono/utils/string_utils.cpp @@ -78,7 +78,7 @@ int sfind(const String &p_text, int p_from) { return -1; } -} +} // namespace String sformat(const String &p_text, const Variant &p1, const Variant &p2, const Variant &p3, const Variant &p4, const Variant &p5) { if (p_text.length() < 2) diff --git a/modules/pvr/texture_loader_pvr.cpp b/modules/pvr/texture_loader_pvr.cpp index 03592047ad..4415c888a4 100644 --- a/modules/pvr/texture_loader_pvr.cpp +++ b/modules/pvr/texture_loader_pvr.cpp @@ -239,11 +239,11 @@ ResourceFormatPVR::ResourceFormatPVR() { Image::_image_compress_pvrtc2_func = _compress_pvrtc4; } -///////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////// -//PVRTC decompressor, Based on PVRTC decompressor by IMGTEC. + //PVRTC decompressor, Based on PVRTC decompressor by IMGTEC. -///////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////// #define PT_INDEX 2 #define BLK_Y_SIZE 4 diff --git a/modules/stb_vorbis/doc_classes/AudioStreamOGGVorbis.xml b/modules/stb_vorbis/doc_classes/AudioStreamOGGVorbis.xml index c0f8c6b9c7..4533d59cae 100644 --- a/modules/stb_vorbis/doc_classes/AudioStreamOGGVorbis.xml +++ b/modules/stb_vorbis/doc_classes/AudioStreamOGGVorbis.xml @@ -11,18 +11,49 @@ <demos> </demos> <methods> + <method name="get_data" qualifiers="const"> + <return type="PoolByteArray"> + </return> + <description> + </description> + </method> + <method name="get_loop_offset" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> + <method name="has_loop" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="set_data"> + <return type="void"> + </return> + <argument index="0" name="data" type="PoolByteArray"> + </argument> + <description> + </description> + </method> + <method name="set_loop"> + <return type="void"> + </return> + <argument index="0" name="enable" type="bool"> + </argument> + <description> + </description> + </method> + <method name="set_loop_offset"> + <return type="void"> + </return> + <argument index="0" name="seconds" type="float"> + </argument> + <description> + </description> + </method> </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> </constants> </class> diff --git a/modules/theora/doc_classes/VideoStreamTheora.xml b/modules/theora/doc_classes/VideoStreamTheora.xml index 61884f47fa..6c8806ed72 100644 --- a/modules/theora/doc_classes/VideoStreamTheora.xml +++ b/modules/theora/doc_classes/VideoStreamTheora.xml @@ -9,11 +9,21 @@ <demos> </demos> <methods> + <method name="get_file"> + <return type="String"> + </return> + <description> + </description> + </method> + <method name="set_file"> + <return type="void"> + </return> + <argument index="0" name="file" type="String"> + </argument> + <description> + </description> + </method> </methods> - <members> - <member name="file" type="String" setter="set_file" getter="get_file"> - </member> - </members> <constants> </constants> </class> diff --git a/modules/visual_script/doc_classes/VisualScript.xml b/modules/visual_script/doc_classes/VisualScript.xml index cc55b72ec7..46bd35dd73 100644 --- a/modules/visual_script/doc_classes/VisualScript.xml +++ b/modules/visual_script/doc_classes/VisualScript.xml @@ -495,10 +495,6 @@ </description> </method> </methods> - <members> - <member name="data" type="Dictionary" setter="_set_data" getter="_get_data"> - </member> - </members> <signals> <signal name="node_ports_changed"> <argument index="0" name="function" type="String"> diff --git a/modules/visual_script/doc_classes/VisualScriptConstructor.xml b/modules/visual_script/doc_classes/VisualScriptConstructor.xml index f3c6b6a304..cbe8c6c096 100644 --- a/modules/visual_script/doc_classes/VisualScriptConstructor.xml +++ b/modules/visual_script/doc_classes/VisualScriptConstructor.xml @@ -11,31 +11,35 @@ <demos> </demos> <methods> + <method name="get_constructor" qualifiers="const"> + <return type="Dictionary"> + </return> + <description> + </description> + </method> + <method name="get_constructor_type" qualifiers="const"> + <return type="int" enum="Variant.Type"> + </return> + <description> + </description> + </method> + <method name="set_constructor"> + <return type="void"> + </return> + <argument index="0" name="constructor" type="Dictionary"> + </argument> + <description> + </description> + </method> + <method name="set_constructor_type"> + <return type="void"> + </return> + <argument index="0" name="type" type="int" enum="Variant.Type"> + </argument> + <description> + </description> + </method> </methods> - <members> - <member name="constructor" type="Dictionary" setter="set_constructor" getter="get_constructor"> - The constructor function's method info. Has roughly the following structure: - [codeblock] - { - name = "string", - args = [{ - name = "string" - class_name = "string" - type = TYPE_* - hint = PROPERTY_HINT_* - hint_string = "string" - }] - default_args = [] # Array of variants - flags = METHOD_FLAG_* - id = 0 - return = {type = TYPE_*} - } - [/codeblock] - </member> - <member name="type" type="int" setter="set_constructor_type" getter="get_constructor_type" enum="Variant.Type"> - The type to be constructed. - </member> - </members> <constants> </constants> </class> diff --git a/modules/visual_script/doc_classes/VisualScriptDeconstruct.xml b/modules/visual_script/doc_classes/VisualScriptDeconstruct.xml index 86cf4410ac..0f396564e2 100644 --- a/modules/visual_script/doc_classes/VisualScriptDeconstruct.xml +++ b/modules/visual_script/doc_classes/VisualScriptDeconstruct.xml @@ -13,8 +13,6 @@ <methods> </methods> <members> - <member name="elem_cache" type="Array" setter="_set_elem_cache" getter="_get_elem_cache"> - </member> <member name="type" type="int" setter="set_deconstruct_type" getter="get_deconstruct_type" enum="Variant.Type"> The type to deconstruct. </member> diff --git a/modules/visual_script/doc_classes/VisualScriptFunctionCall.xml b/modules/visual_script/doc_classes/VisualScriptFunctionCall.xml index cc2360fc2e..03c47dca7c 100644 --- a/modules/visual_script/doc_classes/VisualScriptFunctionCall.xml +++ b/modules/visual_script/doc_classes/VisualScriptFunctionCall.xml @@ -11,8 +11,6 @@ <methods> </methods> <members> - <member name="argument_cache" type="Dictionary" setter="_set_argument_cache" getter="_get_argument_cache"> - </member> <member name="base_script" type="String" setter="set_base_script" getter="get_base_script"> </member> <member name="base_type" type="String" setter="set_base_type" getter="get_base_type"> diff --git a/modules/visual_script/doc_classes/VisualScriptNode.xml b/modules/visual_script/doc_classes/VisualScriptNode.xml index 94fed44950..ef7cf7c3b8 100644 --- a/modules/visual_script/doc_classes/VisualScriptNode.xml +++ b/modules/visual_script/doc_classes/VisualScriptNode.xml @@ -46,10 +46,6 @@ </description> </method> </methods> - <members> - <member name="_default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values"> - </member> - </members> <signals> <signal name="ports_changed"> <description> diff --git a/modules/visual_script/doc_classes/VisualScriptPropertyGet.xml b/modules/visual_script/doc_classes/VisualScriptPropertyGet.xml index f68f0edeea..11c50f2b97 100644 --- a/modules/visual_script/doc_classes/VisualScriptPropertyGet.xml +++ b/modules/visual_script/doc_classes/VisualScriptPropertyGet.xml @@ -25,8 +25,6 @@ </member> <member name="set_mode" type="int" setter="set_call_mode" getter="get_call_mode" enum="VisualScriptPropertyGet.CallMode"> </member> - <member name="type_cache" type="int" setter="_set_type_cache" getter="_get_type_cache" enum="Variant.Type"> - </member> </members> <constants> <constant name="CALL_MODE_SELF" value="0" enum="CallMode"> diff --git a/modules/visual_script/doc_classes/VisualScriptPropertySet.xml b/modules/visual_script/doc_classes/VisualScriptPropertySet.xml index d4305af57f..2e96ccc1f6 100644 --- a/modules/visual_script/doc_classes/VisualScriptPropertySet.xml +++ b/modules/visual_script/doc_classes/VisualScriptPropertySet.xml @@ -27,8 +27,6 @@ </member> <member name="set_mode" type="int" setter="set_call_mode" getter="get_call_mode" enum="VisualScriptPropertySet.CallMode"> </member> - <member name="type_cache" type="Dictionary" setter="_set_type_cache" getter="_get_type_cache"> - </member> </members> <constants> <constant name="CALL_MODE_SELF" value="0" enum="CallMode"> diff --git a/modules/visual_script/doc_classes/VisualScriptYield.xml b/modules/visual_script/doc_classes/VisualScriptYield.xml index b42fc027cf..72ef586c1f 100644 --- a/modules/visual_script/doc_classes/VisualScriptYield.xml +++ b/modules/visual_script/doc_classes/VisualScriptYield.xml @@ -9,10 +9,22 @@ <demos> </demos> <methods> + <method name="get_yield_mode"> + <return type="int" enum="VisualScriptYield.YieldMode"> + </return> + <description> + </description> + </method> + <method name="set_yield_mode"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="VisualScriptYield.YieldMode"> + </argument> + <description> + </description> + </method> </methods> <members> - <member name="mode" type="int" setter="set_yield_mode" getter="get_yield_mode" enum="VisualScriptYield.YieldMode"> - </member> <member name="wait_time" type="float" setter="set_wait_time" getter="get_wait_time"> </member> </members> diff --git a/modules/visual_script/visual_script_flow_control.cpp b/modules/visual_script/visual_script_flow_control.cpp index 59d9540239..a38266acc0 100644 --- a/modules/visual_script/visual_script_flow_control.cpp +++ b/modules/visual_script/visual_script_flow_control.cpp @@ -731,9 +731,9 @@ void VisualScriptSwitch::_bind_methods() { VisualScriptSwitch::VisualScriptSwitch() { } -////////////////////////////////////////// -////////////////EVENT ACTION FILTER/////////// -////////////////////////////////////////// + ////////////////////////////////////////// + ////////////////EVENT ACTION FILTER/////////// + ////////////////////////////////////////// #if 0 int VisualScriptInputFilter::get_output_sequence_port_count() const { diff --git a/modules/webm/doc_classes/VideoStreamWebm.xml b/modules/webm/doc_classes/VideoStreamWebm.xml index 8b6696cfe9..6e8120b1de 100644 --- a/modules/webm/doc_classes/VideoStreamWebm.xml +++ b/modules/webm/doc_classes/VideoStreamWebm.xml @@ -9,11 +9,21 @@ <demos> </demos> <methods> + <method name="get_file"> + <return type="String"> + </return> + <description> + </description> + </method> + <method name="set_file"> + <return type="void"> + </return> + <argument index="0" name="file" type="String"> + </argument> + <description> + </description> + </method> </methods> - <members> - <member name="file" type="String" setter="set_file" getter="get_file"> - </member> - </members> <constants> </constants> </class> diff --git a/modules/webm/video_stream_webm.cpp b/modules/webm/video_stream_webm.cpp index 0fc9df5b58..b055ccf5aa 100644 --- a/modules/webm/video_stream_webm.cpp +++ b/modules/webm/video_stream_webm.cpp @@ -92,21 +92,27 @@ private: /**/ -VideoStreamPlaybackWebm::VideoStreamPlaybackWebm() - : audio_track(0), - webm(NULL), - video(NULL), - audio(NULL), - video_frames(NULL), audio_frame(NULL), - video_frames_pos(0), video_frames_capacity(0), - num_decoded_samples(0), samples_offset(-1), - mix_callback(NULL), - mix_udata(NULL), - playing(false), paused(false), - delay_compensation(0.0), - time(0.0), video_frame_delay(0.0), video_pos(0.0), - texture(memnew(ImageTexture)), - pcm(NULL) {} +VideoStreamPlaybackWebm::VideoStreamPlaybackWebm() : + audio_track(0), + webm(NULL), + video(NULL), + audio(NULL), + video_frames(NULL), + audio_frame(NULL), + video_frames_pos(0), + video_frames_capacity(0), + num_decoded_samples(0), + samples_offset(-1), + mix_callback(NULL), + mix_udata(NULL), + playing(false), + paused(false), + delay_compensation(0.0), + time(0.0), + video_frame_delay(0.0), + video_pos(0.0), + texture(memnew(ImageTexture)), + pcm(NULL) {} VideoStreamPlaybackWebm::~VideoStreamPlaybackWebm() { delete_pointers(); @@ -403,8 +409,8 @@ void VideoStreamPlaybackWebm::delete_pointers() { /**/ -VideoStreamWebm::VideoStreamWebm() - : audio_track(0) {} +VideoStreamWebm::VideoStreamWebm() : + audio_track(0) {} Ref<VideoStreamPlayback> VideoStreamWebm::instance_playback() { diff --git a/platform/android/power_android.cpp b/platform/android/power_android.cpp index 48c9377a5a..54fb435b62 100644 --- a/platform/android/power_android.cpp +++ b/platform/android/power_android.cpp @@ -245,8 +245,10 @@ int power_android::get_power_percent_left() { } } -power_android::power_android() - : nsecs_left(-1), percent_left(-1), power_state(OS::POWERSTATE_UNKNOWN) { +power_android::power_android() : + nsecs_left(-1), + percent_left(-1), + power_state(OS::POWERSTATE_UNKNOWN) { } power_android::~power_android() { diff --git a/platform/haiku/haiku_application.cpp b/platform/haiku/haiku_application.cpp index d23b9e27d8..e2649b15a4 100644 --- a/platform/haiku/haiku_application.cpp +++ b/platform/haiku/haiku_application.cpp @@ -29,6 +29,6 @@ /*************************************************************************/ #include "haiku_application.h" -HaikuApplication::HaikuApplication() - : BApplication("application/x-vnd.godot") { +HaikuApplication::HaikuApplication() : + BApplication("application/x-vnd.godot") { } diff --git a/platform/haiku/haiku_direct_window.cpp b/platform/haiku/haiku_direct_window.cpp index 24a8a4b17b..aa25064ccb 100644 --- a/platform/haiku/haiku_direct_window.cpp +++ b/platform/haiku/haiku_direct_window.cpp @@ -34,8 +34,8 @@ #include "main/main.h" #include "os/keyboard.h" -HaikuDirectWindow::HaikuDirectWindow(BRect p_frame) - : BDirectWindow(p_frame, "Godot", B_TITLED_WINDOW, B_QUIT_ON_WINDOW_CLOSE) { +HaikuDirectWindow::HaikuDirectWindow(BRect p_frame) : + BDirectWindow(p_frame, "Godot", B_TITLED_WINDOW, B_QUIT_ON_WINDOW_CLOSE) { last_mouse_pos_valid = false; last_buttons_state = 0; last_button_mask = 0; diff --git a/platform/haiku/haiku_gl_view.cpp b/platform/haiku/haiku_gl_view.cpp index d898bd1a5d..bb9c439e94 100644 --- a/platform/haiku/haiku_gl_view.cpp +++ b/platform/haiku/haiku_gl_view.cpp @@ -30,8 +30,8 @@ #include "haiku_gl_view.h" #include "main/main.h" -HaikuGLView::HaikuGLView(BRect frame, uint32 type) - : BGLView(frame, "GodotGLView", B_FOLLOW_ALL_SIDES, 0, type) { +HaikuGLView::HaikuGLView(BRect frame, uint32 type) : + BGLView(frame, "GodotGLView", B_FOLLOW_ALL_SIDES, 0, type) { } void HaikuGLView::AttachedToWindow(void) { diff --git a/platform/haiku/power_haiku.cpp b/platform/haiku/power_haiku.cpp index 8718b317a3..73d60e9fec 100644 --- a/platform/haiku/power_haiku.cpp +++ b/platform/haiku/power_haiku.cpp @@ -64,8 +64,10 @@ int PowerX11::get_power_percent_left() { } } -PowerHaiku::PowerHaiku() - : nsecs_left(-1), percent_left(-1), power_state(OS::POWERSTATE_UNKNOWN) { +PowerHaiku::PowerHaiku() : + nsecs_left(-1), + percent_left(-1), + power_state(OS::POWERSTATE_UNKNOWN) { } PowerHaiku::~PowerHaiku() { diff --git a/platform/iphone/export/export.cpp b/platform/iphone/export/export.cpp index b05bb9ab09..444c9287ad 100644 --- a/platform/iphone/export/export.cpp +++ b/platform/iphone/export/export.cpp @@ -69,8 +69,9 @@ class EditorExportPlatformIOS : public EditorExportPlatform { String name; bool is_default; - ExportArchitecture() - : name(""), is_default(false) { + ExportArchitecture() : + name(""), + is_default(false) { } ExportArchitecture(String p_name, bool p_is_default) { @@ -453,8 +454,9 @@ struct CodesignData { const Ref<EditorExportPreset> &preset; bool debug; - CodesignData(const Ref<EditorExportPreset> &p_preset, bool p_debug) - : preset(p_preset), debug(p_debug) { + CodesignData(const Ref<EditorExportPreset> &p_preset, bool p_debug) : + preset(p_preset), + debug(p_debug) { } }; diff --git a/platform/iphone/os_iphone.cpp b/platform/iphone/os_iphone.cpp index f06657cd7b..1c7f41b464 100644 --- a/platform/iphone/os_iphone.cpp +++ b/platform/iphone/os_iphone.cpp @@ -117,7 +117,7 @@ void OSIPhone::initialize(const VideoMode &p_desired, int p_video_driver, int p_ */ visual_server->init(); - // visual_server->cursor_set_visible(false, 0); + //visual_server->cursor_set_visible(false, 0); // reset this to what it should be, it will have been set to 0 after visual_server->init() is called RasterizerStorageGLES3::system_fbo = gl_view_base_fb; @@ -127,14 +127,6 @@ void OSIPhone::initialize(const VideoMode &p_desired, int p_video_driver, int p_ input = memnew(InputDefault); -/* -#ifdef IOS_SCORELOOP_ENABLED - scoreloop = memnew(ScoreloopIOS); - Engine::get_singleton()->add_singleton(Engine::Singleton("Scoreloop", scoreloop)); - scoreloop->connect(); -#endif - */ - #ifdef GAME_CENTER_ENABLED game_center = memnew(GameCenter); Engine::get_singleton()->add_singleton(Engine::Singleton("GameCenter", game_center)); @@ -149,7 +141,7 @@ void OSIPhone::initialize(const VideoMode &p_desired, int p_video_driver, int p_ #ifdef ICLOUD_ENABLED icloud = memnew(ICloud); Engine::get_singleton()->add_singleton(Engine::Singleton("ICloud", icloud)); -//icloud->connect(); + //icloud->connect(); #endif Engine::get_singleton()->add_singleton(Engine::Singleton("iOS", memnew(iOS))); }; diff --git a/platform/iphone/power_iphone.cpp b/platform/iphone/power_iphone.cpp index 055d31ef0a..03afdb15f9 100644 --- a/platform/iphone/power_iphone.cpp +++ b/platform/iphone/power_iphone.cpp @@ -58,8 +58,10 @@ int PowerIphone::get_power_percent_left() { } } -PowerIphone::PowerIphone() - : nsecs_left(-1), percent_left(-1), power_state(OS::POWERSTATE_UNKNOWN) { +PowerIphone::PowerIphone() : + nsecs_left(-1), + percent_left(-1), + power_state(OS::POWERSTATE_UNKNOWN) { // TODO Auto-generated constructor stub } diff --git a/platform/javascript/dom_keys.h b/platform/javascript/dom_keys.h index d63f165382..bd15cec603 100644 --- a/platform/javascript/dom_keys.h +++ b/platform/javascript/dom_keys.h @@ -262,7 +262,7 @@ int dom2godot_scancode(int dom_keycode) { case DOM_VK_CAPS_LOCK: return KEY_CAPSLOCK; - /* + /* case DOM_VK_KANA: return KEY_UNKNOWN; case DOM_VK_HANGUL: return KEY_UNKNOWN; case DOM_VK_EISU: return KEY_UNKNOWN; @@ -274,7 +274,7 @@ int dom2godot_scancode(int dom_keycode) { case DOM_VK_ESCAPE: return KEY_ESCAPE; - /* + /* case DOM_VK_CONVERT: return KEY_UNKNOWN; case DOM_VK_NONCONVERT: return KEY_UNKNOWN; case DOM_VK_ACCEPT: return KEY_UNKNOWN; @@ -292,7 +292,7 @@ int dom2godot_scancode(int dom_keycode) { case DOM_VK_DOWN: return KEY_DOWN; - //case DOM_VK_SELECT: return KEY_UNKNOWN; + //case DOM_VK_SELECT: return KEY_UNKNOWN; case DOM_VK_PRINTSCREEN: // this is the usual printScreen key case DOM_VK_PRINT: // maybe for alt+printScreen or physical printers? @@ -320,7 +320,7 @@ int dom2godot_scancode(int dom_keycode) { case DOM_VK_DIVIDE: return KEY_KP_DIVIDE; - /* + /* case DOM_VK_F17: return KEY_UNKNOWN; case DOM_VK_F18: return KEY_UNKNOWN; case DOM_VK_F19: return KEY_UNKNOWN; @@ -335,7 +335,7 @@ int dom2godot_scancode(int dom_keycode) { case DOM_VK_SCROLL_LOCK: return KEY_SCROLLLOCK; - /* + /* case DOM_VK_WIN_OEM_FJ_JISHO: return KEY_UNKNOWN; case DOM_VK_WIN_OEM_FJ_MASSHOU: return KEY_UNKNOWN; case DOM_VK_WIN_OEM_FJ_TOUROKU: return KEY_UNKNOWN; @@ -375,7 +375,7 @@ int dom2godot_scancode(int dom_keycode) { case DOM_VK_QUOTE: return KEY_APOSTROPHE; - // rest is OEM/unusual + // rest is OEM/unusual default: return KEY_UNKNOWN; }; diff --git a/platform/javascript/power_javascript.cpp b/platform/javascript/power_javascript.cpp index 10964502d4..54fceb75f4 100644 --- a/platform/javascript/power_javascript.cpp +++ b/platform/javascript/power_javascript.cpp @@ -63,8 +63,10 @@ int PowerJavascript::get_power_percent_left() { } } -PowerJavascript::PowerJavascript() - : nsecs_left(-1), percent_left(-1), power_state(OS::POWERSTATE_UNKNOWN) { +PowerJavascript::PowerJavascript() : + nsecs_left(-1), + percent_left(-1), + power_state(OS::POWERSTATE_UNKNOWN) { } PowerJavascript::~PowerJavascript() { diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 732ec910c0..6cc8be250d 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -1028,7 +1028,7 @@ void OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_au // OS X needs non-zero color size, so set resonable values int colorBits = 32; -// Fail if a robustness strategy was requested + // Fail if a robustness strategy was requested #define ADD_ATTR(x) \ { attributes[attributeCount++] = x; } diff --git a/platform/osx/power_osx.cpp b/platform/osx/power_osx.cpp index eed03e63c1..bd5f9fe65f 100644 --- a/platform/osx/power_osx.cpp +++ b/platform/osx/power_osx.cpp @@ -242,8 +242,10 @@ int power_osx::get_power_percent_left() { } } -power_osx::power_osx() - : nsecs_left(-1), percent_left(-1), power_state(OS::POWERSTATE_UNKNOWN) { +power_osx::power_osx() : + nsecs_left(-1), + percent_left(-1), + power_state(OS::POWERSTATE_UNKNOWN) { } power_osx::~power_osx() { diff --git a/platform/uwp/app.cpp b/platform/uwp/app.cpp index c565999d82..b47b99744e 100644 --- a/platform/uwp/app.cpp +++ b/platform/uwp/app.cpp @@ -77,15 +77,15 @@ public: return 0; } -App::App() - : mWindowClosed(false), - mWindowVisible(true), - mWindowWidth(0), - mWindowHeight(0), - mEglDisplay(EGL_NO_DISPLAY), - mEglContext(EGL_NO_CONTEXT), - mEglSurface(EGL_NO_SURFACE), - number_of_contacts(0) { +App::App() : + mWindowClosed(false), + mWindowVisible(true), + mWindowWidth(0), + mWindowHeight(0), + mEglDisplay(EGL_NO_DISPLAY), + mEglContext(EGL_NO_CONTEXT), + mEglSurface(EGL_NO_SURFACE), + number_of_contacts(0) { } // The first method called when the IFrameworkView is being created. diff --git a/platform/uwp/gl_context_egl.cpp b/platform/uwp/gl_context_egl.cpp index dafe5d5e25..2130af6d60 100644 --- a/platform/uwp/gl_context_egl.cpp +++ b/platform/uwp/gl_context_egl.cpp @@ -108,7 +108,8 @@ Error ContextEGL::initialize() { EGL_NONE,*/ // These are the default display attributes, used to request ANGLE's D3D11 renderer. // eglInitialize will only succeed with these attributes if the hardware supports D3D11 Feature Level 10_0+. - EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, + EGL_PLATFORM_ANGLE_TYPE_ANGLE, + EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, // EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER is an optimization that can have large performance benefits on mobile devices. // Its syntax is subject to change, though. Please update your Visual Studio templates if you experience compilation issues with it. @@ -117,7 +118,8 @@ Error ContextEGL::initialize() { // EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE is an option that enables ANGLE to automatically call // the IDXGIDevice3::Trim method on behalf of the application when it gets suspended. // Calling IDXGIDevice3::Trim when an application is suspended is a Windows Store application certification requirement. - EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE, EGL_TRUE, + EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE, + EGL_TRUE, EGL_NONE, }; @@ -190,10 +192,10 @@ void ContextEGL::cleanup() { } }; -ContextEGL::ContextEGL(CoreWindow ^ p_window) - : mEglDisplay(EGL_NO_DISPLAY), - mEglContext(EGL_NO_CONTEXT), - mEglSurface(EGL_NO_SURFACE) { +ContextEGL::ContextEGL(CoreWindow ^ p_window) : + mEglDisplay(EGL_NO_DISPLAY), + mEglContext(EGL_NO_CONTEXT), + mEglSurface(EGL_NO_SURFACE) { window = p_window; }; diff --git a/platform/uwp/joypad_uwp.cpp b/platform/uwp/joypad_uwp.cpp index 0f84bd55a3..088d232e04 100644 --- a/platform/uwp/joypad_uwp.cpp +++ b/platform/uwp/joypad_uwp.cpp @@ -54,7 +54,7 @@ void JoypadUWP::process_controllers() { case ControllerType::GAMEPAD_CONTROLLER: { - GamepadReading reading = ((Gamepad ^)joy.controller_reference)->GetCurrentReading(); + GamepadReading reading = ((Gamepad ^) joy.controller_reference)->GetCurrentReading(); int button_mask = (int)GamepadButtons::Menu; for (int j = 0; j < 14; j++) { @@ -161,7 +161,7 @@ void JoypadUWP::joypad_vibration_start(int p_device, float p_weak_magnitude, flo GamepadVibration vibration; vibration.LeftMotor = p_strong_magnitude; vibration.RightMotor = p_weak_magnitude; - ((Gamepad ^)joy.controller_reference)->Vibration = vibration; + ((Gamepad ^) joy.controller_reference)->Vibration = vibration; joy.ff_timestamp = p_timestamp; joy.ff_end_timestamp = p_duration == 0 ? 0 : p_timestamp + (uint64_t)(p_duration * 1000000.0); @@ -175,7 +175,7 @@ void JoypadUWP::joypad_vibration_stop(int p_device, uint64_t p_timestamp) { GamepadVibration vibration; vibration.LeftMotor = 0.0; vibration.RightMotor = 0.0; - ((Gamepad ^)joy.controller_reference)->Vibration = vibration; + ((Gamepad ^) joy.controller_reference)->Vibration = vibration; joy.ff_timestamp = p_timestamp; joy.vibrating = false; diff --git a/platform/uwp/power_uwp.cpp b/platform/uwp/power_uwp.cpp index 81e97b1391..14fce8b133 100644 --- a/platform/uwp/power_uwp.cpp +++ b/platform/uwp/power_uwp.cpp @@ -30,8 +30,10 @@ #include "power_uwp.h" -PowerUWP::PowerUWP() - : nsecs_left(-1), percent_left(-1), power_state(OS::POWERSTATE_UNKNOWN) { +PowerUWP::PowerUWP() : + nsecs_left(-1), + percent_left(-1), + power_state(OS::POWERSTATE_UNKNOWN) { } PowerUWP::~PowerUWP() { diff --git a/platform/windows/crash_handler_win.cpp b/platform/windows/crash_handler_win.cpp index feea3911b2..5657036693 100644 --- a/platform/windows/crash_handler_win.cpp +++ b/platform/windows/crash_handler_win.cpp @@ -61,8 +61,8 @@ class symbol { static const int max_name_len = 1024; public: - symbol(HANDLE process, DWORD64 address) - : sym((sym_type *)::operator new(sizeof(*sym) + max_name_len)) { + symbol(HANDLE process, DWORD64 address) : + sym((sym_type *)::operator new(sizeof(*sym) + max_name_len)) { memset(sym, '\0', sizeof(*sym) + max_name_len); sym->SizeOfStruct = sizeof(*sym); sym->MaxNameLength = max_name_len; @@ -85,8 +85,8 @@ class get_mod_info { HANDLE process; public: - get_mod_info(HANDLE h) - : process(h) {} + get_mod_info(HANDLE h) : + process(h) {} module_data operator()(HMODULE module) { module_data ret; diff --git a/platform/windows/detect.py b/platform/windows/detect.py index 890decf962..d85e1b061c 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -270,7 +270,7 @@ def configure(env): env.Append(CCFLAGS=['-DOPENGL_ENABLED']) env.Append(CCFLAGS=['-DRTAUDIO_ENABLED']) env.Append(CCFLAGS=['-DWASAPI_ENABLED']) - env.Append(CCFLAGS=['-DWINVER=%s' % winver, '-D_WIN32_WINNT=%s' % winver]) + env.Append(CCFLAGS=['-DWINVER=%s' % env['target_win_version'], '-D_WIN32_WINNT=%s' % env['target_win_version']]) env.Append(LIBS=['mingw32', 'opengl32', 'dsound', 'ole32', 'd3d9', 'winmm', 'gdi32', 'iphlpapi', 'shlwapi', 'wsock32', 'ws2_32', 'kernel32', 'oleaut32', 'dinput8', 'dxguid', 'ksuser']) env.Append(CPPFLAGS=['-DMINGW_ENABLED']) diff --git a/platform/windows/power_windows.cpp b/platform/windows/power_windows.cpp index 8d86f160f1..cc452d774d 100644 --- a/platform/windows/power_windows.cpp +++ b/platform/windows/power_windows.cpp @@ -121,8 +121,10 @@ int PowerWindows::get_power_percent_left() { } } -PowerWindows::PowerWindows() - : nsecs_left(-1), percent_left(-1), power_state(OS::POWERSTATE_UNKNOWN) { +PowerWindows::PowerWindows() : + nsecs_left(-1), + percent_left(-1), + power_state(OS::POWERSTATE_UNKNOWN) { } PowerWindows::~PowerWindows() { diff --git a/platform/x11/context_gl_x11.cpp b/platform/x11/context_gl_x11.cpp index 4f9d4a84b9..61c6b3c9dd 100644 --- a/platform/x11/context_gl_x11.cpp +++ b/platform/x11/context_gl_x11.cpp @@ -228,8 +228,8 @@ bool ContextGL_X11::is_using_vsync() const { return use_vsync; } -ContextGL_X11::ContextGL_X11(::Display *p_x11_display, ::Window &p_x11_window, const OS::VideoMode &p_default_video_mode, bool p_opengl_3_context) - : x11_window(p_x11_window) { +ContextGL_X11::ContextGL_X11(::Display *p_x11_display, ::Window &p_x11_window, const OS::VideoMode &p_default_video_mode, bool p_opengl_3_context) : + x11_window(p_x11_window) { default_video_mode = p_default_video_mode; x11_display = p_x11_display; diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index bf63921b06..c210a03688 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -132,10 +132,9 @@ void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_au // Try to support IME if detectable auto-repeat is supported if (xkb_dar == True) { -// Xutf8LookupString will be used later instead of XmbLookupString before -// the multibyte sequences can be converted to unicode string. - #ifdef X_HAVE_UTF8_STRING + // Xutf8LookupString will be used later instead of XmbLookupString before + // the multibyte sequences can be converted to unicode string. modifiers = XSetLocaleModifiers(""); #endif } @@ -548,7 +547,7 @@ void OS_X11::finalize() { memdelete(main_loop); main_loop = NULL; -/* + /* if (debugger_connection_console) { memdelete(debugger_connection_console); } diff --git a/platform/x11/power_x11.cpp b/platform/x11/power_x11.cpp index 76ff7f91fb..0ef2629cb0 100644 --- a/platform/x11/power_x11.cpp +++ b/platform/x11/power_x11.cpp @@ -542,8 +542,10 @@ bool PowerX11::UpdatePowerInfo() { return false; } -PowerX11::PowerX11() - : nsecs_left(-1), percent_left(-1), power_state(OS::POWERSTATE_UNKNOWN) { +PowerX11::PowerX11() : + nsecs_left(-1), + percent_left(-1), + power_state(OS::POWERSTATE_UNKNOWN) { } PowerX11::~PowerX11() { diff --git a/scene/2d/area_2d.cpp b/scene/2d/area_2d.cpp index 9ee77a710c..80f9bf0f9f 100644 --- a/scene/2d/area_2d.cpp +++ b/scene/2d/area_2d.cpp @@ -688,8 +688,8 @@ void Area2D::_bind_methods() { BIND_ENUM_CONSTANT(SPACE_OVERRIDE_REPLACE_COMBINE); } -Area2D::Area2D() - : CollisionObject2D(Physics2DServer::get_singleton()->area_create(), true) { +Area2D::Area2D() : + CollisionObject2D(Physics2DServer::get_singleton()->area_create(), true) { space_override = SPACE_OVERRIDE_DISABLED; set_gravity(98); diff --git a/scene/2d/canvas_item.cpp b/scene/2d/canvas_item.cpp index 9a3debbe90..768d5185d7 100644 --- a/scene/2d/canvas_item.cpp +++ b/scene/2d/canvas_item.cpp @@ -211,8 +211,8 @@ void CanvasItemMaterial::_bind_methods() { BIND_ENUM_CONSTANT(LIGHT_MODE_LIGHT_ONLY); } -CanvasItemMaterial::CanvasItemMaterial() - : element(this) { +CanvasItemMaterial::CanvasItemMaterial() : + element(this) { blend_mode = BLEND_MODE_MIX; light_mode = LIGHT_MODE_NORMAL; @@ -1131,8 +1131,8 @@ Rect2 CanvasItem::_edit_get_item_and_children_rect() const { return rect; } -CanvasItem::CanvasItem() - : xform_change(this) { +CanvasItem::CanvasItem() : + xform_change(this) { canvas_item = VisualServer::get_singleton()->canvas_item_create(); visible = true; diff --git a/scene/2d/line_2d.cpp b/scene/2d/line_2d.cpp index 9131223ff3..57a0e15447 100644 --- a/scene/2d/line_2d.cpp +++ b/scene/2d/line_2d.cpp @@ -37,8 +37,8 @@ VARIANT_ENUM_CAST(Line2D::LineJointMode) VARIANT_ENUM_CAST(Line2D::LineCapMode) VARIANT_ENUM_CAST(Line2D::LineTextureMode) -Line2D::Line2D() - : Node2D() { +Line2D::Line2D() : + Node2D() { _joint_mode = LINE_JOINT_SHARP; _begin_cap_mode = LINE_CAP_NONE; _end_cap_mode = LINE_CAP_NONE; diff --git a/scene/2d/navigation2d.h b/scene/2d/navigation2d.h index e87b01f7c5..bb97e1a9a9 100644 --- a/scene/2d/navigation2d.h +++ b/scene/2d/navigation2d.h @@ -57,9 +57,9 @@ class Navigation2D : public Node2D { return (a.key == p_key.a.key) ? (b.key < p_key.b.key) : (a.key < p_key.a.key); }; - EdgeKey(const Point &p_a = Point(), const Point &p_b = Point()) - : a(p_a), - b(p_b) { + EdgeKey(const Point &p_a = Point(), const Point &p_b = Point()) : + a(p_a), + b(p_b) { if (a.key > b.key) { SWAP(a, b); } diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp index 1f6127e6eb..a1a1101b11 100644 --- a/scene/2d/physics_body_2d.cpp +++ b/scene/2d/physics_body_2d.cpp @@ -132,8 +132,8 @@ bool PhysicsBody2D::get_collision_layer_bit(int p_bit) const { return get_collision_layer() & (1 << p_bit); } -PhysicsBody2D::PhysicsBody2D(Physics2DServer::BodyMode p_mode) - : CollisionObject2D(Physics2DServer::get_singleton()->body_create(), false) { +PhysicsBody2D::PhysicsBody2D(Physics2DServer::BodyMode p_mode) : + CollisionObject2D(Physics2DServer::get_singleton()->body_create(), false) { Physics2DServer::get_singleton()->body_set_mode(get_rid(), p_mode); collision_layer = 1; @@ -226,8 +226,8 @@ void StaticBody2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::REAL, "bounce", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_bounce", "get_bounce"); } -StaticBody2D::StaticBody2D() - : PhysicsBody2D(Physics2DServer::BODY_MODE_STATIC) { +StaticBody2D::StaticBody2D() : + PhysicsBody2D(Physics2DServer::BODY_MODE_STATIC) { constant_angular_velocity = 0; bounce = 0; @@ -921,8 +921,8 @@ void RigidBody2D::_bind_methods() { BIND_ENUM_CONSTANT(CCD_MODE_CAST_SHAPE); } -RigidBody2D::RigidBody2D() - : PhysicsBody2D(Physics2DServer::BODY_MODE_RIGID) { +RigidBody2D::RigidBody2D() : + PhysicsBody2D(Physics2DServer::BODY_MODE_RIGID) { mode = MODE_RIGID; @@ -1144,8 +1144,8 @@ void KinematicBody2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::REAL, "collision/safe_margin", PROPERTY_HINT_RANGE, "0.001,256,0.001"), "set_safe_margin", "get_safe_margin"); } -KinematicBody2D::KinematicBody2D() - : PhysicsBody2D(Physics2DServer::BODY_MODE_KINEMATIC) { +KinematicBody2D::KinematicBody2D() : + PhysicsBody2D(Physics2DServer::BODY_MODE_KINEMATIC) { margin = 0.08; diff --git a/scene/2d/tile_map.h b/scene/2d/tile_map.h index 8eecf48df2..edc9de0543 100644 --- a/scene/2d/tile_map.h +++ b/scene/2d/tile_map.h @@ -147,8 +147,8 @@ private: navpoly_ids = q.navpoly_ids; occluder_instances = q.occluder_instances; } - Quadrant(const Quadrant &q) - : dirty_list(this) { + Quadrant(const Quadrant &q) : + dirty_list(this) { pos = q.pos; canvas_items = q.canvas_items; body = q.body; @@ -156,8 +156,8 @@ private: occluder_instances = q.occluder_instances; navpoly_ids = q.navpoly_ids; } - Quadrant() - : dirty_list(this) {} + Quadrant() : + dirty_list(this) {} }; Map<PosKey, Quadrant> quadrant_map; diff --git a/scene/3d/area.cpp b/scene/3d/area.cpp index 266bc5e381..422aa556f9 100644 --- a/scene/3d/area.cpp +++ b/scene/3d/area.cpp @@ -737,8 +737,8 @@ void Area::_bind_methods() { BIND_ENUM_CONSTANT(SPACE_OVERRIDE_REPLACE_COMBINE); } -Area::Area() - : CollisionObject(PhysicsServer::get_singleton()->area_create(), true) { +Area::Area() : + CollisionObject(PhysicsServer::get_singleton()->area_create(), true) { space_override = SPACE_OVERRIDE_DISABLED; set_gravity(9.8); diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp index 2754d56a05..8e2f87738a 100644 --- a/scene/3d/gi_probe.cpp +++ b/scene/3d/gi_probe.cpp @@ -410,7 +410,7 @@ static bool planeBoxOverlap(Vector3 normal, float d, Vector3 maxbox) { rad = fa * boxhalfsize.x + fb * boxhalfsize.z; \ if (min > rad || max < -rad) return false; -/*======================== Z-tests ========================*/ + /*======================== Z-tests ========================*/ #define AXISTEST_Z12(a, b, fa, fb) \ p1 = a * v1.x - b * v1.y; \ diff --git a/scene/3d/light.cpp b/scene/3d/light.cpp index 126c07f0be..1fc4e932e8 100644 --- a/scene/3d/light.cpp +++ b/scene/3d/light.cpp @@ -367,8 +367,8 @@ void DirectionalLight::_bind_methods() { BIND_ENUM_CONSTANT(SHADOW_DEPTH_RANGE_OPTIMIZED); } -DirectionalLight::DirectionalLight() - : Light(VisualServer::LIGHT_DIRECTIONAL) { +DirectionalLight::DirectionalLight() : + Light(VisualServer::LIGHT_DIRECTIONAL) { set_param(PARAM_SHADOW_NORMAL_BIAS, 0.8); set_param(PARAM_SHADOW_BIAS, 0.1); @@ -422,8 +422,8 @@ void OmniLight::_bind_methods() { BIND_ENUM_CONSTANT(SHADOW_DETAIL_HORIZONTAL); } -OmniLight::OmniLight() - : Light(VisualServer::LIGHT_OMNI) { +OmniLight::OmniLight() : + Light(VisualServer::LIGHT_OMNI) { set_shadow_mode(SHADOW_CUBE); set_shadow_detail(SHADOW_DETAIL_HORIZONTAL); diff --git a/scene/3d/light.h b/scene/3d/light.h index 8514b429ec..33e62214b1 100644 --- a/scene/3d/light.h +++ b/scene/3d/light.h @@ -208,8 +208,8 @@ protected: static void _bind_methods(); public: - SpotLight() - : Light(VisualServer::LIGHT_SPOT) {} + SpotLight() : + Light(VisualServer::LIGHT_SPOT) {} }; #endif diff --git a/scene/3d/navigation.h b/scene/3d/navigation.h index 010d16dedd..d9a38f7b00 100644 --- a/scene/3d/navigation.h +++ b/scene/3d/navigation.h @@ -58,9 +58,9 @@ class Navigation : public Spatial { return (a.key == p_key.a.key) ? (b.key < p_key.b.key) : (a.key < p_key.a.key); }; - EdgeKey(const Point &p_a = Point(), const Point &p_b = Point()) - : a(p_a), - b(p_b) { + EdgeKey(const Point &p_a = Point(), const Point &p_b = Point()) : + a(p_a), + b(p_b) { if (a.key > b.key) { SWAP(a, b); } diff --git a/scene/3d/particles.cpp b/scene/3d/particles.cpp index f8685a7b7c..ea8e617adc 100644 --- a/scene/3d/particles.cpp +++ b/scene/3d/particles.cpp @@ -1523,8 +1523,8 @@ void ParticlesMaterial::_bind_methods() { BIND_ENUM_CONSTANT(EMISSION_SHAPE_DIRECTED_POINTS); } -ParticlesMaterial::ParticlesMaterial() - : element(this) { +ParticlesMaterial::ParticlesMaterial() : + element(this) { set_spread(45); set_flatness(0); diff --git a/scene/3d/physics_body.cpp b/scene/3d/physics_body.cpp index 4e06b272e2..f2f00bb617 100644 --- a/scene/3d/physics_body.cpp +++ b/scene/3d/physics_body.cpp @@ -166,8 +166,8 @@ void PhysicsBody::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "collision_mask", PROPERTY_HINT_LAYERS_3D_PHYSICS), "set_collision_mask", "get_collision_mask"); } -PhysicsBody::PhysicsBody(PhysicsServer::BodyMode p_mode) - : CollisionObject(PhysicsServer::get_singleton()->body_create(p_mode), false) { +PhysicsBody::PhysicsBody(PhysicsServer::BodyMode p_mode) : + CollisionObject(PhysicsServer::get_singleton()->body_create(p_mode), false) { collision_layer = 1; collision_mask = 1; @@ -241,8 +241,8 @@ void StaticBody::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "constant_angular_velocity"), "set_constant_angular_velocity", "get_constant_angular_velocity"); } -StaticBody::StaticBody() - : PhysicsBody(PhysicsServer::BODY_MODE_STATIC) { +StaticBody::StaticBody() : + PhysicsBody(PhysicsServer::BODY_MODE_STATIC) { bounce = 0; friction = 1; @@ -881,8 +881,8 @@ void RigidBody::_bind_methods() { BIND_ENUM_CONSTANT(AXIS_LOCK_Z); } -RigidBody::RigidBody() - : PhysicsBody(PhysicsServer::BODY_MODE_RIGID) { +RigidBody::RigidBody() : + PhysicsBody(PhysicsServer::BODY_MODE_RIGID) { mode = MODE_RIGID; @@ -1104,8 +1104,8 @@ void KinematicBody::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::REAL, "collision/safe_margin", PROPERTY_HINT_RANGE, "0.001,256,0.001"), "set_safe_margin", "get_safe_margin"); } -KinematicBody::KinematicBody() - : PhysicsBody(PhysicsServer::BODY_MODE_KINEMATIC) { +KinematicBody::KinematicBody() : + PhysicsBody(PhysicsServer::BODY_MODE_KINEMATIC) { margin = 0.001; diff --git a/scene/3d/spatial.cpp b/scene/3d/spatial.cpp index 588aa2881a..d9f88ac693 100644 --- a/scene/3d/spatial.cpp +++ b/scene/3d/spatial.cpp @@ -756,8 +756,8 @@ void Spatial::_bind_methods() { ADD_SIGNAL(MethodInfo("visibility_changed")); } -Spatial::Spatial() - : xform_change(this) { +Spatial::Spatial() : + xform_change(this) { data.dirty = DIRTY_NONE; data.children_lock = 0; diff --git a/scene/3d/vehicle_body.cpp b/scene/3d/vehicle_body.cpp index a072572142..2e3e179a7b 100644 --- a/scene/3d/vehicle_body.cpp +++ b/scene/3d/vehicle_body.cpp @@ -54,8 +54,8 @@ public: const Vector3 &inertiaInvA, const real_t massInvA, const Vector3 &inertiaInvB, - const real_t massInvB) - : m_linearJointAxis(jointAxis) { + const real_t massInvB) : + m_linearJointAxis(jointAxis) { m_aJ = world2A.xform(rel_pos1.cross(m_linearJointAxis)); m_bJ = world2B.xform(rel_pos2.cross(-m_linearJointAxis)); m_0MinvJt = inertiaInvA * m_aJ; @@ -593,12 +593,12 @@ void VehicleBody::_resolve_single_bilateral(PhysicsDirectBodyState *s, const Vec #endif } -VehicleBody::btVehicleWheelContactPoint::btVehicleWheelContactPoint(PhysicsDirectBodyState *s, PhysicsBody *body1, const Vector3 &frictionPosWorld, const Vector3 &frictionDirectionWorld, real_t maxImpulse) - : m_s(s), - m_body1(body1), - m_frictionPositionWorld(frictionPosWorld), - m_frictionDirectionWorld(frictionDirectionWorld), - m_maxImpulse(maxImpulse) { +VehicleBody::btVehicleWheelContactPoint::btVehicleWheelContactPoint(PhysicsDirectBodyState *s, PhysicsBody *body1, const Vector3 &frictionPosWorld, const Vector3 &frictionDirectionWorld, real_t maxImpulse) : + m_s(s), + m_body1(body1), + m_frictionPositionWorld(frictionPosWorld), + m_frictionDirectionWorld(frictionDirectionWorld), + m_maxImpulse(maxImpulse) { float denom0 = 0; float denom1 = 0; @@ -969,8 +969,8 @@ void VehicleBody::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::REAL, "friction", PROPERTY_HINT_RANGE, "0.01,1,0.01"), "set_friction", "get_friction"); } -VehicleBody::VehicleBody() - : PhysicsBody(PhysicsServer::BODY_MODE_RIGID) { +VehicleBody::VehicleBody() : + PhysicsBody(PhysicsServer::BODY_MODE_RIGID) { m_pitchControl = 0; m_currentVehicleSpeedKmHour = real_t(0.); diff --git a/scene/animation/tween_interpolaters.cpp b/scene/animation/tween_interpolaters.cpp index 8f543a575a..cbf941f3ed 100644 --- a/scene/animation/tween_interpolaters.cpp +++ b/scene/animation/tween_interpolaters.cpp @@ -50,7 +50,7 @@ static real_t in_out(real_t t, real_t b, real_t c, real_t d) { static real_t out_in(real_t t, real_t b, real_t c, real_t d) { return c * t / d + b; } -}; +}; // namespace linear /////////////////////////////////////////////////////////////////////////// // sine /////////////////////////////////////////////////////////////////////////// @@ -70,7 +70,7 @@ static real_t in_out(real_t t, real_t b, real_t c, real_t d) { static real_t out_in(real_t t, real_t b, real_t c, real_t d) { return (t < d / 2) ? out(t * 2, b, c / 2, d) : in((t * 2) - d, b + c / 2, c / 2, d); } -}; +}; // namespace sine /////////////////////////////////////////////////////////////////////////// // quint /////////////////////////////////////////////////////////////////////////// @@ -92,7 +92,7 @@ static real_t in_out(real_t t, real_t b, real_t c, real_t d) { static real_t out_in(real_t t, real_t b, real_t c, real_t d) { return (t < d / 2) ? out(t * 2, b, c / 2, d) : in((t * 2) - d, b + c / 2, c / 2, d); } -}; +}; // namespace quint /////////////////////////////////////////////////////////////////////////// // quart /////////////////////////////////////////////////////////////////////////// @@ -114,7 +114,7 @@ static real_t in_out(real_t t, real_t b, real_t c, real_t d) { static real_t out_in(real_t t, real_t b, real_t c, real_t d) { return (t < d / 2) ? out(t * 2, b, c / 2, d) : in((t * 2) - d, b + c / 2, c / 2, d); } -}; +}; // namespace quart /////////////////////////////////////////////////////////////////////////// // quad /////////////////////////////////////////////////////////////////////////// @@ -137,7 +137,7 @@ static real_t in_out(real_t t, real_t b, real_t c, real_t d) { static real_t out_in(real_t t, real_t b, real_t c, real_t d) { return (t < d / 2) ? out(t * 2, b, c / 2, d) : in((t * 2) - d, b + c / 2, c / 2, d); } -}; +}; // namespace quad /////////////////////////////////////////////////////////////////////////// // expo /////////////////////////////////////////////////////////////////////////// @@ -163,7 +163,7 @@ static real_t in_out(real_t t, real_t b, real_t c, real_t d) { static real_t out_in(real_t t, real_t b, real_t c, real_t d) { return (t < d / 2) ? out(t * 2, b, c / 2, d) : in((t * 2) - d, b + c / 2, c / 2, d); } -}; +}; // namespace expo /////////////////////////////////////////////////////////////////////////// // elastic /////////////////////////////////////////////////////////////////////////// @@ -205,7 +205,7 @@ static real_t in_out(real_t t, real_t b, real_t c, real_t d) { static real_t out_in(real_t t, real_t b, real_t c, real_t d) { return (t < d / 2) ? out(t * 2, b, c / 2, d) : in((t * 2) - d, b + c / 2, c / 2, d); } -}; +}; // namespace elastic /////////////////////////////////////////////////////////////////////////// // cubic /////////////////////////////////////////////////////////////////////////// @@ -227,7 +227,7 @@ static real_t in_out(real_t t, real_t b, real_t c, real_t d) { static real_t out_in(real_t t, real_t b, real_t c, real_t d) { return (t < d / 2) ? out(t * 2, b, c / 2, d) : in((t * 2) - d, b + c / 2, c / 2, d); } -}; +}; // namespace cubic /////////////////////////////////////////////////////////////////////////// // circ /////////////////////////////////////////////////////////////////////////// @@ -248,7 +248,7 @@ static real_t in_out(real_t t, real_t b, real_t c, real_t d) { static real_t out_in(real_t t, real_t b, real_t c, real_t d) { return (t < d / 2) ? out(t * 2, b, c / 2, d) : in((t * 2) - d, b + c / 2, c / 2, d); } -}; +}; // namespace circ /////////////////////////////////////////////////////////////////////////// // bounce /////////////////////////////////////////////////////////////////////////// @@ -281,7 +281,7 @@ static real_t in_out(real_t t, real_t b, real_t c, real_t d) { static real_t out_in(real_t t, real_t b, real_t c, real_t d) { return (t < d / 2) ? out(t * 2, b, c / 2, d) : in((t * 2) - d, b + c / 2, c / 2, d); } -}; +}; // namespace bounce /////////////////////////////////////////////////////////////////////////// // back /////////////////////////////////////////////////////////////////////////// @@ -307,7 +307,7 @@ static real_t in_out(real_t t, real_t b, real_t c, real_t d) { static real_t out_in(real_t t, real_t b, real_t c, real_t d) { return (t < d / 2) ? out(t * 2, b, c / 2, d) : in((t * 2) - d, b + c / 2, c / 2, d); } -}; +}; // namespace back Tween::interpolater Tween::interpolaters[Tween::TRANS_COUNT][Tween::EASE_COUNT] = { { &linear::in, &linear::out, &linear::in_out, &linear::out_in }, diff --git a/scene/gui/box_container.h b/scene/gui/box_container.h index 4d00a2011f..ebbbbed1f9 100644 --- a/scene/gui/box_container.h +++ b/scene/gui/box_container.h @@ -70,8 +70,8 @@ class HBoxContainer : public BoxContainer { GDCLASS(HBoxContainer, BoxContainer); public: - HBoxContainer() - : BoxContainer(false) {} + HBoxContainer() : + BoxContainer(false) {} }; class MarginContainer; @@ -82,8 +82,8 @@ class VBoxContainer : public BoxContainer { public: MarginContainer *add_margin_child(const String &p_label, Control *p_control, bool p_expand = false); - VBoxContainer() - : BoxContainer(true) {} + VBoxContainer() : + BoxContainer(true) {} }; VARIANT_ENUM_CAST(BoxContainer::AlignMode); diff --git a/scene/gui/check_box.cpp b/scene/gui/check_box.cpp index e2b10a948f..00f6153062 100644 --- a/scene/gui/check_box.cpp +++ b/scene/gui/check_box.cpp @@ -56,8 +56,8 @@ bool CheckBox::is_radio() { return get_button_group().is_valid(); } -CheckBox::CheckBox(const String &p_text) - : Button(p_text) { +CheckBox::CheckBox(const String &p_text) : + Button(p_text) { set_toggle_mode(true); set_text_align(ALIGN_LEFT); } diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index 7a0593bc87..cb6283507e 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -486,8 +486,8 @@ void ColorPicker::_bind_methods() { ADD_SIGNAL(MethodInfo("color_changed", PropertyInfo(Variant::COLOR, "color"))); } -ColorPicker::ColorPicker() - : BoxContainer(true) { +ColorPicker::ColorPicker() : + BoxContainer(true) { updating = true; edit_alpha = true; diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index f7bf1cd9ea..85ae6d6241 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -1046,6 +1046,10 @@ void LineEdit::set_cursor_position(int p_pos) { } else if (cursor_pos > window_pos) { /* Adjust window if cursor goes too much to the right */ int window_width = get_size().width - style->get_minimum_size().width; + if (has_icon("right_icon")) { + Ref<Texture> r_icon = Control::get_icon("right_icon"); + window_width -= r_icon->get_width(); + } if (window_width < 0) return; diff --git a/scene/gui/scroll_bar.h b/scene/gui/scroll_bar.h index 373483a8a0..753bd35de7 100644 --- a/scene/gui/scroll_bar.h +++ b/scene/gui/scroll_bar.h @@ -117,8 +117,8 @@ class HScrollBar : public ScrollBar { GDCLASS(HScrollBar, ScrollBar); public: - HScrollBar() - : ScrollBar(HORIZONTAL) { set_v_size_flags(0); } + HScrollBar() : + ScrollBar(HORIZONTAL) { set_v_size_flags(0); } }; class VScrollBar : public ScrollBar { @@ -126,8 +126,8 @@ class VScrollBar : public ScrollBar { GDCLASS(VScrollBar, ScrollBar); public: - VScrollBar() - : ScrollBar(VERTICAL) { set_h_size_flags(0); } + VScrollBar() : + ScrollBar(VERTICAL) { set_h_size_flags(0); } }; #endif diff --git a/scene/gui/slider.h b/scene/gui/slider.h index a2334a69fc..95ae429d63 100644 --- a/scene/gui/slider.h +++ b/scene/gui/slider.h @@ -77,8 +77,8 @@ class HSlider : public Slider { GDCLASS(HSlider, Slider); public: - HSlider() - : Slider(HORIZONTAL) { set_v_size_flags(0); } + HSlider() : + Slider(HORIZONTAL) { set_v_size_flags(0); } }; class VSlider : public Slider { @@ -86,8 +86,8 @@ class VSlider : public Slider { GDCLASS(VSlider, Slider); public: - VSlider() - : Slider(VERTICAL) { set_h_size_flags(0); } + VSlider() : + Slider(VERTICAL) { set_h_size_flags(0); } }; #endif // SLIDER_H diff --git a/scene/gui/split_container.h b/scene/gui/split_container.h index 8ec21b5eaa..c7a484c4c5 100644 --- a/scene/gui/split_container.h +++ b/scene/gui/split_container.h @@ -87,8 +87,8 @@ class HSplitContainer : public SplitContainer { GDCLASS(HSplitContainer, SplitContainer); public: - HSplitContainer() - : SplitContainer(false) { set_default_cursor_shape(CURSOR_HSPLIT); } + HSplitContainer() : + SplitContainer(false) { set_default_cursor_shape(CURSOR_HSPLIT); } }; class VSplitContainer : public SplitContainer { @@ -96,8 +96,8 @@ class VSplitContainer : public SplitContainer { GDCLASS(VSplitContainer, SplitContainer); public: - VSplitContainer() - : SplitContainer(true) { set_default_cursor_shape(CURSOR_VSPLIT); } + VSplitContainer() : + SplitContainer(true) { set_default_cursor_shape(CURSOR_VSPLIT); } }; #endif // SPLIT_CONTAINER_H diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 396186d487..5c23a08971 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -251,13 +251,14 @@ void TextEdit::Text::clear() { insert(0, ""); } -int TextEdit::Text::get_max_width() const { +int TextEdit::Text::get_max_width(bool p_exclude_hidden) const { //quite some work.. but should be fast enough. int max = 0; - - for (int i = 0; i < text.size(); i++) - max = MAX(max, get_line_width(i)); + for (int i = 0; i < text.size(); i++) { + if (!p_exclude_hidden || !is_hidden(i)) + max = MAX(max, get_line_width(i)); + } return max; } @@ -307,7 +308,7 @@ void TextEdit::_update_scrollbars() { int vscroll_pixels = v_scroll->get_combined_minimum_size().width; int visible_width = size.width - cache.style_normal->get_minimum_size().width; - int total_width = text.get_max_width() + vmin.x; + int total_width = text.get_max_width(true) + vmin.x; if (line_numbers) total_width += cache.line_number_w; @@ -360,6 +361,7 @@ void TextEdit::_update_scrollbars() { } } else { + cursor.line_ofs = 0; line_scroll_pos = 0; v_scroll->set_value(0); @@ -371,12 +373,16 @@ void TextEdit::_update_scrollbars() { h_scroll->show(); h_scroll->set_max(total_width); h_scroll->set_page(visible_width); + if (cursor.x_ofs > (total_width - visible_width)) + cursor.x_ofs = (total_width - visible_width); if (fabs(h_scroll->get_value() - (double)cursor.x_ofs) >= 1) { h_scroll->set_value(cursor.x_ofs); } } else { + cursor.x_ofs = 0; + h_scroll->set_value(0); h_scroll->hide(); } @@ -4507,16 +4513,17 @@ int TextEdit::num_lines_from(int p_line_from, int unhidden_amount) const { return num_total; } -int TextEdit::get_whitespace_level(int p_line) const { +int TextEdit::get_indent_level(int p_line) const { ERR_FAIL_INDEX_V(p_line, text.size(), 0); // counts number of tabs and spaces before line starts + int tab_count = 0; int whitespace_count = 0; int line_length = text[p_line].size(); for (int i = 0; i < line_length - 1; i++) { if (text[p_line][i] == '\t') { - whitespace_count++; + tab_count++; } else if (text[p_line][i] == ' ') { whitespace_count++; } else if (text[p_line][i] == '#') { @@ -4525,7 +4532,7 @@ int TextEdit::get_whitespace_level(int p_line) const { break; } } - return whitespace_count; + return tab_count + whitespace_count / indent_size; } bool TextEdit::can_fold(int p_line) const { @@ -4542,12 +4549,12 @@ bool TextEdit::can_fold(int p_line) const { if (is_line_hidden(p_line)) return false; - int start_indent = get_whitespace_level(p_line); + int start_indent = get_indent_level(p_line); for (int i = p_line + 1; i < text.size(); i++) { if (text[i].size() == 0) continue; - int next_indent = get_whitespace_level(i); + int next_indent = get_indent_level(i); if (next_indent > start_indent) return true; else @@ -4576,22 +4583,20 @@ void TextEdit::fold_line(int p_line) { return; // hide lines below this one - int start_indent = get_whitespace_level(p_line); + int start_indent = get_indent_level(p_line); + int last_line = start_indent; for (int i = p_line + 1; i < text.size(); i++) { - int cur_indent = get_whitespace_level(i); - if (text[i].size() == 0 || cur_indent > start_indent) { - set_line_as_hidden(i, true); - } else { - // exclude trailing empty lines - for (int trail_i = i - 1; trail_i > p_line; trail_i--) { - if (text[trail_i].size() == 0) - set_line_as_hidden(trail_i, false); - else - break; + if (text[i].strip_edges().size() != 0) { + if (get_indent_level(i) > start_indent) { + last_line = i; + } else { + break; } - break; } } + for (int i = p_line + 1; i <= last_line; i++) { + set_line_as_hidden(i, true); + } // fix selection if (is_selection_active()) { diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index 428c850a1b..c715634c8b 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -159,7 +159,7 @@ class TextEdit : public Control { void set_font(const Ref<Font> &p_font); void set_color_regions(const Vector<ColorRegion> *p_regions) { color_regions = p_regions; } int get_line_width(int p_line) const; - int get_max_width() const; + int get_max_width(bool p_exclude_hidden = false) const; const Map<int, ColorRegionInfo> &get_color_region_info(int p_line); void set(int p_line, const String &p_text); void set_marked(int p_line, bool p_marked) { text[p_line].marked = p_marked; } @@ -431,7 +431,6 @@ public: void fold_all_lines(); void unhide_all_lines(); int num_lines_from(int p_line_from, int unhidden_amount) const; - int get_whitespace_level(int p_line) const; bool can_fold(int p_line) const; bool is_folded(int p_line) const; void fold_line(int p_line); @@ -444,6 +443,7 @@ public: void indent_selection_left(); void indent_selection_right(); + int get_indent_level(int p_line) const; inline void set_scroll_pass_end_of_file(bool p_enabled) { scroll_past_end_of_file_enabled = p_enabled; diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index 5ee286c2d5..deb40800bc 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -794,6 +794,7 @@ Ref<ArrayMesh> SceneTree::get_debug_contact_mesh() { Vector3(0, 0, 1) }; + /* clang-format off */ int diamond_faces[8 * 3] = { 0, 2, 4, 0, 3, 4, @@ -804,6 +805,7 @@ Ref<ArrayMesh> SceneTree::get_debug_contact_mesh() { 1, 2, 5, 1, 3, 5, }; + /* clang-format on */ PoolVector<int> indices; for (int i = 0; i < 8 * 3; i++) diff --git a/scene/main/scene_tree.h b/scene/main/scene_tree.h index 7898dc065a..244fc8da62 100644 --- a/scene/main/scene_tree.h +++ b/scene/main/scene_tree.h @@ -420,8 +420,8 @@ public: void set_screen_stretch(StretchMode p_mode, StretchAspect p_aspect, const Size2 p_minsize, real_t p_shrink = 1); -//void change_scene(const String& p_path); -//Node *get_loaded_scene(); + //void change_scene(const String& p_path); + //Node *get_loaded_scene(); #ifdef TOOLS_ENABLED void set_edited_scene_root(Node *p_node); diff --git a/scene/resources/box_shape.cpp b/scene/resources/box_shape.cpp index 4b9843f3f5..858e19c9a6 100644 --- a/scene/resources/box_shape.cpp +++ b/scene/resources/box_shape.cpp @@ -73,8 +73,8 @@ void BoxShape::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "extents"), "set_extents", "get_extents"); } -BoxShape::BoxShape() - : Shape(PhysicsServer::get_singleton()->shape_create(PhysicsServer::SHAPE_BOX)) { +BoxShape::BoxShape() : + Shape(PhysicsServer::get_singleton()->shape_create(PhysicsServer::SHAPE_BOX)) { set_extents(Vector3(1, 1, 1)); } diff --git a/scene/resources/capsule_shape.cpp b/scene/resources/capsule_shape.cpp index e11b98f82e..f0eb8232e5 100644 --- a/scene/resources/capsule_shape.cpp +++ b/scene/resources/capsule_shape.cpp @@ -113,8 +113,8 @@ void CapsuleShape::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::REAL, "height", PROPERTY_HINT_RANGE, "0.01,4096,0.01"), "set_height", "get_height"); } -CapsuleShape::CapsuleShape() - : Shape(PhysicsServer::get_singleton()->shape_create(PhysicsServer::SHAPE_CAPSULE)) { +CapsuleShape::CapsuleShape() : + Shape(PhysicsServer::get_singleton()->shape_create(PhysicsServer::SHAPE_CAPSULE)) { radius = 1.0; height = 1.0; diff --git a/scene/resources/capsule_shape_2d.cpp b/scene/resources/capsule_shape_2d.cpp index 912150b939..3caf12feb8 100644 --- a/scene/resources/capsule_shape_2d.cpp +++ b/scene/resources/capsule_shape_2d.cpp @@ -97,8 +97,8 @@ void CapsuleShape2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::REAL, "height"), "set_height", "get_height"); } -CapsuleShape2D::CapsuleShape2D() - : Shape2D(Physics2DServer::get_singleton()->capsule_shape_create()) { +CapsuleShape2D::CapsuleShape2D() : + Shape2D(Physics2DServer::get_singleton()->capsule_shape_create()) { radius = 10; height = 20; diff --git a/scene/resources/circle_shape_2d.cpp b/scene/resources/circle_shape_2d.cpp index 287bde4bfb..bff3ed4d67 100644 --- a/scene/resources/circle_shape_2d.cpp +++ b/scene/resources/circle_shape_2d.cpp @@ -76,8 +76,8 @@ void CircleShape2D::draw(const RID &p_to_rid, const Color &p_color) { VisualServer::get_singleton()->canvas_item_add_polygon(p_to_rid, points, col); } -CircleShape2D::CircleShape2D() - : Shape2D(Physics2DServer::get_singleton()->circle_shape_create()) { +CircleShape2D::CircleShape2D() : + Shape2D(Physics2DServer::get_singleton()->circle_shape_create()) { radius = 10; _update_shape(); diff --git a/scene/resources/concave_polygon_shape.cpp b/scene/resources/concave_polygon_shape.cpp index 6ae4fde85e..1c48f0c30b 100644 --- a/scene/resources/concave_polygon_shape.cpp +++ b/scene/resources/concave_polygon_shape.cpp @@ -106,8 +106,8 @@ void ConcavePolygonShape::_bind_methods() { ClassDB::bind_method(D_METHOD("get_faces"), &ConcavePolygonShape::get_faces); } -ConcavePolygonShape::ConcavePolygonShape() - : Shape(PhysicsServer::get_singleton()->shape_create(PhysicsServer::SHAPE_CONCAVE_POLYGON)) { +ConcavePolygonShape::ConcavePolygonShape() : + Shape(PhysicsServer::get_singleton()->shape_create(PhysicsServer::SHAPE_CONCAVE_POLYGON)) { //set_planes(Vector3(1,1,1)); } diff --git a/scene/resources/concave_polygon_shape_2d.cpp b/scene/resources/concave_polygon_shape_2d.cpp index bb91e33ec2..e90046fd28 100644 --- a/scene/resources/concave_polygon_shape_2d.cpp +++ b/scene/resources/concave_polygon_shape_2d.cpp @@ -84,6 +84,6 @@ void ConcavePolygonShape2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::POOL_VECTOR2_ARRAY, "segments"), "set_segments", "get_segments"); } -ConcavePolygonShape2D::ConcavePolygonShape2D() - : Shape2D(Physics2DServer::get_singleton()->concave_polygon_shape_create()) { +ConcavePolygonShape2D::ConcavePolygonShape2D() : + Shape2D(Physics2DServer::get_singleton()->concave_polygon_shape_create()) { } diff --git a/scene/resources/convex_polygon_shape.cpp b/scene/resources/convex_polygon_shape.cpp index bba52bd5ff..31c4ea55e9 100644 --- a/scene/resources/convex_polygon_shape.cpp +++ b/scene/resources/convex_polygon_shape.cpp @@ -81,8 +81,8 @@ void ConvexPolygonShape::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "points"), "set_points", "get_points"); } -ConvexPolygonShape::ConvexPolygonShape() - : Shape(PhysicsServer::get_singleton()->shape_create(PhysicsServer::SHAPE_CONVEX_POLYGON)) { +ConvexPolygonShape::ConvexPolygonShape() : + Shape(PhysicsServer::get_singleton()->shape_create(PhysicsServer::SHAPE_CONVEX_POLYGON)) { //set_points(Vector3(1,1,1)); } diff --git a/scene/resources/convex_polygon_shape_2d.cpp b/scene/resources/convex_polygon_shape_2d.cpp index a76b6a7cf4..9c25b6b467 100644 --- a/scene/resources/convex_polygon_shape_2d.cpp +++ b/scene/resources/convex_polygon_shape_2d.cpp @@ -86,8 +86,8 @@ Rect2 ConvexPolygonShape2D::get_rect() const { return rect; } -ConvexPolygonShape2D::ConvexPolygonShape2D() - : Shape2D(Physics2DServer::get_singleton()->convex_polygon_shape_create()) { +ConvexPolygonShape2D::ConvexPolygonShape2D() : + Shape2D(Physics2DServer::get_singleton()->convex_polygon_shape_create()) { int pcount = 3; for (int i = 0; i < pcount; i++) diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index a6f301af1e..c8ab7c2a04 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -2066,8 +2066,8 @@ void SpatialMaterial::_bind_methods() { BIND_ENUM_CONSTANT(EMISSION_OP_MULTIPLY); } -SpatialMaterial::SpatialMaterial() - : element(this) { +SpatialMaterial::SpatialMaterial() : + element(this) { //initialize to right values set_albedo(Color(1.0, 1.0, 1.0, 1.0)); diff --git a/scene/resources/plane_shape.cpp b/scene/resources/plane_shape.cpp index 2b1e890a5d..2eb2ceff24 100644 --- a/scene/resources/plane_shape.cpp +++ b/scene/resources/plane_shape.cpp @@ -86,8 +86,8 @@ void PlaneShape::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::PLANE, "plane"), "set_plane", "get_plane"); } -PlaneShape::PlaneShape() - : Shape(PhysicsServer::get_singleton()->shape_create(PhysicsServer::SHAPE_PLANE)) { +PlaneShape::PlaneShape() : + Shape(PhysicsServer::get_singleton()->shape_create(PhysicsServer::SHAPE_PLANE)) { set_plane(Plane(0, 1, 0, 0)); } diff --git a/scene/resources/ray_shape.cpp b/scene/resources/ray_shape.cpp index ccce7660c6..b03a81b6bd 100644 --- a/scene/resources/ray_shape.cpp +++ b/scene/resources/ray_shape.cpp @@ -66,8 +66,8 @@ void RayShape::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::REAL, "length", PROPERTY_HINT_RANGE, "0,4096,0.01"), "set_length", "get_length"); } -RayShape::RayShape() - : Shape(PhysicsServer::get_singleton()->shape_create(PhysicsServer::SHAPE_RAY)) { +RayShape::RayShape() : + Shape(PhysicsServer::get_singleton()->shape_create(PhysicsServer::SHAPE_RAY)) { set_length(1.0); } diff --git a/scene/resources/rectangle_shape_2d.cpp b/scene/resources/rectangle_shape_2d.cpp index 69dbb76744..202024aa96 100644 --- a/scene/resources/rectangle_shape_2d.cpp +++ b/scene/resources/rectangle_shape_2d.cpp @@ -66,8 +66,8 @@ void RectangleShape2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "extents"), "set_extents", "get_extents"); } -RectangleShape2D::RectangleShape2D() - : Shape2D(Physics2DServer::get_singleton()->rectangle_shape_create()) { +RectangleShape2D::RectangleShape2D() : + Shape2D(Physics2DServer::get_singleton()->rectangle_shape_create()) { extents = Vector2(10, 10); _update_shape(); diff --git a/scene/resources/segment_shape_2d.cpp b/scene/resources/segment_shape_2d.cpp index 7c7ec0d112..e8ef448e23 100644 --- a/scene/resources/segment_shape_2d.cpp +++ b/scene/resources/segment_shape_2d.cpp @@ -86,8 +86,8 @@ void SegmentShape2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "b"), "set_b", "get_b"); } -SegmentShape2D::SegmentShape2D() - : Shape2D(Physics2DServer::get_singleton()->segment_shape_create()) { +SegmentShape2D::SegmentShape2D() : + Shape2D(Physics2DServer::get_singleton()->segment_shape_create()) { a = Vector2(); b = Vector2(0, 10); @@ -145,8 +145,8 @@ real_t RayShape2D::get_length() const { return length; } -RayShape2D::RayShape2D() - : Shape2D(Physics2DServer::get_singleton()->ray_shape_create()) { +RayShape2D::RayShape2D() : + Shape2D(Physics2DServer::get_singleton()->ray_shape_create()) { length = 20; _update_shape(); diff --git a/scene/resources/shape_line_2d.cpp b/scene/resources/shape_line_2d.cpp index d046ce876c..512ff3bc56 100644 --- a/scene/resources/shape_line_2d.cpp +++ b/scene/resources/shape_line_2d.cpp @@ -95,8 +95,8 @@ void LineShape2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::REAL, "d"), "set_d", "get_d"); } -LineShape2D::LineShape2D() - : Shape2D(Physics2DServer::get_singleton()->line_shape_create()) { +LineShape2D::LineShape2D() : + Shape2D(Physics2DServer::get_singleton()->line_shape_create()) { normal = Vector2(0, -1); d = 0; diff --git a/scene/resources/sphere_shape.cpp b/scene/resources/sphere_shape.cpp index 00203c2b4b..042988dcd3 100644 --- a/scene/resources/sphere_shape.cpp +++ b/scene/resources/sphere_shape.cpp @@ -80,8 +80,8 @@ void SphereShape::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::REAL, "radius", PROPERTY_HINT_RANGE, "0,4096,0.01"), "set_radius", "get_radius"); } -SphereShape::SphereShape() - : Shape(PhysicsServer::get_singleton()->shape_create(PhysicsServer::SHAPE_SPHERE)) { +SphereShape::SphereShape() : + Shape(PhysicsServer::get_singleton()->shape_create(PhysicsServer::SHAPE_SPHERE)) { set_radius(1.0); } diff --git a/scene/resources/tile_set.h b/scene/resources/tile_set.h index 18b62c778d..4d2b02f54b 100644 --- a/scene/resources/tile_set.h +++ b/scene/resources/tile_set.h @@ -81,8 +81,9 @@ public: Map<Vector2, int> priority_map; // Default size to prevent invalid value - explicit AutotileData() - : size(64, 64), icon_coord(0, 0) { + explicit AutotileData() : + size(64, 64), + icon_coord(0, 0) { bitmask_mode = BITMASK_2X2; } }; @@ -106,8 +107,9 @@ private: AutotileData autotile_data; // Default modulate for back-compat - explicit TileData() - : modulate(1, 1, 1), is_autotile(false) {} + explicit TileData() : + modulate(1, 1, 1), + is_autotile(false) {} }; Map<int, TileData> tile_map; diff --git a/servers/audio/effects/audio_effect_eq.h b/servers/audio/effects/audio_effect_eq.h index 440f46c0c2..5d0c3d9729 100644 --- a/servers/audio/effects/audio_effect_eq.h +++ b/servers/audio/effects/audio_effect_eq.h @@ -76,22 +76,22 @@ public: class AudioEffectEQ6 : public AudioEffectEQ { GDCLASS(AudioEffectEQ6, AudioEffectEQ) public: - AudioEffectEQ6() - : AudioEffectEQ(EQ::PRESET_6_BANDS) {} + AudioEffectEQ6() : + AudioEffectEQ(EQ::PRESET_6_BANDS) {} }; class AudioEffectEQ10 : public AudioEffectEQ { GDCLASS(AudioEffectEQ10, AudioEffectEQ) public: - AudioEffectEQ10() - : AudioEffectEQ(EQ::PRESET_10_BANDS) {} + AudioEffectEQ10() : + AudioEffectEQ(EQ::PRESET_10_BANDS) {} }; class AudioEffectEQ21 : public AudioEffectEQ { GDCLASS(AudioEffectEQ21, AudioEffectEQ) public: - AudioEffectEQ21() - : AudioEffectEQ(EQ::PRESET_21_BANDS) {} + AudioEffectEQ21() : + AudioEffectEQ(EQ::PRESET_21_BANDS) {} }; #endif // AUDIOEFFECTEQ_H diff --git a/servers/audio/effects/audio_effect_filter.h b/servers/audio/effects/audio_effect_filter.h index 903977cb97..7fb5ba4c83 100644 --- a/servers/audio/effects/audio_effect_filter.h +++ b/servers/audio/effects/audio_effect_filter.h @@ -96,50 +96,50 @@ VARIANT_ENUM_CAST(AudioEffectFilter::FilterDB) class AudioEffectLowPassFilter : public AudioEffectFilter { GDCLASS(AudioEffectLowPassFilter, AudioEffectFilter) public: - AudioEffectLowPassFilter() - : AudioEffectFilter(AudioFilterSW::LOWPASS) {} + AudioEffectLowPassFilter() : + AudioEffectFilter(AudioFilterSW::LOWPASS) {} }; class AudioEffectHighPassFilter : public AudioEffectFilter { GDCLASS(AudioEffectHighPassFilter, AudioEffectFilter) public: - AudioEffectHighPassFilter() - : AudioEffectFilter(AudioFilterSW::HIGHPASS) {} + AudioEffectHighPassFilter() : + AudioEffectFilter(AudioFilterSW::HIGHPASS) {} }; class AudioEffectBandPassFilter : public AudioEffectFilter { GDCLASS(AudioEffectBandPassFilter, AudioEffectFilter) public: - AudioEffectBandPassFilter() - : AudioEffectFilter(AudioFilterSW::BANDPASS) {} + AudioEffectBandPassFilter() : + AudioEffectFilter(AudioFilterSW::BANDPASS) {} }; class AudioEffectNotchFilter : public AudioEffectFilter { GDCLASS(AudioEffectNotchFilter, AudioEffectFilter) public: - AudioEffectNotchFilter() - : AudioEffectFilter(AudioFilterSW::NOTCH) {} + AudioEffectNotchFilter() : + AudioEffectFilter(AudioFilterSW::NOTCH) {} }; class AudioEffectBandLimitFilter : public AudioEffectFilter { GDCLASS(AudioEffectBandLimitFilter, AudioEffectFilter) public: - AudioEffectBandLimitFilter() - : AudioEffectFilter(AudioFilterSW::BANDLIMIT) {} + AudioEffectBandLimitFilter() : + AudioEffectFilter(AudioFilterSW::BANDLIMIT) {} }; class AudioEffectLowShelfFilter : public AudioEffectFilter { GDCLASS(AudioEffectLowShelfFilter, AudioEffectFilter) public: - AudioEffectLowShelfFilter() - : AudioEffectFilter(AudioFilterSW::LOWSHELF) {} + AudioEffectLowShelfFilter() : + AudioEffectFilter(AudioFilterSW::LOWSHELF) {} }; class AudioEffectHighShelfFilter : public AudioEffectFilter { GDCLASS(AudioEffectHighShelfFilter, AudioEffectFilter) public: - AudioEffectHighShelfFilter() - : AudioEffectFilter(AudioFilterSW::HIGHSHELF) {} + AudioEffectHighShelfFilter() : + AudioEffectFilter(AudioFilterSW::HIGHSHELF) {} }; #endif // AUDIOEFFECTFILTER_H diff --git a/servers/audio/reverb_sw.cpp b/servers/audio/reverb_sw.cpp index 96d2ad848b..e2bb04c213 100644 --- a/servers/audio/reverb_sw.cpp +++ b/servers/audio/reverb_sw.cpp @@ -252,15 +252,13 @@ static ReverbParamsSW *reverb_param_modes[] = { bool ReverbSW::process(int *p_input, int *p_output, int p_frames, int p_stereo_stride) { + // p_input must point to a non-looping buffer. + // BOTH p_input and p_output must be touched (use ClearModuleBuffer). + if (!reverb_buffer) return false; -// -// p_input must point to a non-looping buffer. -// BOTH p_input and p_output must be touched (use ClearModuleBuffer). - // LOCAL MACROS - #undef LM_SETSRCOFFSET #define LM_SETSRCOFFSET(x) \ (x) = current_params->x + Offset; \ diff --git a/servers/physics/area_sw.cpp b/servers/physics/area_sw.cpp index 387230a478..9615708f1d 100644 --- a/servers/physics/area_sw.cpp +++ b/servers/physics/area_sw.cpp @@ -237,8 +237,10 @@ void AreaSW::call_queries() { //get_space()->area_remove_from_monitor_query_list(&monitor_query_list); } -AreaSW::AreaSW() - : CollisionObjectSW(TYPE_AREA), monitor_query_list(this), moved_list(this) { +AreaSW::AreaSW() : + CollisionObjectSW(TYPE_AREA), + monitor_query_list(this), + moved_list(this) { _set_static(true); //areas are never active space_override_mode = PhysicsServer::AREA_SPACE_OVERRIDE_DISABLED; diff --git a/servers/physics/body_pair_sw.cpp b/servers/physics/body_pair_sw.cpp index ef54eb58cf..80e0ad1b07 100644 --- a/servers/physics/body_pair_sw.cpp +++ b/servers/physics/body_pair_sw.cpp @@ -464,8 +464,8 @@ void BodyPairSW::solve(real_t p_step) { } } -BodyPairSW::BodyPairSW(BodySW *p_A, int p_shape_A, BodySW *p_B, int p_shape_B) - : ConstraintSW(_arr, 2) { +BodyPairSW::BodyPairSW(BodySW *p_A, int p_shape_A, BodySW *p_B, int p_shape_B) : + ConstraintSW(_arr, 2) { A = p_A; B = p_B; diff --git a/servers/physics/body_sw.cpp b/servers/physics/body_sw.cpp index f8cd6ca858..5057c6ab9d 100644 --- a/servers/physics/body_sw.cpp +++ b/servers/physics/body_sw.cpp @@ -740,8 +740,11 @@ void BodySW::set_kinematic_margin(real_t p_margin) { kinematic_safe_margin = p_margin; } -BodySW::BodySW() - : CollisionObjectSW(TYPE_BODY), active_list(this), inertia_update_list(this), direct_state_query_list(this) { +BodySW::BodySW() : + CollisionObjectSW(TYPE_BODY), + active_list(this), + inertia_update_list(this), + direct_state_query_list(this) { mode = PhysicsServer::BODY_MODE_RIGID; active = true; diff --git a/servers/physics/collision_object_sw.cpp b/servers/physics/collision_object_sw.cpp index 126f8141ff..ef7cd0780f 100644 --- a/servers/physics/collision_object_sw.cpp +++ b/servers/physics/collision_object_sw.cpp @@ -217,8 +217,8 @@ void CollisionObjectSW::_shape_changed() { _shapes_changed(); } -CollisionObjectSW::CollisionObjectSW(Type p_type) - : pending_shape_update_list(this) { +CollisionObjectSW::CollisionObjectSW(Type p_type) : + pending_shape_update_list(this) { _static = true; type = p_type; diff --git a/servers/physics/collision_solver_sat.cpp b/servers/physics/collision_solver_sat.cpp index a044df7f31..f56d311a59 100644 --- a/servers/physics/collision_solver_sat.cpp +++ b/servers/physics/collision_solver_sat.cpp @@ -255,7 +255,8 @@ static void _generate_contacts_from_supports(const Vector3 *p_points_A, int p_po _generate_contacts_face_face, }, { - 0, 0, + 0, + 0, _generate_contacts_face_face, } }; diff --git a/servers/physics/joints/cone_twist_joint_sw.cpp b/servers/physics/joints/cone_twist_joint_sw.cpp index 3c900d4fbe..617ce125b3 100644 --- a/servers/physics/joints/cone_twist_joint_sw.cpp +++ b/servers/physics/joints/cone_twist_joint_sw.cpp @@ -85,8 +85,8 @@ static _FORCE_INLINE_ real_t atan2fast(real_t y, real_t x) { return (y < 0.0f) ? -angle : angle; } -ConeTwistJointSW::ConeTwistJointSW(BodySW *rbA, BodySW *rbB, const Transform &rbAFrame, const Transform &rbBFrame) - : JointSW(_arr, 2) { +ConeTwistJointSW::ConeTwistJointSW(BodySW *rbA, BodySW *rbB, const Transform &rbAFrame, const Transform &rbBFrame) : + JointSW(_arr, 2) { A = rbA; B = rbB; diff --git a/servers/physics/joints/generic_6dof_joint_sw.cpp b/servers/physics/joints/generic_6dof_joint_sw.cpp index 1e323be36c..b8234be4d9 100644 --- a/servers/physics/joints/generic_6dof_joint_sw.cpp +++ b/servers/physics/joints/generic_6dof_joint_sw.cpp @@ -209,9 +209,11 @@ real_t G6DOFTranslationalLimitMotorSW::solveLinearAxis( //////////////////////////// G6DOFTranslationalLimitMotorSW //////////////////////////////////// -Generic6DOFJointSW::Generic6DOFJointSW(BodySW *rbA, BodySW *rbB, const Transform &frameInA, const Transform &frameInB, bool useLinearReferenceFrameA) - : JointSW(_arr, 2), m_frameInA(frameInA), m_frameInB(frameInB), - m_useLinearReferenceFrameA(useLinearReferenceFrameA) { +Generic6DOFJointSW::Generic6DOFJointSW(BodySW *rbA, BodySW *rbB, const Transform &frameInA, const Transform &frameInB, bool useLinearReferenceFrameA) : + JointSW(_arr, 2), + m_frameInA(frameInA), + m_frameInB(frameInB), + m_useLinearReferenceFrameA(useLinearReferenceFrameA) { A = rbA; B = rbB; A->add_constraint(this, 0); diff --git a/servers/physics/joints/hinge_joint_sw.cpp b/servers/physics/joints/hinge_joint_sw.cpp index fe20a55b60..2edccc26c2 100644 --- a/servers/physics/joints/hinge_joint_sw.cpp +++ b/servers/physics/joints/hinge_joint_sw.cpp @@ -68,8 +68,8 @@ static void plane_space(const Vector3 &n, Vector3 &p, Vector3 &q) { } } -HingeJointSW::HingeJointSW(BodySW *rbA, BodySW *rbB, const Transform &frameA, const Transform &frameB) - : JointSW(_arr, 2) { +HingeJointSW::HingeJointSW(BodySW *rbA, BodySW *rbB, const Transform &frameA, const Transform &frameB) : + JointSW(_arr, 2) { A = rbA; B = rbB; @@ -101,8 +101,8 @@ HingeJointSW::HingeJointSW(BodySW *rbA, BodySW *rbB, const Transform &frameA, co } HingeJointSW::HingeJointSW(BodySW *rbA, BodySW *rbB, const Vector3 &pivotInA, const Vector3 &pivotInB, - const Vector3 &axisInA, const Vector3 &axisInB) - : JointSW(_arr, 2) { + const Vector3 &axisInA, const Vector3 &axisInB) : + JointSW(_arr, 2) { A = rbA; B = rbB; diff --git a/servers/physics/joints/jacobian_entry_sw.h b/servers/physics/joints/jacobian_entry_sw.h index 79ce0e6157..7aeb06ddd8 100644 --- a/servers/physics/joints/jacobian_entry_sw.h +++ b/servers/physics/joints/jacobian_entry_sw.h @@ -64,8 +64,8 @@ public: const Vector3 &inertiaInvA, const real_t massInvA, const Vector3 &inertiaInvB, - const real_t massInvB) - : m_linearJointAxis(jointAxis) { + const real_t massInvB) : + m_linearJointAxis(jointAxis) { m_aJ = world2A.xform(rel_pos1.cross(m_linearJointAxis)); m_bJ = world2B.xform(rel_pos2.cross(-m_linearJointAxis)); m_0MinvJt = inertiaInvA * m_aJ; @@ -80,8 +80,8 @@ public: const Basis &world2A, const Basis &world2B, const Vector3 &inertiaInvA, - const Vector3 &inertiaInvB) - : m_linearJointAxis(Vector3(real_t(0.), real_t(0.), real_t(0.))) { + const Vector3 &inertiaInvB) : + m_linearJointAxis(Vector3(real_t(0.), real_t(0.), real_t(0.))) { m_aJ = world2A.xform(jointAxis); m_bJ = world2B.xform(-jointAxis); m_0MinvJt = inertiaInvA * m_aJ; @@ -95,8 +95,10 @@ public: JacobianEntrySW(const Vector3 &axisInA, const Vector3 &axisInB, const Vector3 &inertiaInvA, - const Vector3 &inertiaInvB) - : m_linearJointAxis(Vector3(real_t(0.), real_t(0.), real_t(0.))), m_aJ(axisInA), m_bJ(-axisInB) { + const Vector3 &inertiaInvB) : + m_linearJointAxis(Vector3(real_t(0.), real_t(0.), real_t(0.))), + m_aJ(axisInA), + m_bJ(-axisInB) { m_0MinvJt = inertiaInvA * m_aJ; m_1MinvJt = inertiaInvB * m_bJ; m_Adiag = m_0MinvJt.dot(m_aJ) + m_1MinvJt.dot(m_bJ); @@ -110,8 +112,8 @@ public: const Vector3 &rel_pos1, const Vector3 &rel_pos2, const Vector3 &jointAxis, const Vector3 &inertiaInvA, - const real_t massInvA) - : m_linearJointAxis(jointAxis) { + const real_t massInvA) : + m_linearJointAxis(jointAxis) { m_aJ = world2A.xform(rel_pos1.cross(jointAxis)); m_bJ = world2A.xform(rel_pos2.cross(-jointAxis)); m_0MinvJt = inertiaInvA * m_aJ; diff --git a/servers/physics/joints/pin_joint_sw.cpp b/servers/physics/joints/pin_joint_sw.cpp index 779e086858..ab2ab2299a 100644 --- a/servers/physics/joints/pin_joint_sw.cpp +++ b/servers/physics/joints/pin_joint_sw.cpp @@ -146,8 +146,8 @@ real_t PinJointSW::get_param(PhysicsServer::PinJointParam p_param) const { return 0; } -PinJointSW::PinJointSW(BodySW *p_body_a, const Vector3 &p_pos_a, BodySW *p_body_b, const Vector3 &p_pos_b) - : JointSW(_arr, 2) { +PinJointSW::PinJointSW(BodySW *p_body_a, const Vector3 &p_pos_a, BodySW *p_body_b, const Vector3 &p_pos_b) : + JointSW(_arr, 2) { A = p_body_a; B = p_body_b; diff --git a/servers/physics/joints/slider_joint_sw.cpp b/servers/physics/joints/slider_joint_sw.cpp index 66585f2605..7777de0324 100644 --- a/servers/physics/joints/slider_joint_sw.cpp +++ b/servers/physics/joints/slider_joint_sw.cpp @@ -112,8 +112,10 @@ void SliderJointSW::initParams() { //----------------------------------------------------------------------------- -SliderJointSW::SliderJointSW(BodySW *rbA, BodySW *rbB, const Transform &frameInA, const Transform &frameInB) - : JointSW(_arr, 2), m_frameInA(frameInA), m_frameInB(frameInB) { +SliderJointSW::SliderJointSW(BodySW *rbA, BodySW *rbB, const Transform &frameInA, const Transform &frameInB) : + JointSW(_arr, 2), + m_frameInA(frameInA), + m_frameInB(frameInB) { A = rbA; B = rbB; diff --git a/servers/physics/joints_sw.h b/servers/physics/joints_sw.h index b15ae08049..29581c7337 100644 --- a/servers/physics/joints_sw.h +++ b/servers/physics/joints_sw.h @@ -37,8 +37,8 @@ class JointSW : public ConstraintSW { public: virtual PhysicsServer::JointType get_type() const = 0; - _FORCE_INLINE_ JointSW(BodySW **p_body_ptr = NULL, int p_body_count = 0) - : ConstraintSW(p_body_ptr, p_body_count) { + _FORCE_INLINE_ JointSW(BodySW **p_body_ptr = NULL, int p_body_count = 0) : + ConstraintSW(p_body_ptr, p_body_count) { } }; diff --git a/servers/physics_2d/area_2d_sw.cpp b/servers/physics_2d/area_2d_sw.cpp index 6c0bc2c186..d73619ba13 100644 --- a/servers/physics_2d/area_2d_sw.cpp +++ b/servers/physics_2d/area_2d_sw.cpp @@ -238,8 +238,10 @@ void Area2DSW::call_queries() { //get_space()->area_remove_from_monitor_query_list(&monitor_query_list); } -Area2DSW::Area2DSW() - : CollisionObject2DSW(TYPE_AREA), monitor_query_list(this), moved_list(this) { +Area2DSW::Area2DSW() : + CollisionObject2DSW(TYPE_AREA), + monitor_query_list(this), + moved_list(this) { _set_static(true); //areas are not active by default space_override_mode = Physics2DServer::AREA_SPACE_OVERRIDE_DISABLED; diff --git a/servers/physics_2d/body_2d_sw.cpp b/servers/physics_2d/body_2d_sw.cpp index eb5fb5a729..2bdde244df 100644 --- a/servers/physics_2d/body_2d_sw.cpp +++ b/servers/physics_2d/body_2d_sw.cpp @@ -650,8 +650,11 @@ void Body2DSW::set_force_integration_callback(ObjectID p_id, const StringName &p } } -Body2DSW::Body2DSW() - : CollisionObject2DSW(TYPE_BODY), active_list(this), inertia_update_list(this), direct_state_query_list(this) { +Body2DSW::Body2DSW() : + CollisionObject2DSW(TYPE_BODY), + active_list(this), + inertia_update_list(this), + direct_state_query_list(this) { mode = Physics2DServer::BODY_MODE_RIGID; active = true; diff --git a/servers/physics_2d/body_pair_2d_sw.cpp b/servers/physics_2d/body_pair_2d_sw.cpp index 828b90e5d0..b106b37db0 100644 --- a/servers/physics_2d/body_pair_2d_sw.cpp +++ b/servers/physics_2d/body_pair_2d_sw.cpp @@ -417,7 +417,7 @@ bool BodyPair2DSW::setup(real_t p_step) { c.bias = -bias * inv_dt * MIN(0.0f, -depth + max_penetration); c.depth = depth; -//c.acc_bias_impulse=0; + //c.acc_bias_impulse=0; #ifdef ACCUMULATE_IMPULSES { @@ -500,8 +500,8 @@ void BodyPair2DSW::solve(real_t p_step) { } } -BodyPair2DSW::BodyPair2DSW(Body2DSW *p_A, int p_shape_A, Body2DSW *p_B, int p_shape_B) - : Constraint2DSW(_arr, 2) { +BodyPair2DSW::BodyPair2DSW(Body2DSW *p_A, int p_shape_A, Body2DSW *p_B, int p_shape_B) : + Constraint2DSW(_arr, 2) { A = p_A; B = p_B; diff --git a/servers/physics_2d/joints_2d_sw.cpp b/servers/physics_2d/joints_2d_sw.cpp index 897e145a3e..caeb62d74f 100644 --- a/servers/physics_2d/joints_2d_sw.cpp +++ b/servers/physics_2d/joints_2d_sw.cpp @@ -178,8 +178,8 @@ real_t PinJoint2DSW::get_param(Physics2DServer::PinJointParam p_param) const { ERR_FAIL_V(0); } -PinJoint2DSW::PinJoint2DSW(const Vector2 &p_pos, Body2DSW *p_body_a, Body2DSW *p_body_b) - : Joint2DSW(_arr, p_body_b ? 2 : 1) { +PinJoint2DSW::PinJoint2DSW(const Vector2 &p_pos, Body2DSW *p_body_a, Body2DSW *p_body_b) : + Joint2DSW(_arr, p_body_b ? 2 : 1) { A = p_body_a; B = p_body_b; @@ -323,8 +323,8 @@ void GrooveJoint2DSW::solve(real_t p_step) { B->apply_impulse(rB, j); } -GrooveJoint2DSW::GrooveJoint2DSW(const Vector2 &p_a_groove1, const Vector2 &p_a_groove2, const Vector2 &p_b_anchor, Body2DSW *p_body_a, Body2DSW *p_body_b) - : Joint2DSW(_arr, 2) { +GrooveJoint2DSW::GrooveJoint2DSW(const Vector2 &p_a_groove1, const Vector2 &p_a_groove2, const Vector2 &p_b_anchor, Body2DSW *p_body_a, Body2DSW *p_body_b) : + Joint2DSW(_arr, 2) { A = p_body_a; B = p_body_b; @@ -432,8 +432,8 @@ real_t DampedSpringJoint2DSW::get_param(Physics2DServer::DampedStringParam p_par ERR_FAIL_V(0); } -DampedSpringJoint2DSW::DampedSpringJoint2DSW(const Vector2 &p_anchor_a, const Vector2 &p_anchor_b, Body2DSW *p_body_a, Body2DSW *p_body_b) - : Joint2DSW(_arr, 2) { +DampedSpringJoint2DSW::DampedSpringJoint2DSW(const Vector2 &p_anchor_a, const Vector2 &p_anchor_b, Body2DSW *p_body_a, Body2DSW *p_body_b) : + Joint2DSW(_arr, 2) { A = p_body_a; B = p_body_b; diff --git a/servers/physics_2d/joints_2d_sw.h b/servers/physics_2d/joints_2d_sw.h index 11cb41d9d1..0e5e8012b6 100644 --- a/servers/physics_2d/joints_2d_sw.h +++ b/servers/physics_2d/joints_2d_sw.h @@ -50,8 +50,8 @@ public: _FORCE_INLINE_ real_t get_max_bias() const { return max_bias; } virtual Physics2DServer::JointType get_type() const = 0; - Joint2DSW(Body2DSW **p_body_ptr = NULL, int p_body_count = 0) - : Constraint2DSW(p_body_ptr, p_body_count) { + Joint2DSW(Body2DSW **p_body_ptr = NULL, int p_body_count = 0) : + Constraint2DSW(p_body_ptr, p_body_count) { bias = 0; max_force = max_bias = 3.40282e+38; }; diff --git a/servers/physics_2d/physics_2d_server_wrap_mt.cpp b/servers/physics_2d/physics_2d_server_wrap_mt.cpp index f92ed18de2..0e5bd82599 100644 --- a/servers/physics_2d/physics_2d_server_wrap_mt.cpp +++ b/servers/physics_2d/physics_2d_server_wrap_mt.cpp @@ -151,8 +151,8 @@ void Physics2DServerWrapMT::finish() { memdelete(step_sem); } -Physics2DServerWrapMT::Physics2DServerWrapMT(Physics2DServer *p_contained, bool p_create_thread) - : command_queue(p_create_thread) { +Physics2DServerWrapMT::Physics2DServerWrapMT(Physics2DServer *p_contained, bool p_create_thread) : + command_queue(p_create_thread) { physics_2d_server = p_contained; create_thread = p_create_thread; diff --git a/servers/physics_2d_server.h b/servers/physics_2d_server.h index d6a988f512..c57503f06e 100644 --- a/servers/physics_2d_server.h +++ b/servers/physics_2d_server.h @@ -589,14 +589,17 @@ class Physics2DServerManager { String name; CreatePhysics2DServerCallback create_callback; - ClassInfo() - : name(""), create_callback(NULL) {} + ClassInfo() : + name(""), + create_callback(NULL) {} - ClassInfo(String p_name, CreatePhysics2DServerCallback p_create_callback) - : name(p_name), create_callback(p_create_callback) {} + ClassInfo(String p_name, CreatePhysics2DServerCallback p_create_callback) : + name(p_name), + create_callback(p_create_callback) {} - ClassInfo(const ClassInfo &p_ci) - : name(p_ci.name), create_callback(p_ci.create_callback) {} + ClassInfo(const ClassInfo &p_ci) : + name(p_ci.name), + create_callback(p_ci.create_callback) {} }; static Vector<ClassInfo> physics_2d_servers; diff --git a/servers/physics_server.h b/servers/physics_server.h index 9a4155dd8b..4886317224 100644 --- a/servers/physics_server.h +++ b/servers/physics_server.h @@ -652,14 +652,17 @@ class PhysicsServerManager { String name; CreatePhysicsServerCallback create_callback; - ClassInfo() - : name(""), create_callback(NULL) {} + ClassInfo() : + name(""), + create_callback(NULL) {} - ClassInfo(String p_name, CreatePhysicsServerCallback p_create_callback) - : name(p_name), create_callback(p_create_callback) {} + ClassInfo(String p_name, CreatePhysicsServerCallback p_create_callback) : + name(p_name), + create_callback(p_create_callback) {} - ClassInfo(const ClassInfo &p_ci) - : name(p_ci.name), create_callback(p_ci.create_callback) {} + ClassInfo(const ClassInfo &p_ci) : + name(p_ci.name), + create_callback(p_ci.create_callback) {} }; static Vector<ClassInfo> physics_servers; diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h index 4bb34af241..0ee70878dc 100644 --- a/servers/visual/rasterizer.h +++ b/servers/visual/rasterizer.h @@ -116,8 +116,8 @@ public: virtual void base_changed() = 0; virtual void base_material_changed() = 0; - InstanceBase() - : dependency_item(this) { + InstanceBase() : + dependency_item(this) { base_type = VS::INSTANCE_NONE; cast_shadows = VS::SHADOW_CASTING_SETTING_ON; diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h index 91542625e0..9223d81e32 100644 --- a/servers/visual/visual_server_raster.h +++ b/servers/visual/visual_server_raster.h @@ -77,8 +77,8 @@ class VisualServerRaster : public VisualServer { static void _changes_changed() {} public: -//if editor is redrawing when it shouldn't, enable this and put a breakpoint in _changes_changed() -//#define DEBUG_CHANGES + //if editor is redrawing when it shouldn't, enable this and put a breakpoint in _changes_changed() + //#define DEBUG_CHANGES #ifdef DEBUG_CHANGES _FORCE_INLINE_ static void redraw_request() { @@ -96,7 +96,6 @@ public: #define DISPLAY_CHANGED \ changes++; #endif -// print_line(String("CHANGED: ") + __FUNCTION__); #define BIND0R(m_r, m_name) \ m_r m_name() { return BINDBASE->m_name(); } @@ -451,7 +450,7 @@ public: BIND2R(int, viewport_get_render_info, RID, ViewportRenderInfo) BIND2(viewport_set_debug_draw, RID, ViewportDebugDraw) -/* ENVIRONMENT API */ + /* ENVIRONMENT API */ #undef BINDBASE //from now on, calls forwarded to this singleton @@ -481,7 +480,7 @@ public: BIND6(environment_set_fog_depth, RID, bool, float, float, bool, float) BIND5(environment_set_fog_height, RID, bool, float, float, float) -/* SCENARIO API */ + /* SCENARIO API */ #undef BINDBASE #define BINDBASE VSG::scene diff --git a/servers/visual/visual_server_scene.cpp b/servers/visual/visual_server_scene.cpp index 72fb1df94b..eef4720d22 100644 --- a/servers/visual/visual_server_scene.cpp +++ b/servers/visual/visual_server_scene.cpp @@ -1333,9 +1333,7 @@ void VisualServerScene::render_camera(RID p_camera, RID p_scenario, Size2 p_view p_viewport_size.width / (float)p_viewport_size.height, camera->znear, camera->zfar, - camera->vaspect - - ); + camera->vaspect); ortho = true; } break; case Camera::PERSPECTIVE: { @@ -1345,9 +1343,7 @@ void VisualServerScene::render_camera(RID p_camera, RID p_scenario, Size2 p_view p_viewport_size.width / (float)p_viewport_size.height, camera->znear, camera->zfar, - camera->vaspect - - ); + camera->vaspect); ortho = false; } break; @@ -2742,8 +2738,7 @@ void VisualServerScene::render_probes() { switch (probe->dynamic.updating_stage) { case GI_UPDATE_STAGE_CHECK: { - if (_check_gi_probe(instance_probe) || force_lighting) { -//send to lighting thread + if (_check_gi_probe(instance_probe) || force_lighting) { //send to lighting thread #ifndef NO_THREADS probe_bake_mutex->lock(); diff --git a/servers/visual/visual_server_scene.h b/servers/visual/visual_server_scene.h index bc5d266113..9e4701de65 100644 --- a/servers/visual/visual_server_scene.h +++ b/servers/visual/visual_server_scene.h @@ -229,8 +229,9 @@ public: singleton->_instance_queue_update(this, false, true); } - Instance() - : scenario_item(this), update_item(this) { + Instance() : + scenario_item(this), + update_item(this) { octree_id = 0; scenario = NULL; @@ -305,8 +306,8 @@ public: int render_step; - InstanceReflectionProbeData() - : update_list(this) { + InstanceReflectionProbeData() : + update_list(this) { reflection_dirty = true; render_step = -1; @@ -434,8 +435,8 @@ public: SelfList<InstanceGIProbeData> update_element; - InstanceGIProbeData() - : update_element(this) { + InstanceGIProbeData() : + update_element(this) { invalid = true; base_version = 0; dynamic.updating_stage = GI_UPDATE_STAGE_CHECK; diff --git a/servers/visual/visual_server_wrap_mt.cpp b/servers/visual/visual_server_wrap_mt.cpp index 03c68ab454..b86a0ae3f6 100644 --- a/servers/visual/visual_server_wrap_mt.cpp +++ b/servers/visual/visual_server_wrap_mt.cpp @@ -158,8 +158,8 @@ void VisualServerWrapMT::finish() { canvas_occluder_polygon_free_cached_ids(); } -VisualServerWrapMT::VisualServerWrapMT(VisualServer *p_contained, bool p_create_thread) - : command_queue(p_create_thread) { +VisualServerWrapMT::VisualServerWrapMT(VisualServer *p_contained, bool p_create_thread) : + command_queue(p_create_thread) { visual_server = p_contained; create_thread = p_create_thread; diff --git a/servers/visual/visual_server_wrap_mt.h b/servers/visual/visual_server_wrap_mt.h index 1c3b34d16f..b58b1d917e 100644 --- a/servers/visual/visual_server_wrap_mt.h +++ b/servers/visual/visual_server_wrap_mt.h @@ -62,7 +62,7 @@ class VisualServerWrapMT : public VisualServer { int pool_max_size; -//#define DEBUG_SYNC + //#define DEBUG_SYNC #ifdef DEBUG_SYNC #define SYNC_DEBUG print_line("sync on: " + String(__FUNCTION__)); |