From 6a4e7198c5ac4deca79e5f22f37a57f79834bc51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Mon, 11 Dec 2017 15:31:49 +0100 Subject: [PATCH] Style: apply clang-format (5.0.0) to current source --- core/io/marshalls.cpp | 4 +- core/math/a_star.h | 4 +- core/math/face3.cpp | 3 +- core/math/face3.h | 2 +- core/math/math_funcs.h | 2 +- core/math/plane.h | 5 +- core/safe_refcount.h | 10 +- core/typedefs.h | 6 +- core/variant.cpp | 5 +- core/variant_call.cpp | 1 - drivers/convex_decomp/b2d_decompose.cpp | 2 +- drivers/gles2/rasterizer_gles2.cpp | 12 +-- drivers/gles2/rasterizer_gles2.h | 12 +-- drivers/nrex/nrex.cpp | 91 +++++++++++++------ editor/animation_editor.h | 1 - editor/create_dialog.h | 3 +- editor/fileserver/editor_file_server.cpp | 1 - editor/filesystem_dock.h | 10 +- editor/io_plugins/editor_import_collada.cpp | 6 +- editor/plugins/baked_light_editor_plugin.cpp | 2 +- editor/plugins/canvas_item_editor_plugin.cpp | 4 +- .../collision_polygon_2d_editor_plugin.cpp | 2 +- .../collision_polygon_editor_plugin.cpp | 2 +- .../light_occluder_2d_editor_plugin.cpp | 2 +- .../navigation_polygon_editor_plugin.cpp | 2 +- editor/plugins/polygon_2d_editor_plugin.cpp | 2 +- editor/plugins/tile_map_editor_plugin.cpp | 2 +- editor/property_editor.cpp | 2 +- main/main.cpp | 1 - main/tests/test_containers.cpp | 2 +- main/tests/test_detailer.cpp | 2 +- main/tests/test_gdscript.cpp | 4 +- main/tests/test_gdscript.h | 2 +- main/tests/test_gui.cpp | 2 +- main/tests/test_image.cpp | 2 +- main/tests/test_io.cpp | 4 +- main/tests/test_math.cpp | 2 +- main/tests/test_misc.cpp | 2 +- main/tests/test_particles.cpp | 2 +- main/tests/test_physics.cpp | 2 +- main/tests/test_physics_2d.cpp | 2 +- main/tests/test_python.cpp | 2 +- main/tests/test_render.cpp | 2 +- main/tests/test_shader_lang.cpp | 2 +- main/tests/test_sound.cpp | 2 +- main/tests/test_string.cpp | 2 +- modules/chibi/event_stream_chibi.cpp | 4 +- modules/gdscript/gd_compiler.cpp | 2 +- modules/gdscript/gd_function.cpp | 6 +- modules/gdscript/gd_script.cpp | 4 +- modules/gdscript/gd_tokenizer.cpp | 2 +- modules/pvr/texture_loader_pvr.cpp | 6 +- modules/theora/video_stream_theora.cpp | 2 +- modules/vorbis/audio_stream_ogg_vorbis.cpp | 2 +- platform/android/godot_android.cpp | 2 +- platform/haiku/haiku_application.cpp | 4 +- platform/haiku/haiku_direct_window.cpp | 4 +- platform/haiku/haiku_gl_view.cpp | 4 +- platform/iphone/os_iphone.cpp | 2 +- platform/iphone/rasterizer_iphone.cpp | 12 ++- platform/iphone/rasterizer_iphone.h | 4 +- platform/javascript/dom_keys.h | 12 +-- platform/windows/crash_handler_win.cpp | 8 +- platform/winrt/app.cpp | 18 ++-- platform/winrt/audio_driver_winrt.h | 4 +- platform/winrt/export/export.cpp | 37 ++++++-- platform/winrt/gl_context_egl.cpp | 14 +-- platform/winrt/joystick_winrt.cpp | 6 +- platform/x11/context_gl_x11.cpp | 4 +- platform/x11/os_x11.cpp | 10 +- scene/2d/animated_sprite.cpp | 1 - scene/2d/area_2d.cpp | 4 +- scene/2d/canvas_item.cpp | 4 +- scene/2d/physics_body_2d.cpp | 16 ++-- scene/2d/sample_player_2d.cpp | 1 - scene/2d/tile_map.cpp | 2 +- scene/2d/tile_map.h | 8 +- scene/2d/visibility_notifier_2d.cpp | 1 - scene/3d/area.cpp | 4 +- scene/3d/light.cpp | 4 +- scene/3d/light.h | 8 +- scene/3d/physics_body.cpp | 16 ++-- scene/3d/spatial.cpp | 4 +- scene/3d/sprite_3d.cpp | 2 +- scene/3d/vehicle_body.cpp | 20 ++-- scene/3d/visibility_notifier.cpp | 1 - scene/animation/tween_interpolaters.cpp | 22 ++--- scene/gui/box_container.h | 8 +- scene/gui/button_array.h | 8 +- scene/gui/button_group.cpp | 4 +- scene/gui/check_box.cpp | 4 +- scene/gui/color_picker.cpp | 4 +- scene/gui/file_dialog.h | 1 - scene/gui/line_edit.cpp | 6 +- scene/gui/scroll_bar.h | 8 +- scene/gui/slider.h | 8 +- scene/gui/split_container.h | 8 +- scene/main/scene_main_loop.cpp | 2 + scene/main/scene_main_loop.h | 4 +- scene/register_scene_types.cpp | 4 +- scene/resources/box_shape.cpp | 4 +- scene/resources/capsule_shape.cpp | 4 +- scene/resources/capsule_shape_2d.cpp | 4 +- scene/resources/circle_shape_2d.cpp | 4 +- scene/resources/concave_polygon_shape.cpp | 4 +- scene/resources/concave_polygon_shape_2d.cpp | 4 +- scene/resources/convex_polygon_shape.cpp | 4 +- scene/resources/convex_polygon_shape_2d.cpp | 4 +- scene/resources/material.cpp | 8 +- scene/resources/plane_shape.cpp | 4 +- scene/resources/ray_shape.cpp | 4 +- scene/resources/rectangle_shape_2d.cpp | 4 +- scene/resources/segment_shape_2d.cpp | 8 +- scene/resources/shader.h | 8 +- scene/resources/shader_graph.cpp | 4 +- scene/resources/shader_graph.h | 8 +- scene/resources/shape_line_2d.cpp | 4 +- scene/resources/sphere_shape.cpp | 4 +- scene/resources/tile_set.h | 5 +- scene/resources/world_2d.cpp | 1 - servers/audio/audio_mixer_sw.cpp | 2 +- servers/audio/audio_server_sw.h | 4 +- servers/audio/reverb_sw.cpp | 8 +- servers/physics/area_sw.cpp | 6 +- servers/physics/body_pair_sw.cpp | 4 +- servers/physics/body_sw.cpp | 7 +- servers/physics/collision_solver_sat.cpp | 3 +- servers/physics/gjk_epa.cpp | 15 +-- .../physics/joints/cone_twist_joint_sw.cpp | 4 +- .../physics/joints/generic_6dof_joint_sw.cpp | 8 +- servers/physics/joints/hinge_joint_sw.cpp | 8 +- servers/physics/joints/jacobian_entry_sw.h | 18 ++-- servers/physics/joints/pin_joint_sw.cpp | 4 +- servers/physics/joints/slider_joint_sw.cpp | 6 +- servers/physics/joints_sw.h | 4 +- servers/physics_2d/area_2d_sw.cpp | 6 +- servers/physics_2d/body_2d_sw.cpp | 7 +- servers/physics_2d/body_pair_2d_sw.cpp | 6 +- servers/physics_2d/joints_2d_sw.cpp | 12 +-- servers/physics_2d/joints_2d_sw.h | 4 +- .../physics_2d/physics_2d_server_wrap_mt.cpp | 4 +- servers/visual/rasterizer.h | 4 +- servers/visual/shader_language.cpp | 10 +- servers/visual/visual_server_raster.cpp | 8 +- servers/visual/visual_server_raster.h | 4 +- servers/visual/visual_server_wrap_mt.cpp | 4 +- servers/visual/visual_server_wrap_mt.h | 1 - 147 files changed, 465 insertions(+), 399 deletions(-) diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp index e36ed0cd14b..7e0cc045bcf 100644 --- a/core/io/marshalls.cpp +++ b/core/io/marshalls.cpp @@ -102,8 +102,8 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int } } break; - // math types + // math types case Variant::VECTOR2: { ERR_FAIL_COND_V(len < (int)4 * 2, ERR_INVALID_DATA); @@ -880,8 +880,8 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len) { r_len++; //pad } break; - // math types + // math types case Variant::VECTOR2: { if (buf) { diff --git a/core/math/a_star.h b/core/math/a_star.h index 41092d533c0..7c3e1979e89 100644 --- a/core/math/a_star.h +++ b/core/math/a_star.h @@ -57,8 +57,8 @@ class AStar : public Reference { Point *prev_point; float distance; - Point() - : list(this) {} + Point() : + list(this) {} }; Map points; diff --git a/core/math/face3.cpp b/core/math/face3.cpp index b1ab682766b..1f92834faff 100644 --- a/core/math/face3.cpp +++ b/core/math/face3.cpp @@ -195,8 +195,7 @@ bool Face3::intersects_aabb(const AABB &p_aabb) const { if (!p_aabb.intersects_plane(get_plane())) return false; -/** TEST FACE AXIS */ - + /** TEST FACE AXIS */ #define TEST_AXIS(m_ax) \ { \ float aabb_min = p_aabb.pos.m_ax; \ diff --git a/core/math/face3.h b/core/math/face3.h index 50457676421..12be465d261 100644 --- a/core/math/face3.h +++ b/core/math/face3.h @@ -256,6 +256,6 @@ bool Face3::intersects_aabb2(const AABB &p_aabb) const { return true; } -//this sucks... + //this sucks... #endif // FACE3_H diff --git a/core/math/math_funcs.h b/core/math/math_funcs.h index c0f2863cce9..bc671f955a0 100644 --- a/core/math/math_funcs.h +++ b/core/math/math_funcs.h @@ -138,7 +138,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 a7f6411e630..186e6e79919 100644 --- a/core/math/plane.h +++ b/core/math/plane.h @@ -74,8 +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); diff --git a/core/safe_refcount.h b/core/safe_refcount.h index 47985384acc..7d36ea7de3b 100644 --- a/core/safe_refcount.h +++ b/core/safe_refcount.h @@ -114,7 +114,7 @@ static inline int atomic_conditional_increment(volatile int *pw) { "m"(*pw) : // input (%3) "cc" // clobbers - ); + ); return rv; } @@ -135,7 +135,7 @@ static inline int atomic_decrement(volatile int *pw) { return static_cast(rv); } -/* PowerPC32/64 GCC */ + /* PowerPC32/64 GCC */ #elif (defined(__GNUC__)) && (defined(__powerpc__) || defined(__ppc__)) @@ -188,7 +188,7 @@ inline int atomic_decrement(int *pw) { return rv; } -/* CW ARM */ + /* CW ARM */ #elif defined(__GNUC__) && (defined(__arm__)) @@ -234,7 +234,7 @@ inline int atomic_decrement(volatile int *v) { return t; } -/* CW PPC */ + /* CW PPC */ #elif (defined(__MWERKS__)) && defined(__POWERPC__) @@ -279,7 +279,7 @@ inline long atomic_decrement(register long *pw) { return a; } -/* Any Windows (MSVC) */ + /* Any Windows (MSVC) */ #elif defined(_MSC_VER) diff --git a/core/typedefs.h b/core/typedefs.h index f50ead7d4f2..890c5332505 100644 --- a/core/typedefs.h +++ b/core/typedefs.h @@ -77,7 +77,7 @@ T *_nullptr() { #define OFFSET_OF(st, m) \ ((size_t)((char *)&(_nullptr()->m) - (char *)0)) -/** + /** * Some platforms (devices) not define NULL */ @@ -85,7 +85,7 @@ T *_nullptr() { #define NULL 0 #endif -/** + /** * Windows defines a lot of badly stuff we'll never ever use. undefine it. */ @@ -107,7 +107,7 @@ T *_nullptr() { #include "int_types.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 bc698617b0f..2fc97e0ea52 100644 --- a/core/variant.cpp +++ b/core/variant.cpp @@ -66,7 +66,6 @@ String Variant::get_type_name(Variant::Type p_type) { } break; // math types - case VECTOR2: { return "Vector2"; @@ -733,7 +732,6 @@ bool Variant::is_zero() const { } break; // math types - case VECTOR2: { return *reinterpret_cast(_data._mem) == Vector2(); @@ -958,7 +956,6 @@ void Variant::reference(const Variant &p_variant) { } break; // math types - case VECTOR2: { memnew_placement(_data._mem, Vector2(*reinterpret_cast(p_variant._data._mem))); @@ -2608,8 +2605,8 @@ uint32_t Variant::hash() const { return reinterpret_cast(_data._mem)->hash(); } break; - // math types + // math types case VECTOR2: { uint32_t hash = hash_djb2_one_float(reinterpret_cast(_data._mem)->x); diff --git a/core/variant_call.cpp b/core/variant_call.cpp index 955396ad7f8..4a8c8ac2ea0 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -1031,7 +1031,6 @@ Variant Variant::construct(const Variant::Type p_type, const Variant **p_args, i return String(); // math types - case VECTOR2: return Vector2(); // 5 case RECT2: return Rect2(); diff --git a/drivers/convex_decomp/b2d_decompose.cpp b/drivers/convex_decomp/b2d_decompose.cpp index d10c6268eba..83e463ced43 100644 --- a/drivers/convex_decomp/b2d_decompose.cpp +++ b/drivers/convex_decomp/b2d_decompose.cpp @@ -153,7 +153,7 @@ static Vector > _b2d_decompose(const Vector &p_polygon) delete p; return res; // pdarray; //needs to be deleted after body is created } -} +} // namespace b2ConvexDecomp Vector > b2d_decompose(const Vector &p_polygon) { diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp index 7c187e37ac0..4ed5d199e19 100644 --- a/drivers/gles2/rasterizer_gles2.cpp +++ b/drivers/gles2/rasterizer_gles2.cpp @@ -4091,7 +4091,7 @@ void RasterizerGLES2::capture_viewport(Image *r_capture) { w = DVector::Write(); r_capture->create(viewport.width, viewport.height, 0, Image::FORMAT_RGBA, pixels); -//r_capture->flip_y(); + //r_capture->flip_y(); #endif } @@ -7686,7 +7686,7 @@ void RasterizerGLES2::_draw_gui_primitive(int p_points, const Vector2 *p_vertice static const GLenum prim[5] = { GL_POINTS, GL_POINTS, GL_LINES, GL_TRIANGLES, GL_TRIANGLE_FAN }; -//#define GLES_USE_PRIMITIVE_BUFFER + //#define GLES_USE_PRIMITIVE_BUFFER #ifndef GLES_NO_CLIENT_ARRAYS @@ -9805,10 +9805,10 @@ void RasterizerGLES2::_update_framebuffer() { glGenFramebuffers(1, &framebuffer.fbo); glBindFramebuffer(GL_FRAMEBUFFER, framebuffer.fbo); -//print_line("generating fbo, id: "+itos(framebuffer.fbo)); -//depth + //print_line("generating fbo, id: "+itos(framebuffer.fbo)); + //depth -// Create a render buffer + // Create a render buffer #if 0 glGenTextures(1, &framebuffer.depth); @@ -10341,7 +10341,7 @@ void RasterizerGLES2::init() { full_float_fb_supported = extensions.has("GL_EXT_color_buffer_float"); -//etc_supported=false; + //etc_supported=false; #endif diff --git a/drivers/gles2/rasterizer_gles2.h b/drivers/gles2/rasterizer_gles2.h index 800abfb8fb5..57404935c93 100644 --- a/drivers/gles2/rasterizer_gles2.h +++ b/drivers/gles2/rasterizer_gles2.h @@ -210,8 +210,8 @@ class RasterizerGLES2 : public Rasterizer { SelfList dirty_list; - Shader() - : dirty_list(this) { + Shader() : + dirty_list(this) { valid = false; custom_code_id = 0; @@ -480,8 +480,8 @@ class RasterizerGLES2 : public Rasterizer { SelfList dirty_list; - MultiMesh() - : dirty_list(this) { + MultiMesh() : + dirty_list(this) { tw = 1; th = 1; @@ -612,8 +612,8 @@ class RasterizerGLES2 : public Rasterizer { SelfList dirty_list; - Skeleton() - : dirty_list(this) { + Skeleton() : + dirty_list(this) { tex_id = 0; pixel_size = 1.0; } diff --git a/drivers/nrex/nrex.cpp b/drivers/nrex/nrex.cpp index b82deb9a774..ed85fc39fe1 100644 --- a/drivers/nrex/nrex.cpp +++ b/drivers/nrex/nrex.cpp @@ -63,12 +63,16 @@ private: unsigned int _size; public: - nrex_array() - : _data(NREX_NEW_ARRAY(T, 2)), _reserved(2), _size(0) { + nrex_array() : + _data(NREX_NEW_ARRAY(T, 2)), + _reserved(2), + _size(0) { } - nrex_array(unsigned int reserved) - : _data(NREX_NEW_ARRAY(T, reserved ? reserved : 1)), _reserved(reserved ? reserved : 1), _size(0) { + nrex_array(unsigned int reserved) : + _data(NREX_NEW_ARRAY(T, reserved ? reserved : 1)), + _reserved(reserved ? reserved : 1), + _size(0) { } ~nrex_array() { @@ -179,8 +183,11 @@ struct nrex_search { return str[pos]; } - nrex_search(const nrex_char *str, nrex_result *captures, int lookahead) - : str(str), captures(captures), end(0), lookahead_pos(lookahead) { + nrex_search(const nrex_char *str, nrex_result *captures, int lookahead) : + str(str), + captures(captures), + end(0), + lookahead_pos(lookahead) { } }; @@ -191,8 +198,12 @@ struct nrex_node { bool quantifiable; int length; - nrex_node(bool quantify = false) - : next(NULL), previous(NULL), parent(NULL), quantifiable(quantify), length(-1) { + nrex_node(bool quantify = false) : + next(NULL), + previous(NULL), + parent(NULL), + quantifiable(quantify), + length(-1) { } virtual ~nrex_node() { @@ -252,8 +263,12 @@ struct nrex_node_group : public nrex_node { nrex_array childset; nrex_node *back; - nrex_node_group(nrex_group_type type, int id = 0) - : nrex_node(true), type(type), id(id), negate(false), back(NULL) { + nrex_node_group(nrex_group_type type, int id = 0) : + nrex_node(true), + type(type), + id(id), + negate(false), + back(NULL) { if (type != nrex_group_bracket) { length = 0; } else { @@ -386,8 +401,9 @@ struct nrex_node_group : public nrex_node { struct nrex_node_char : public nrex_node { nrex_char ch; - nrex_node_char(nrex_char c) - : nrex_node(true), ch(c) { + nrex_node_char(nrex_char c) : + nrex_node(true), + ch(c) { length = 1; } @@ -403,8 +419,10 @@ struct nrex_node_range : public nrex_node { nrex_char start; nrex_char end; - nrex_node_range(nrex_char s, nrex_char e) - : nrex_node(true), start(s), end(e) { + nrex_node_range(nrex_char s, nrex_char e) : + nrex_node(true), + start(s), + end(e) { length = 1; } @@ -474,8 +492,9 @@ static nrex_class_type nrex_parse_class(const nrex_char **pos) { struct nrex_node_class : public nrex_node { nrex_class_type type; - nrex_node_class(nrex_class_type t) - : nrex_node(true), type(t) { + nrex_node_class(nrex_class_type t) : + nrex_node(true), + type(t) { length = 1; } @@ -614,8 +633,9 @@ static bool nrex_is_shorthand(nrex_char repr) { struct nrex_node_shorthand : public nrex_node { nrex_char repr; - nrex_node_shorthand(nrex_char c) - : nrex_node(true), repr(c) { + nrex_node_shorthand(nrex_char c) : + nrex_node(true), + repr(c) { length = 1; } @@ -676,8 +696,12 @@ struct nrex_node_quantifier : public nrex_node { bool greedy; nrex_node *child; - nrex_node_quantifier(int min, int max) - : nrex_node(), min(min), max(max), greedy(true), child(NULL) { + nrex_node_quantifier(int min, int max) : + nrex_node(), + min(min), + max(max), + greedy(true), + child(NULL) { } virtual ~nrex_node_quantifier() { @@ -747,8 +771,9 @@ struct nrex_node_quantifier : public nrex_node { struct nrex_node_anchor : public nrex_node { bool end; - nrex_node_anchor(bool end) - : nrex_node(), end(end) { + nrex_node_anchor(bool end) : + nrex_node(), + end(end) { length = 0; } @@ -765,8 +790,9 @@ struct nrex_node_anchor : public nrex_node { struct nrex_node_word_boundary : public nrex_node { bool inverse; - nrex_node_word_boundary(bool inverse) - : nrex_node(), inverse(inverse) { + nrex_node_word_boundary(bool inverse) : + nrex_node(), + inverse(inverse) { length = 0; } @@ -795,8 +821,9 @@ struct nrex_node_word_boundary : public nrex_node { struct nrex_node_backreference : public nrex_node { int ref; - nrex_node_backreference(int ref) - : nrex_node(true), ref(ref) { + nrex_node_backreference(int ref) : + nrex_node(true), + ref(ref) { length = -1; } @@ -823,12 +850,16 @@ bool nrex_has_lookbehind(nrex_array &stack) { return false; } -nrex::nrex() - : _capturing(0), _lookahead_depth(0), _root(NULL) { +nrex::nrex() : + _capturing(0), + _lookahead_depth(0), + _root(NULL) { } -nrex::nrex(const nrex_char *pattern, int captures) - : _capturing(0), _lookahead_depth(0), _root(NULL) { +nrex::nrex(const nrex_char *pattern, int captures) : + _capturing(0), + _lookahead_depth(0), + _root(NULL) { compile(pattern, captures); } diff --git a/editor/animation_editor.h b/editor/animation_editor.h index 72c03f9a7b1..abe943fd7ce 100644 --- a/editor/animation_editor.h +++ b/editor/animation_editor.h @@ -45,7 +45,6 @@ #include "scene/animation/animation_cache.h" #include "scene/resources/animation.h" #include "scene_tree_editor.h" -#include "scene_tree_editor.h" class AnimationKeyEdit; class AnimationCurveEdit; diff --git a/editor/create_dialog.h b/editor/create_dialog.h index e204a0d7f49..444965846dd 100644 --- a/editor/create_dialog.h +++ b/editor/create_dialog.h @@ -114,8 +114,7 @@ class CreateDialog : public ConfirmationDialog { void update_tree(); void _create(); void _cancel(); - void add_type(const String &p_type, HashMap &p_types, TreeItem - *p_root); + void add_type(const String &p_type, HashMap &p_types, TreeItem *p_root); String base; void _text_changed(String p_text); diff --git a/editor/fileserver/editor_file_server.cpp b/editor/fileserver/editor_file_server.cpp index 2e17425a642..c84cb284264 100644 --- a/editor/fileserver/editor_file_server.cpp +++ b/editor/fileserver/editor_file_server.cpp @@ -30,7 +30,6 @@ #include "editor_file_server.h" #include "../editor_settings.h" #include "io/marshalls.h" -#include "io/marshalls.h" //#define DEBUG_PRINT(m_p) print_line(m_p) #define DEBUG_TIME(m_what) printf("MS: %s - %lli\n", m_what, OS::get_singleton()->get_ticks_usec()); diff --git a/editor/filesystem_dock.h b/editor/filesystem_dock.h index 5f8c1331580..b6666fed5de 100644 --- a/editor/filesystem_dock.h +++ b/editor/filesystem_dock.h @@ -109,10 +109,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 to_move; diff --git a/editor/io_plugins/editor_import_collada.cpp b/editor/io_plugins/editor_import_collada.cpp index 9cdb99edc4f..28d6b871a97 100644 --- a/editor/io_plugins/editor_import_collada.cpp +++ b/editor/io_plugins/editor_import_collada.cpp @@ -2167,9 +2167,9 @@ void ColladaImport::create_animation(int p_clip, bool p_make_tracks_in_all_bones } } -/*********************************************************************************/ -/*************************************** SCENE ***********************************/ -/*********************************************************************************/ + /*********************************************************************************/ + /*************************************** SCENE ***********************************/ + /*********************************************************************************/ #define DEBUG_ANIMATION diff --git a/editor/plugins/baked_light_editor_plugin.cpp b/editor/plugins/baked_light_editor_plugin.cpp index 2f23c8363ba..c1358c2a6f7 100644 --- a/editor/plugins/baked_light_editor_plugin.cpp +++ b/editor/plugins/baked_light_editor_plugin.cpp @@ -127,7 +127,7 @@ void BakedLightEditor::_notification(int p_option) { baker->update_octree_images(octree_texture, light_texture); baker->update_octree_sampler(octree_sampler); -// print_line("sampler size: "+itos(octree_sampler.size()*4)); + //print_line("sampler size: "+itos(octree_sampler.size()*4)); #if 1 //debug diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 0c90d98e6fe..4925f9334e9 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -66,8 +66,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 6b1abb27f18..2e835a7d3d7 100644 --- a/editor/plugins/collision_polygon_2d_editor_plugin.cpp +++ b/editor/plugins/collision_polygon_2d_editor_plugin.cpp @@ -392,7 +392,7 @@ CollisionPolygon2DEditor::CollisionPolygon2DEditor(EditorNode *p_editor) { button_edit->set_toggle_mode(true); button_edit->set_tooltip("Edit existing polygon:\nLMB: Move Point.\nCtrl+LMB: Split Segment.\nRMB: Erase Point."); -//add_constant_override("separation",0); + //add_constant_override("separation",0); #if 0 options = memnew( MenuButton ); diff --git a/editor/plugins/collision_polygon_editor_plugin.cpp b/editor/plugins/collision_polygon_editor_plugin.cpp index ae98c8f9f2b..6dc666fe865 100644 --- a/editor/plugins/collision_polygon_editor_plugin.cpp +++ b/editor/plugins/collision_polygon_editor_plugin.cpp @@ -512,7 +512,7 @@ CollisionPolygonEditor::CollisionPolygonEditor(EditorNode *p_editor) { button_edit->connect("pressed", this, "_menu_option", varray(MODE_EDIT)); button_edit->set_toggle_mode(true); -//add_constant_override("separation",0); + //add_constant_override("separation",0); #if 0 options = memnew( MenuButton ); diff --git a/editor/plugins/light_occluder_2d_editor_plugin.cpp b/editor/plugins/light_occluder_2d_editor_plugin.cpp index 955428559e4..3f12f85505a 100644 --- a/editor/plugins/light_occluder_2d_editor_plugin.cpp +++ b/editor/plugins/light_occluder_2d_editor_plugin.cpp @@ -427,7 +427,7 @@ LightOccluder2DEditor::LightOccluder2DEditor(EditorNode *p_editor) { add_child(create_poly); create_poly->get_ok()->set_text(TTR("Create")); -//add_constant_override("separation",0); + //add_constant_override("separation",0); #if 0 options = memnew( MenuButton ); diff --git a/editor/plugins/navigation_polygon_editor_plugin.cpp b/editor/plugins/navigation_polygon_editor_plugin.cpp index 3f70956b6b4..7e824752acb 100644 --- a/editor/plugins/navigation_polygon_editor_plugin.cpp +++ b/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -470,7 +470,7 @@ NavigationPolygonEditor::NavigationPolygonEditor(EditorNode *p_editor) { add_child(create_nav); create_nav->get_ok()->set_text(TTR("Create")); -//add_constant_override("separation",0); + //add_constant_override("separation",0); #if 0 options = memnew( MenuButton ); diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp index f63503559aa..be95e31d249 100644 --- a/editor/plugins/polygon_2d_editor_plugin.cpp +++ b/editor/plugins/polygon_2d_editor_plugin.cpp @@ -775,7 +775,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) { add_child(button_uv); button_uv->connect("pressed", this, "_menu_option", varray(MODE_EDIT_UV)); -//add_constant_override("separation",0); + //add_constant_override("separation",0); #if 0 options = memnew( MenuButton ); diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp index 77af9028900..415113d6a01 100644 --- a/editor/plugins/tile_map_editor_plugin.cpp +++ b/editor/plugins/tile_map_editor_plugin.cpp @@ -211,7 +211,7 @@ struct _PaletteEntry { return name < p_rhs.name; } }; -} +} // namespace void TileMapEditor::_update_palette() { diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index e23c81d0709..faea6474732 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -3496,8 +3496,8 @@ void PropertyEditor::_item_edited() { _edit_set(name, item->get_text(1)); } } break; - // math types + // math types case Variant::VECTOR3: { } break; diff --git a/main/main.cpp b/main/main.cpp index f551f4c8d13..fb7aefe425d 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -117,7 +117,6 @@ static String unescape_cmdline(const String &p_str) { } //#define DEBUG_INIT - #ifdef DEBUG_INIT #define MAIN_PRINT(m_txt) print_line(m_txt) #else diff --git a/main/tests/test_containers.cpp b/main/tests/test_containers.cpp index 463831aa6cc..e9e3d034b1b 100644 --- a/main/tests/test_containers.cpp +++ b/main/tests/test_containers.cpp @@ -100,4 +100,4 @@ MainLoop *test() { return NULL; } -} +} // namespace TestContainers diff --git a/main/tests/test_detailer.cpp b/main/tests/test_detailer.cpp index 32a6257ec9e..86ee05eb365 100644 --- a/main/tests/test_detailer.cpp +++ b/main/tests/test_detailer.cpp @@ -198,4 +198,4 @@ MainLoop *test() { return memnew(TestMainLoop); } -} +} // namespace TestMultiMesh diff --git a/main/tests/test_gdscript.cpp b/main/tests/test_gdscript.cpp index 06000705a38..e5aad29bbc4 100644 --- a/main/tests/test_gdscript.cpp +++ b/main/tests/test_gdscript.cpp @@ -1044,7 +1044,7 @@ MainLoop *test(TestType p_test) { return NULL; } -} +} // namespace TestGDScript #else @@ -1054,6 +1054,6 @@ MainLoop *test(TestType p_test) { return NULL; } -} +} // namespace TestGDScript #endif diff --git a/main/tests/test_gdscript.h b/main/tests/test_gdscript.h index 2cab3bf3acb..cca7f43dc82 100644 --- a/main/tests/test_gdscript.h +++ b/main/tests/test_gdscript.h @@ -41,6 +41,6 @@ enum TestType { }; MainLoop *test(TestType p_type); -} +} // namespace TestGDScript #endif // TEST_GDSCRIPT_H diff --git a/main/tests/test_gui.cpp b/main/tests/test_gui.cpp index 0004cade798..59492cc7725 100644 --- a/main/tests/test_gui.cpp +++ b/main/tests/test_gui.cpp @@ -374,6 +374,6 @@ MainLoop *test() { return memnew(TestMainLoop); } -} +} // namespace TestGUI #endif diff --git a/main/tests/test_image.cpp b/main/tests/test_image.cpp index 7005df7d123..2e618218f7b 100644 --- a/main/tests/test_image.cpp +++ b/main/tests/test_image.cpp @@ -67,4 +67,4 @@ MainLoop *test() { return memnew(TestMainLoop); } -} +} // namespace TestImage diff --git a/main/tests/test_io.cpp b/main/tests/test_io.cpp index 2249a4ea71d..de7a61f518c 100644 --- a/main/tests/test_io.cpp +++ b/main/tests/test_io.cpp @@ -177,7 +177,7 @@ MainLoop *test() { return memnew(TestMainLoop); } -} +} // namespace TestIO #else @@ -187,5 +187,5 @@ MainLoop *test() { return NULL; } -} +} // namespace TestIO #endif diff --git a/main/tests/test_math.cpp b/main/tests/test_math.cpp index 1cad8af416a..4f849b26666 100644 --- a/main/tests/test_math.cpp +++ b/main/tests/test_math.cpp @@ -358,4 +358,4 @@ MainLoop *test() { #endif return NULL; } -} +} // namespace TestMath diff --git a/main/tests/test_misc.cpp b/main/tests/test_misc.cpp index 7d2216e093d..9dbe15ee104 100644 --- a/main/tests/test_misc.cpp +++ b/main/tests/test_misc.cpp @@ -447,4 +447,4 @@ MainLoop *test() { return memnew(TestMainLoop); } -} +} // namespace TestMisc diff --git a/main/tests/test_particles.cpp b/main/tests/test_particles.cpp index e98b2ede199..f55270a6c86 100644 --- a/main/tests/test_particles.cpp +++ b/main/tests/test_particles.cpp @@ -110,4 +110,4 @@ MainLoop *test() { return memnew(TestMainLoop); } -} +} // namespace TestParticles diff --git a/main/tests/test_physics.cpp b/main/tests/test_physics.cpp index c33afc28de7..b97ec15b6bf 100644 --- a/main/tests/test_physics.cpp +++ b/main/tests/test_physics.cpp @@ -615,4 +615,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 2e6ae0bd280..2827cc1c48e 100644 --- a/main/tests/test_physics_2d.cpp +++ b/main/tests/test_physics_2d.cpp @@ -417,4 +417,4 @@ MainLoop *test() { return memnew(TestPhysics2DMainLoop); } -} +} // namespace TestPhysics2D diff --git a/main/tests/test_python.cpp b/main/tests/test_python.cpp index 5610b511a29..32fefc2ab52 100644 --- a/main/tests/test_python.cpp +++ b/main/tests/test_python.cpp @@ -49,6 +49,6 @@ void test() { PyRun_SimpleString("b.mooch();\n"); PyRun_SimpleString("b.meis();\n"); } -} +} // namespace TestPython #endif diff --git a/main/tests/test_render.cpp b/main/tests/test_render.cpp index 13473f59989..5b1e9590d3b 100644 --- a/main/tests/test_render.cpp +++ b/main/tests/test_render.cpp @@ -240,4 +240,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 d900d149bd4..56e4d59a658 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_sound.cpp b/main/tests/test_sound.cpp index 1f88a3195c7..1540bebba74 100644 --- a/main/tests/test_sound.cpp +++ b/main/tests/test_sound.cpp @@ -81,4 +81,4 @@ MainLoop *test() { return memnew(TestMainLoop); } -} +} // namespace TestSound diff --git a/main/tests/test_string.cpp b/main/tests/test_string.cpp index debf0a80d39..bd249eeadbb 100644 --- a/main/tests/test_string.cpp +++ b/main/tests/test_string.cpp @@ -930,4 +930,4 @@ MainLoop *test() { return NULL; } -} +} // namespace TestString diff --git a/modules/chibi/event_stream_chibi.cpp b/modules/chibi/event_stream_chibi.cpp index f3676862055..263f70a26f2 100644 --- a/modules/chibi/event_stream_chibi.cpp +++ b/modules/chibi/event_stream_chibi.cpp @@ -683,8 +683,8 @@ float EventStreamPlaybackChibi::get_last_note_time(int p_channel) const { return v; } -EventStreamPlaybackChibi::EventStreamPlaybackChibi(Ref p_stream) - : mixer(_get_mixer()) { +EventStreamPlaybackChibi::EventStreamPlaybackChibi(Ref p_stream) : + mixer(_get_mixer()) { stream = p_stream; player = memnew(CPPlayer(&mixer, &p_stream->song)); diff --git a/modules/gdscript/gd_compiler.cpp b/modules/gdscript/gd_compiler.cpp index 6e54e24cd95..5e66525228f 100644 --- a/modules/gdscript/gd_compiler.cpp +++ b/modules/gdscript/gd_compiler.cpp @@ -771,7 +771,7 @@ int GDCompiler::_parse_expression(CodeGen &codegen, const GDParser::Node *p_expr ERR_FAIL_COND_V(on->arguments.size() != 2, -1); if (on->arguments[0]->type == GDParser::Node::TYPE_OPERATOR && (static_cast(on->arguments[0])->op == GDParser::OperatorNode::OP_INDEX || static_cast(on->arguments[0])->op == GDParser::OperatorNode::OP_INDEX_NAMED)) { -//SET (chained) MODE!! + //SET (chained) MODE!! #ifdef DEBUG_ENABLED if (static_cast(on->arguments[0])->op == GDParser::OperatorNode::OP_INDEX_NAMED) { diff --git a/modules/gdscript/gd_function.cpp b/modules/gdscript/gd_function.cpp index 85dd9bf8f02..74b550ee605 100644 --- a/modules/gdscript/gd_function.cpp +++ b/modules/gdscript/gd_function.cpp @@ -148,7 +148,7 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a #ifdef DEBUG_ENABLED -//GDScriptLanguage::get_singleton()->calls++; + //GDScriptLanguage::get_singleton()->calls++; #endif @@ -1265,8 +1265,8 @@ void GDFunction::clear() { } #endif -GDFunction::GDFunction() - : function_list(this) { +GDFunction::GDFunction() : + function_list(this) { _stack_size = 0; _call_size = 0; diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp index 95c996a9902..55374f3a920 100644 --- a/modules/gdscript/gd_script.cpp +++ b/modules/gdscript/gd_script.cpp @@ -795,8 +795,8 @@ void GDScript::get_script_signal_list(List *r_signals) const { #endif } -GDScript::GDScript() - : script_list(this) { +GDScript::GDScript() : + script_list(this) { _static_ref = this; valid = false; diff --git a/modules/gdscript/gd_tokenizer.cpp b/modules/gdscript/gd_tokenizer.cpp index 5412961f5ca..3ad2b65f137 100644 --- a/modules/gdscript/gd_tokenizer.cpp +++ b/modules/gdscript/gd_tokenizer.cpp @@ -1026,7 +1026,7 @@ void GDTokenizerText::advance(int p_amount) { _advance(); } -////////////////////////////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////////////////////////////// #define BYTECODE_VERSION 10 diff --git a/modules/pvr/texture_loader_pvr.cpp b/modules/pvr/texture_loader_pvr.cpp index c0ff3c16969..7ad31b20fdf 100644 --- a/modules/pvr/texture_loader_pvr.cpp +++ b/modules/pvr/texture_loader_pvr.cpp @@ -241,11 +241,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/theora/video_stream_theora.cpp b/modules/theora/video_stream_theora.cpp index e932aab3b83..1b7416ad73d 100644 --- a/modules/theora/video_stream_theora.cpp +++ b/modules/theora/video_stream_theora.cpp @@ -661,7 +661,7 @@ void VideoStreamPlaybackTheora::update(float p_delta) { } } -//print_line("no theora: "+itos(no_theora)+" theora eos: "+itos(theora_eos)+" frame done "+itos(frame_done)); + //print_line("no theora: "+itos(no_theora)+" theora eos: "+itos(theora_eos)+" frame done "+itos(frame_done)); #ifdef THEORA_USE_THREAD_STREAMING if (file && thread_eof && no_theora && theora_eos && ring_buffer.data_left() == 0) { diff --git a/modules/vorbis/audio_stream_ogg_vorbis.cpp b/modules/vorbis/audio_stream_ogg_vorbis.cpp index f7ff54c0f38..fc54c28ad86 100644 --- a/modules/vorbis/audio_stream_ogg_vorbis.cpp +++ b/modules/vorbis/audio_stream_ogg_vorbis.cpp @@ -106,7 +106,7 @@ int AudioStreamPlaybackOGGVorbis::mix(int16_t *p_bufer, int p_frames) { break; } -//printf("to mix %i - mix me %i bytes\n",to_mix,to_mix*stream_channels*sizeof(int16_t)); + //printf("to mix %i - mix me %i bytes\n",to_mix,to_mix*stream_channels*sizeof(int16_t)); #ifdef BIG_ENDIAN_ENABLED long ret = ov_read(&vf, (char *)p_bufer, todo * stream_channels * sizeof(int16_t), 1, 2, 1, ¤t_section); diff --git a/platform/android/godot_android.cpp b/platform/android/godot_android.cpp index c0a13f506ff..aaaaf7ecad5 100644 --- a/platform/android/godot_android.cpp +++ b/platform/android/godot_android.cpp @@ -591,7 +591,7 @@ static void engine_handle_cmd(struct android_app *app, int32_t cmd) { engine_draw_frame(engine); engine->animating = 1; -/* + /* EGLint w,h; eglQuerySurface(engine->display, engine->surface, EGL_WIDTH, &w); eglQuerySurface(engine->display, engine->surface, EGL_HEIGHT, &h); diff --git a/platform/haiku/haiku_application.cpp b/platform/haiku/haiku_application.cpp index d23b9e27d83..e2649b15a43 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 05b7465828e..06be6e58e7e 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 d898bd1a5dc..bb9c439e94c 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/iphone/os_iphone.cpp b/platform/iphone/os_iphone.cpp index cfd36037ec8..f2746bafa26 100644 --- a/platform/iphone/os_iphone.cpp +++ b/platform/iphone/os_iphone.cpp @@ -144,7 +144,7 @@ void OSIPhone::initialize(const VideoMode &p_desired, int p_video_driver, int p_ input = memnew(InputDefault); -/* + /* #ifdef IOS_SCORELOOP_ENABLED scoreloop = memnew(ScoreloopIOS); Globals::get_singleton()->add_singleton(Globals::Singleton("Scoreloop", scoreloop)); diff --git a/platform/iphone/rasterizer_iphone.cpp b/platform/iphone/rasterizer_iphone.cpp index dc5dc670931..7de5790e99d 100644 --- a/platform/iphone/rasterizer_iphone.cpp +++ b/platform/iphone/rasterizer_iphone.cpp @@ -1502,7 +1502,7 @@ void RasterizerIPhone::begin_frame() { glClearColor(0, 0, 1, 1); glClear(GL_COLOR_BUFFER_BIT); -/* nehe ?*/ + /* nehe ?*/ #if 0 glViewport(0,0,window_size.width,window_size.height); // Reset The Current Viewport @@ -2210,8 +2210,14 @@ void RasterizerIPhone::canvas_draw_line(const Point2 &p_from, const Point2 &p_to }; float colors[] = { - p_color.r, p_color.g, p_color.b, p_color.a, - p_color.r, p_color.g, p_color.b, p_color.a, + p_color.r, + p_color.g, + p_color.b, + p_color.a, + p_color.r, + p_color.g, + p_color.b, + p_color.a, }; glLineWidth(p_width); _draw_primitive(2, verts, 0, colors, 0); diff --git a/platform/iphone/rasterizer_iphone.h b/platform/iphone/rasterizer_iphone.h index 357d65019c2..04ba65ef975 100644 --- a/platform/iphone/rasterizer_iphone.h +++ b/platform/iphone/rasterizer_iphone.h @@ -146,8 +146,8 @@ class RasterizerIPhone : public Rasterizer { Vector3 scale; Vector3 uv_scale; - Geometry() - : scale(1, 1, 1) { + Geometry() : + scale(1, 1, 1) { has_alpha = false; material_owned = false; } diff --git a/platform/javascript/dom_keys.h b/platform/javascript/dom_keys.h index 01513eb2107..946fb67b87e 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/windows/crash_handler_win.cpp b/platform/windows/crash_handler_win.cpp index 51b0d73b7a5..485bcbdba58 100644 --- a/platform/windows/crash_handler_win.cpp +++ b/platform/windows/crash_handler_win.cpp @@ -60,8 +60,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; @@ -84,8 +84,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/winrt/app.cpp b/platform/winrt/app.cpp index afa6f53a577..d521c03a398 100644 --- a/platform/winrt/app.cpp +++ b/platform/winrt/app.cpp @@ -78,15 +78,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/winrt/audio_driver_winrt.h b/platform/winrt/audio_driver_winrt.h index c48a11df486..a7cd68861ab 100644 --- a/platform/winrt/audio_driver_winrt.h +++ b/platform/winrt/audio_driver_winrt.h @@ -48,8 +48,8 @@ class AudioDriverWinRT : public AudioDriverSW { 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/platform/winrt/export/export.cpp b/platform/winrt/export/export.cpp index 90b09648670..be5530290d2 100644 --- a/platform/winrt/export/export.cpp +++ b/platform/winrt/export/export.cpp @@ -182,19 +182,28 @@ ASN1_SEQUENCE(SPCIndirectDataContent) = { } ASN1_SEQUENCE_END(SPCIndirectDataContent) IMPLEMENT_ASN1_FUNCTIONS(SPCAttributeTypeAndOptionalValue) ASN1_SEQUENCE(SPCAttributeTypeAndOptionalValue) = { - ASN1_SIMPLE(SPCAttributeTypeAndOptionalValue, type, ASN1_OBJECT), ASN1_OPT(SPCAttributeTypeAndOptionalValue, value, ASN1_ANY), + ASN1_SIMPLE(SPCAttributeTypeAndOptionalValue, type, ASN1_OBJECT), + ASN1_OPT(SPCAttributeTypeAndOptionalValue, value, ASN1_ANY), } ASN1_SEQUENCE_END(SPCAttributeTypeAndOptionalValue) IMPLEMENT_ASN1_FUNCTIONS(SPCInfoValue) ASN1_SEQUENCE(SPCInfoValue) = { - ASN1_SIMPLE(SPCInfoValue, i1, ASN1_INTEGER), ASN1_SIMPLE(SPCInfoValue, s1, ASN1_OCTET_STRING), ASN1_SIMPLE(SPCInfoValue, i2, ASN1_INTEGER), ASN1_SIMPLE(SPCInfoValue, i3, ASN1_INTEGER), ASN1_SIMPLE(SPCInfoValue, i4, ASN1_INTEGER), ASN1_SIMPLE(SPCInfoValue, i5, ASN1_INTEGER), ASN1_SIMPLE(SPCInfoValue, i6, ASN1_INTEGER), + ASN1_SIMPLE(SPCInfoValue, i1, ASN1_INTEGER), + ASN1_SIMPLE(SPCInfoValue, s1, ASN1_OCTET_STRING), + ASN1_SIMPLE(SPCInfoValue, i2, ASN1_INTEGER), + ASN1_SIMPLE(SPCInfoValue, i3, ASN1_INTEGER), + ASN1_SIMPLE(SPCInfoValue, i4, ASN1_INTEGER), + ASN1_SIMPLE(SPCInfoValue, i5, ASN1_INTEGER), + ASN1_SIMPLE(SPCInfoValue, i6, ASN1_INTEGER), } ASN1_SEQUENCE_END(SPCInfoValue) IMPLEMENT_ASN1_FUNCTIONS(DigestInfo) ASN1_SEQUENCE(DigestInfo) = { - ASN1_SIMPLE(DigestInfo, digestAlgorithm, X509_ALGOR), ASN1_SIMPLE(DigestInfo, digest, ASN1_OCTET_STRING), + ASN1_SIMPLE(DigestInfo, digestAlgorithm, X509_ALGOR), + ASN1_SIMPLE(DigestInfo, digest, ASN1_OCTET_STRING), } ASN1_SEQUENCE_END(DigestInfo) ASN1_SEQUENCE(SPCSpOpusInfo) = { - ASN1_OPT(SPCSpOpusInfo, programName, ASN1_ANY), ASN1_OPT(SPCSpOpusInfo, moreInfo, ASN1_ANY), + ASN1_OPT(SPCSpOpusInfo, programName, ASN1_ANY), + ASN1_OPT(SPCSpOpusInfo, moreInfo, ASN1_ANY), } ASN1_SEQUENCE_END(SPCSpOpusInfo) IMPLEMENT_ASN1_FUNCTIONS(SPCSpOpusInfo) ASN1_SEQUENCE(SPCStatementType) = { @@ -1095,7 +1104,7 @@ AppxPackager::AppxPackager() {} AppxPackager::~AppxPackager() {} -//////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////// #ifdef OPENSSL_ENABLED Error AppxPackager::openssl_error(unsigned long p_err) { @@ -1115,8 +1124,22 @@ void AppxPackager::MakeSPCInfoValue(asn1::SPCInfoValue &info) { // I have no idea what these numbers mean. static uint8_t s1Magic[] = { - 0x4B, 0xDF, 0xC5, 0x0A, 0x07, 0xCE, 0xE2, 0x4D, - 0xB7, 0x6E, 0x23, 0xC8, 0x39, 0xA0, 0x9F, 0xD1, + 0x4B, + 0xDF, + 0xC5, + 0x0A, + 0x07, + 0xCE, + 0xE2, + 0x4D, + 0xB7, + 0x6E, + 0x23, + 0xC8, + 0x39, + 0xA0, + 0x9F, + 0xD1, }; ASN1_INTEGER_set(info.i1, 0x01010000); ASN1_OCTET_STRING_set(info.s1, s1Magic, sizeof(s1Magic)); diff --git a/platform/winrt/gl_context_egl.cpp b/platform/winrt/gl_context_egl.cpp index 1191db0941c..49ce69d838e 100644 --- a/platform/winrt/gl_context_egl.cpp +++ b/platform/winrt/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/winrt/joystick_winrt.cpp b/platform/winrt/joystick_winrt.cpp index 76e2330efc9..125d80aa01c 100644 --- a/platform/winrt/joystick_winrt.cpp +++ b/platform/winrt/joystick_winrt.cpp @@ -53,7 +53,7 @@ uint32_t JoystickWinrt::process_controllers(uint32_t p_last_id) { 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++) { @@ -162,7 +162,7 @@ void JoystickWinrt::joypad_vibration_start(int p_device, float p_weak_magnitude, 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); @@ -176,7 +176,7 @@ void JoystickWinrt::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/x11/context_gl_x11.cpp b/platform/x11/context_gl_x11.cpp index fa2409cc668..9de6945c92a 100644 --- a/platform/x11/context_gl_x11.cpp +++ b/platform/x11/context_gl_x11.cpp @@ -202,8 +202,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 7bea11ca4ec..7f16761e16d 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -537,9 +537,9 @@ void OS_X11::finalize() { spatial_sound_2d_server->finish(); memdelete(spatial_sound_2d_server); -//if (debugger_connection_console) { -// memdelete(debugger_connection_console); -//} + //if (debugger_connection_console) { + // memdelete(debugger_connection_console); + //} #ifdef JOYDEV_ENABLED memdelete(joystick); @@ -1384,8 +1384,8 @@ void OS_X11::process_xevents() { switch (event_data->evtype) { case XI_TouchBegin: // Fall-through - // Disabled hand-in-hand with the grabbing - //XIAllowTouchEvents(x11_display, event_data->deviceid, event_data->detail, x11_window, XIAcceptTouch); + // Disabled hand-in-hand with the grabbing + //XIAllowTouchEvents(x11_display, event_data->deviceid, event_data->detail, x11_window, XIAcceptTouch); case XI_TouchEnd: { diff --git a/scene/2d/animated_sprite.cpp b/scene/2d/animated_sprite.cpp index 24925c764fb..2d9f0d58fec 100644 --- a/scene/2d/animated_sprite.cpp +++ b/scene/2d/animated_sprite.cpp @@ -30,7 +30,6 @@ #include "animated_sprite.h" #include "os/os.h" #include "scene/scene_string_names.h" -#include "scene/scene_string_names.h" //////////////////////////// diff --git a/scene/2d/area_2d.cpp b/scene/2d/area_2d.cpp index 4eec6c11fd5..bed2931d2f6 100644 --- a/scene/2d/area_2d.cpp +++ b/scene/2d/area_2d.cpp @@ -643,8 +643,8 @@ void Area2D::_bind_methods() { ADD_PROPERTYNO(PropertyInfo(Variant::INT, "collision/mask", PROPERTY_HINT_ALL_FLAGS), _SCS("set_collision_mask"), _SCS("get_collision_mask")); } -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 5e938568471..30a44638895 100644 --- a/scene/2d/canvas_item.cpp +++ b/scene/2d/canvas_item.cpp @@ -1086,8 +1086,8 @@ Rect2 CanvasItem::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(); hidden = false; diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp index 8f280c3f85d..c257eaf18d8 100644 --- a/scene/2d/physics_body_2d.cpp +++ b/scene/2d/physics_body_2d.cpp @@ -158,8 +158,8 @@ bool PhysicsBody2D::get_layer_mask_bit(int p_bit) const { return get_layer_mask() & (1 << p_bit); } -PhysicsBody2D::PhysicsBody2D(Physics2DServer::BodyMode p_mode) - : CollisionObject2D(Physics2DServer::get_singleton()->body_create(p_mode), false) { +PhysicsBody2D::PhysicsBody2D(Physics2DServer::BodyMode p_mode) : + CollisionObject2D(Physics2DServer::get_singleton()->body_create(p_mode), false) { mask = 1; collision_mask = 1; @@ -275,8 +275,8 @@ void StaticBody2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::REAL, "bounce", PROPERTY_HINT_RANGE, "0,1,0.01"), _SCS("set_bounce"), _SCS("get_bounce")); } -StaticBody2D::StaticBody2D() - : PhysicsBody2D(Physics2DServer::BODY_MODE_STATIC) { +StaticBody2D::StaticBody2D() : + PhysicsBody2D(Physics2DServer::BODY_MODE_STATIC) { constant_angular_velocity = 0; bounce = 0; @@ -971,8 +971,8 @@ void RigidBody2D::_bind_methods() { BIND_CONSTANT(CCD_MODE_CAST_SHAPE); } -RigidBody2D::RigidBody2D() - : PhysicsBody2D(Physics2DServer::BODY_MODE_RIGID) { +RigidBody2D::RigidBody2D() : + PhysicsBody2D(Physics2DServer::BODY_MODE_RIGID) { mode = MODE_RIGID; @@ -1385,8 +1385,8 @@ void KinematicBody2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::REAL, "collision/margin", PROPERTY_HINT_RANGE, "0.001,256,0.001"), _SCS("set_collision_margin"), _SCS("get_collision_margin")); } -KinematicBody2D::KinematicBody2D() - : PhysicsBody2D(Physics2DServer::BODY_MODE_KINEMATIC) { +KinematicBody2D::KinematicBody2D() : + PhysicsBody2D(Physics2DServer::BODY_MODE_KINEMATIC) { colliding = false; collider = 0; diff --git a/scene/2d/sample_player_2d.cpp b/scene/2d/sample_player_2d.cpp index 309ebe3dada..e59a195746c 100644 --- a/scene/2d/sample_player_2d.cpp +++ b/scene/2d/sample_player_2d.cpp @@ -29,7 +29,6 @@ /*************************************************************************/ #include "sample_player_2d.h" -#include "servers/audio_server.h" #include "servers/audio_server.h" #include "servers/spatial_sound_server.h" diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index e12b93f5cb5..1f922a23f12 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -270,7 +270,7 @@ struct _BodyParams { return p_rhs.one_way_direction == one_way_direction && p_rhs.one_way_max_depth == one_way_max_depth; } }; -} +} // namespace void TileMap::_update_dirty_quadrants() { diff --git a/scene/2d/tile_map.h b/scene/2d/tile_map.h index ab8652b9372..acef67be7e1 100644 --- a/scene/2d/tile_map.h +++ b/scene/2d/tile_map.h @@ -136,8 +136,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; bodies = q.bodies; @@ -145,8 +145,8 @@ private: occluder_instances = q.occluder_instances; navpoly_ids = q.navpoly_ids; } - Quadrant() - : dirty_list(this) {} + Quadrant() : + dirty_list(this) {} }; Map quadrant_map; diff --git a/scene/2d/visibility_notifier_2d.cpp b/scene/2d/visibility_notifier_2d.cpp index 1cdeebe366b..0b23dde7679 100644 --- a/scene/2d/visibility_notifier_2d.cpp +++ b/scene/2d/visibility_notifier_2d.cpp @@ -34,7 +34,6 @@ #include "scene/2d/physics_body_2d.h" #include "scene/animation/animation_player.h" #include "scene/scene_string_names.h" -#include "scene/scene_string_names.h" void VisibilityNotifier2D::_enter_viewport(Viewport *p_viewport) { diff --git a/scene/3d/area.cpp b/scene/3d/area.cpp index a240eb9ddba..775efea3933 100644 --- a/scene/3d/area.cpp +++ b/scene/3d/area.cpp @@ -639,8 +639,8 @@ void Area::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "collision/mask", PROPERTY_HINT_ALL_FLAGS), _SCS("set_collision_mask"), _SCS("get_collision_mask")); } -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/light.cpp b/scene/3d/light.cpp index 3ece164c00e..4418612d2b5 100644 --- a/scene/3d/light.cpp +++ b/scene/3d/light.cpp @@ -598,8 +598,8 @@ void DirectionalLight::_bind_methods() { BIND_CONSTANT(SHADOW_PARAM_PSSM_ZOFFSET_SCALE); } -DirectionalLight::DirectionalLight() - : Light(VisualServer::LIGHT_DIRECTIONAL) { +DirectionalLight::DirectionalLight() : + Light(VisualServer::LIGHT_DIRECTIONAL) { shadow_mode = SHADOW_ORTHOGONAL; shadow_param[SHADOW_PARAM_MAX_DISTANCE] = 0; diff --git a/scene/3d/light.h b/scene/3d/light.h index 22229cecaab..1df6c63dfe2 100644 --- a/scene/3d/light.h +++ b/scene/3d/light.h @@ -192,8 +192,8 @@ protected: static void _bind_methods(); public: - OmniLight() - : Light(VisualServer::LIGHT_OMNI) { set_parameter(PARAM_SHADOW_Z_OFFSET, 0.001); } + OmniLight() : + Light(VisualServer::LIGHT_OMNI) { set_parameter(PARAM_SHADOW_Z_OFFSET, 0.001); } }; class SpotLight : public Light { @@ -204,8 +204,8 @@ protected: static void _bind_methods(); public: - SpotLight() - : Light(VisualServer::LIGHT_SPOT) {} + SpotLight() : + Light(VisualServer::LIGHT_SPOT) {} }; #endif diff --git a/scene/3d/physics_body.cpp b/scene/3d/physics_body.cpp index 333cf39dbaf..e0921b4156b 100644 --- a/scene/3d/physics_body.cpp +++ b/scene/3d/physics_body.cpp @@ -163,8 +163,8 @@ void PhysicsBody::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "collision/mask", PROPERTY_HINT_ALL_FLAGS), _SCS("set_collision_mask"), _SCS("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) { layer_mask = 1; collision_mask = 1; @@ -238,8 +238,8 @@ void StaticBody::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "constant_angular_velocity"), _SCS("set_constant_angular_velocity"), _SCS("get_constant_angular_velocity")); } -StaticBody::StaticBody() - : PhysicsBody(PhysicsServer::BODY_MODE_STATIC) { +StaticBody::StaticBody() : + PhysicsBody(PhysicsServer::BODY_MODE_STATIC) { bounce = 0; friction = 1; @@ -871,8 +871,8 @@ void RigidBody::_bind_methods() { BIND_CONSTANT(MODE_CHARACTER); } -RigidBody::RigidBody() - : PhysicsBody(PhysicsServer::BODY_MODE_RIGID) { +RigidBody::RigidBody() : + PhysicsBody(PhysicsServer::BODY_MODE_RIGID) { mode = MODE_RIGID; @@ -1283,8 +1283,8 @@ void KinematicBody::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::REAL, "collision/margin", PROPERTY_HINT_RANGE, "0.001,256,0.001"), _SCS("set_collision_margin"), _SCS("get_collision_margin")); } -KinematicBody::KinematicBody() - : PhysicsBody(PhysicsServer::BODY_MODE_KINEMATIC) { +KinematicBody::KinematicBody() : + PhysicsBody(PhysicsServer::BODY_MODE_KINEMATIC) { collide_static = true; collide_rigid = true; diff --git a/scene/3d/spatial.cpp b/scene/3d/spatial.cpp index ae21222a82e..6bfddb9c9f5 100644 --- a/scene/3d/spatial.cpp +++ b/scene/3d/spatial.cpp @@ -788,8 +788,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/sprite_3d.cpp b/scene/3d/sprite_3d.cpp index 98e58271ef7..e0f28bcd833 100644 --- a/scene/3d/sprite_3d.cpp +++ b/scene/3d/sprite_3d.cpp @@ -597,7 +597,7 @@ Sprite3D::Sprite3D() { hframes = 1; } -//////////////////////////////////////// + //////////////////////////////////////// #if 0 diff --git a/scene/3d/vehicle_body.cpp b/scene/3d/vehicle_body.cpp index 3cf56c99c7d..99852adb919 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; @@ -573,12 +573,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; @@ -947,8 +947,8 @@ void VehicleBody::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::REAL, "body/friction", PROPERTY_HINT_RANGE, "0.01,1,0.01"), _SCS("set_friction"), _SCS("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/3d/visibility_notifier.cpp b/scene/3d/visibility_notifier.cpp index 1039dc6c99c..8fa11e3fde0 100644 --- a/scene/3d/visibility_notifier.cpp +++ b/scene/3d/visibility_notifier.cpp @@ -32,7 +32,6 @@ #include "scene/3d/physics_body.h" #include "scene/animation/animation_player.h" #include "scene/scene_string_names.h" -#include "scene/scene_string_names.h" void VisibilityNotifier::_enter_camera(Camera *p_camera) { diff --git a/scene/animation/tween_interpolaters.cpp b/scene/animation/tween_interpolaters.cpp index 8f543a575ae..cbf941f3ed6 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 3644a13d02e..d901839eaf8 100644 --- a/scene/gui/box_container.h +++ b/scene/gui/box_container.h @@ -70,8 +70,8 @@ class HBoxContainer : public BoxContainer { OBJ_TYPE(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/button_array.h b/scene/gui/button_array.h index 0d878216389..f8ba1651c59 100644 --- a/scene/gui/button_array.h +++ b/scene/gui/button_array.h @@ -116,16 +116,16 @@ class HButtonArray : public ButtonArray { OBJ_TYPE(HButtonArray, ButtonArray); public: - HButtonArray() - : ButtonArray(HORIZONTAL){}; + HButtonArray() : + ButtonArray(HORIZONTAL){}; }; class VButtonArray : public ButtonArray { OBJ_TYPE(VButtonArray, ButtonArray); public: - VButtonArray() - : ButtonArray(VERTICAL){}; + VButtonArray() : + ButtonArray(VERTICAL){}; }; #endif // BUTTON_ARRAY_H diff --git a/scene/gui/button_group.cpp b/scene/gui/button_group.cpp index cf8ea9b61de..0dec7eafb2d 100644 --- a/scene/gui/button_group.cpp +++ b/scene/gui/button_group.cpp @@ -156,6 +156,6 @@ void ButtonGroup::_bind_methods() { ADD_SIGNAL(MethodInfo("button_selected", PropertyInfo(Variant::OBJECT, "button", PROPERTY_HINT_RESOURCE_TYPE, "BaseButton"))); } -ButtonGroup::ButtonGroup() - : BoxContainer(true) { +ButtonGroup::ButtonGroup() : + BoxContainer(true) { } diff --git a/scene/gui/check_box.cpp b/scene/gui/check_box.cpp index bb4935ecb74..922a7ce8f1c 100644 --- a/scene/gui/check_box.cpp +++ b/scene/gui/check_box.cpp @@ -63,8 +63,8 @@ bool CheckBox::is_radio() { return (parent != 0); } -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 c8ce68ae9bf..7d723844ed4 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -435,8 +435,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/file_dialog.h b/scene/gui/file_dialog.h index f70fca6f9e6..06e13db4fe8 100644 --- a/scene/gui/file_dialog.h +++ b/scene/gui/file_dialog.h @@ -33,7 +33,6 @@ #include "box_container.h" #include "os/dir_access.h" #include "scene/gui/dialogs.h" -#include "scene/gui/dialogs.h" #include "scene/gui/line_edit.h" #include "scene/gui/option_button.h" #include "scene/gui/tool_button.h" diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 605883020b3..4e3adc47df1 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -655,8 +655,7 @@ void LineEdit::_notification(int p_what) { font->draw_char(ci, Point2(x_ofs, y_ofs + font_ascent), cchar, next, selected ? font_color_selected : font_color); if (char_ofs == cursor_pos && draw_caret) { - VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2( - Point2(x_ofs, y_ofs), Size2(1, caret_height)), + VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(x_ofs, y_ofs), Size2(1, caret_height)), cursor_color); } @@ -665,8 +664,7 @@ void LineEdit::_notification(int p_what) { } if (char_ofs == cursor_pos && draw_caret) { //may be at the end - VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2( - Point2(x_ofs, y_ofs), Size2(1, caret_height)), + VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(x_ofs, y_ofs), Size2(1, caret_height)), cursor_color); } } break; diff --git a/scene/gui/scroll_bar.h b/scene/gui/scroll_bar.h index c918d3e4884..c7212a4f2a1 100644 --- a/scene/gui/scroll_bar.h +++ b/scene/gui/scroll_bar.h @@ -110,8 +110,8 @@ class HScrollBar : public ScrollBar { OBJ_TYPE(HScrollBar, ScrollBar); public: - HScrollBar() - : ScrollBar(HORIZONTAL) { set_v_size_flags(0); } + HScrollBar() : + ScrollBar(HORIZONTAL) { set_v_size_flags(0); } }; class VScrollBar : public ScrollBar { @@ -119,8 +119,8 @@ class VScrollBar : public ScrollBar { OBJ_TYPE(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 7b7a244d148..097bbec248a 100644 --- a/scene/gui/slider.h +++ b/scene/gui/slider.h @@ -73,8 +73,8 @@ class HSlider : public Slider { OBJ_TYPE(HSlider, Slider); public: - HSlider() - : Slider(HORIZONTAL) { set_v_size_flags(0); } + HSlider() : + Slider(HORIZONTAL) { set_v_size_flags(0); } }; class VSlider : public Slider { @@ -82,8 +82,8 @@ class VSlider : public Slider { OBJ_TYPE(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 ac8b453bb18..4beea844d51 100644 --- a/scene/gui/split_container.h +++ b/scene/gui/split_container.h @@ -87,8 +87,8 @@ class HSplitContainer : public SplitContainer { OBJ_TYPE(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 { OBJ_TYPE(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/main/scene_main_loop.cpp b/scene/main/scene_main_loop.cpp index ec6ba8a92b0..8d74c8f689e 100644 --- a/scene/main/scene_main_loop.cpp +++ b/scene/main/scene_main_loop.cpp @@ -738,6 +738,7 @@ Ref SceneTree::get_debug_contact_mesh() { Vector3(0, 0, 1) }; + /* clang-format off */ int diamond_faces[8 * 3] = { 0, 2, 4, 0, 3, 4, @@ -748,6 +749,7 @@ Ref SceneTree::get_debug_contact_mesh() { 1, 2, 5, 1, 3, 5, }; + /* clang-format on */ DVector indices; for (int i = 0; i < 8 * 3; i++) diff --git a/scene/main/scene_main_loop.h b/scene/main/scene_main_loop.h index 74628451755..9ffe2be75bc 100644 --- a/scene/main/scene_main_loop.h +++ b/scene/main/scene_main_loop.h @@ -334,8 +334,8 @@ public: void set_screen_stretch(StretchMode p_mode, StretchAspect p_aspect, const Size2 p_minsize); -//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/register_scene_types.cpp b/scene/register_scene_types.cpp index cae07b1371e..be8b84eb3e3 100644 --- a/scene/register_scene_types.cpp +++ b/scene/register_scene_types.cpp @@ -74,7 +74,6 @@ #include "scene/gui/separator.h" #include "scene/gui/slider.h" #include "scene/gui/spin_box.h" -#include "scene/gui/spin_box.h" #include "scene/gui/split_container.h" #include "scene/gui/tab_container.h" #include "scene/gui/tabs.h" @@ -126,7 +125,6 @@ #include "scene/animation/tween.h" #include "scene/main/resource_preloader.h" #include "scene/main/scene_main_loop.h" -#include "scene/main/scene_main_loop.h" #include "scene/resources/packed_scene.h" #include "scene/resources/dynamic_font.h" @@ -256,7 +254,7 @@ void register_scene_types() { #ifdef TOOLS_ENABLED -//scene first! + //scene first! #endif diff --git a/scene/resources/box_shape.cpp b/scene/resources/box_shape.cpp index 16bf6f99699..a5ff54acc58 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"), _SCS("set_extents"), _SCS("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 167cbb614d9..07ee88c1e93 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"), _SCS("set_height"), _SCS("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 54afc57c2f5..debc0cd091b 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"), _SCS("set_height"), _SCS("get_height")); } -CapsuleShape2D::CapsuleShape2D() - : Shape2D(Physics2DServer::get_singleton()->shape_create(Physics2DServer::SHAPE_CAPSULE)) { +CapsuleShape2D::CapsuleShape2D() : + Shape2D(Physics2DServer::get_singleton()->shape_create(Physics2DServer::SHAPE_CAPSULE)) { radius = 10; height = 20; diff --git a/scene/resources/circle_shape_2d.cpp b/scene/resources/circle_shape_2d.cpp index 3c537d4a28e..fb6478a1a05 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()->shape_create(Physics2DServer::SHAPE_CIRCLE)) { +CircleShape2D::CircleShape2D() : + Shape2D(Physics2DServer::get_singleton()->shape_create(Physics2DServer::SHAPE_CIRCLE)) { radius = 10; _update_shape(); diff --git a/scene/resources/concave_polygon_shape.cpp b/scene/resources/concave_polygon_shape.cpp index e6ea025f1d8..f8532a04b65 100644 --- a/scene/resources/concave_polygon_shape.cpp +++ b/scene/resources/concave_polygon_shape.cpp @@ -106,8 +106,8 @@ void ConcavePolygonShape::_bind_methods() { ObjectTypeDB::bind_method(_MD("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 d4bb3676b07..0402c021ebf 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::VECTOR2_ARRAY, "segments"), _SCS("set_segments"), _SCS("get_segments")); } -ConcavePolygonShape2D::ConcavePolygonShape2D() - : Shape2D(Physics2DServer::get_singleton()->shape_create(Physics2DServer::SHAPE_CONCAVE_POLYGON)) { +ConcavePolygonShape2D::ConcavePolygonShape2D() : + Shape2D(Physics2DServer::get_singleton()->shape_create(Physics2DServer::SHAPE_CONCAVE_POLYGON)) { } diff --git a/scene/resources/convex_polygon_shape.cpp b/scene/resources/convex_polygon_shape.cpp index 5059e7fbf9d..3438292d812 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"), _SCS("set_points"), _SCS("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 2a4ea437bf1..8f21ab36620 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()->shape_create(Physics2DServer::SHAPE_CONVEX_POLYGON)) { +ConvexPolygonShape2D::ConvexPolygonShape2D() : + Shape2D(Physics2DServer::get_singleton()->shape_create(Physics2DServer::SHAPE_CONVEX_POLYGON)) { int pcount = 3; for (int i = 0; i < pcount; i++) diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index 0561d390ac4..a2f7b7abe30 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -397,8 +397,8 @@ void FixedMaterial::_bind_methods() { BIND_CONSTANT(LIGHT_SHADER_TOON); } -FixedMaterial::FixedMaterial() - : Material(VS::get_singleton()->fixed_material_create()) { +FixedMaterial::FixedMaterial() : + Material(VS::get_singleton()->fixed_material_create()) { param[PARAM_DIFFUSE] = Color(1, 1, 1); param[PARAM_SPECULAR] = Color(0.0, 0.0, 0.0); @@ -548,8 +548,8 @@ void ShaderMaterial::get_argument_options(const StringName &p_function, int p_id Material::get_argument_options(p_function, p_idx, r_options); } -ShaderMaterial::ShaderMaterial() - : Material(VisualServer::get_singleton()->material_create()) { +ShaderMaterial::ShaderMaterial() : + Material(VisualServer::get_singleton()->material_create()) { } ///////////////////////////////// diff --git a/scene/resources/plane_shape.cpp b/scene/resources/plane_shape.cpp index 19f8a62556b..2be3ae5076c 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"), _SCS("set_plane"), _SCS("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 c7b49b9737d..31166f84628 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"), _SCS("set_length"), _SCS("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 f8d7aba0f86..cd904ef0d1b 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"), _SCS("set_extents"), _SCS("get_extents")); } -RectangleShape2D::RectangleShape2D() - : Shape2D(Physics2DServer::get_singleton()->shape_create(Physics2DServer::SHAPE_RECTANGLE)) { +RectangleShape2D::RectangleShape2D() : + Shape2D(Physics2DServer::get_singleton()->shape_create(Physics2DServer::SHAPE_RECTANGLE)) { extents = Vector2(10, 10); _update_shape(); diff --git a/scene/resources/segment_shape_2d.cpp b/scene/resources/segment_shape_2d.cpp index c2c2904d1f4..6df43bd32f8 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"), _SCS("set_b"), _SCS("get_b")); } -SegmentShape2D::SegmentShape2D() - : Shape2D(Physics2DServer::get_singleton()->shape_create(Physics2DServer::SHAPE_SEGMENT)) { +SegmentShape2D::SegmentShape2D() : + Shape2D(Physics2DServer::get_singleton()->shape_create(Physics2DServer::SHAPE_SEGMENT)) { a = Vector2(); b = Vector2(0, 10); @@ -145,8 +145,8 @@ real_t RayShape2D::get_length() const { return length; } -RayShape2D::RayShape2D() - : Shape2D(Physics2DServer::get_singleton()->shape_create(Physics2DServer::SHAPE_RAY)) { +RayShape2D::RayShape2D() : + Shape2D(Physics2DServer::get_singleton()->shape_create(Physics2DServer::SHAPE_RAY)) { length = 20; _update_shape(); diff --git a/scene/resources/shader.h b/scene/resources/shader.h index ec0b614fa33..83cb2d48f68 100644 --- a/scene/resources/shader.h +++ b/scene/resources/shader.h @@ -103,8 +103,8 @@ class MaterialShader : public Shader { OBJ_TYPE(MaterialShader, Shader); public: - MaterialShader() - : Shader(MODE_MATERIAL){}; + MaterialShader() : + Shader(MODE_MATERIAL){}; }; class CanvasItemShader : public Shader { @@ -112,8 +112,8 @@ class CanvasItemShader : public Shader { OBJ_TYPE(CanvasItemShader, Shader); public: - CanvasItemShader() - : Shader(MODE_CANVAS_ITEM){}; + CanvasItemShader() : + Shader(MODE_CANVAS_ITEM){}; }; class ResourceFormatLoaderShader : public ResourceFormatLoader { diff --git a/scene/resources/shader_graph.cpp b/scene/resources/shader_graph.cpp index 64f3c1a185c..fe89fbdfa58 100644 --- a/scene/resources/shader_graph.cpp +++ b/scene/resources/shader_graph.cpp @@ -1324,8 +1324,8 @@ void ShaderGraph::node_set_state(ShaderType p_type, int p_id, const Variant &p_s } } -ShaderGraph::ShaderGraph(Mode p_mode) - : Shader(p_mode) { +ShaderGraph::ShaderGraph(Mode p_mode) : + Shader(p_mode) { //shader = VisualServer::get_singleton()->shader_create(); _pending_update_shader = false; diff --git a/scene/resources/shader_graph.h b/scene/resources/shader_graph.h index f7d6b1cf676..8a904f8635c 100644 --- a/scene/resources/shader_graph.h +++ b/scene/resources/shader_graph.h @@ -407,8 +407,8 @@ class MaterialShaderGraph : public ShaderGraph { OBJ_TYPE(MaterialShaderGraph, ShaderGraph); public: - MaterialShaderGraph() - : ShaderGraph(MODE_MATERIAL) { + MaterialShaderGraph() : + ShaderGraph(MODE_MATERIAL) { } }; @@ -417,8 +417,8 @@ class CanvasItemShaderGraph : public ShaderGraph { OBJ_TYPE(CanvasItemShaderGraph, ShaderGraph); public: - CanvasItemShaderGraph() - : ShaderGraph(MODE_CANVAS_ITEM) { + CanvasItemShaderGraph() : + ShaderGraph(MODE_CANVAS_ITEM) { } }; diff --git a/scene/resources/shape_line_2d.cpp b/scene/resources/shape_line_2d.cpp index 28573004741..11124230823 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"), _SCS("set_d"), _SCS("get_d")); } -LineShape2D::LineShape2D() - : Shape2D(Physics2DServer::get_singleton()->shape_create(Physics2DServer::SHAPE_LINE)) { +LineShape2D::LineShape2D() : + Shape2D(Physics2DServer::get_singleton()->shape_create(Physics2DServer::SHAPE_LINE)) { normal = Vector2(0, -1); d = 0; diff --git a/scene/resources/sphere_shape.cpp b/scene/resources/sphere_shape.cpp index d735ead3fbf..e541ba6e214 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"), _SCS("set_radius"), _SCS("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 47f7ee9a419..bdb472e64fc 100644 --- a/scene/resources/tile_set.h +++ b/scene/resources/tile_set.h @@ -57,8 +57,9 @@ class TileSet : public Resource { Ref material; Color modulate; - explicit Data() - : one_way_collision_max_depth(0.0f), modulate(1, 1, 1) {} + explicit Data() : + one_way_collision_max_depth(0.0f), + modulate(1, 1, 1) {} }; Map tile_map; diff --git a/scene/resources/world_2d.cpp b/scene/resources/world_2d.cpp index 39c9b9a46b5..bd72d9f76b3 100644 --- a/scene/resources/world_2d.cpp +++ b/scene/resources/world_2d.cpp @@ -29,7 +29,6 @@ /*************************************************************************/ #include "world_2d.h" #include "globals.h" -#include "globals.h" #include "scene/2d/camera_2d.h" #include "scene/2d/visibility_notifier_2d.h" #include "scene/main/viewport.h" diff --git a/servers/audio/audio_mixer_sw.cpp b/servers/audio/audio_mixer_sw.cpp index 753558579dd..cda2cb172b0 100644 --- a/servers/audio/audio_mixer_sw.cpp +++ b/servers/audio/audio_mixer_sw.cpp @@ -480,7 +480,7 @@ void AudioMixerSW::mix_channel(Channel &c) { rstate.amount = target; rstate.pos = offset; -/* Macros to call the resample function for all possibilities, creating a dedicated-non branchy function call for each thanks to template magic*/ + /* Macros to call the resample function for all possibilities, creating a dedicated-non branchy function call for each thanks to template magic*/ #define CALL_RESAMPLE_FUNC(m_depth, m_stereo, m_ima_adpcm, m_use_filter, m_use_fx, m_interp, m_mode) \ do_resample( \ diff --git a/servers/audio/audio_server_sw.h b/servers/audio/audio_server_sw.h index 77a9ee7374c..4190360d024 100644 --- a/servers/audio/audio_server_sw.h +++ b/servers/audio/audio_server_sw.h @@ -61,8 +61,8 @@ class AudioServerSW : public AudioServer { SelfList active_item; AudioMixer::ChannelID channel; - Voice() - : active_item(this) { + Voice() : + active_item(this) { channel = AudioMixer::INVALID_CHANNEL; active = false; } diff --git a/servers/audio/reverb_sw.cpp b/servers/audio/reverb_sw.cpp index 9cff2096fea..81243b505d9 100644 --- a/servers/audio/reverb_sw.cpp +++ b/servers/audio/reverb_sw.cpp @@ -255,12 +255,10 @@ bool ReverbSW::process(int *p_input, int *p_output, int p_frames, int p_stereo_s 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 ������۲ + // 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 d376cdd0a9f..cc569374429 100644 --- a/servers/physics/area_sw.cpp +++ b/servers/physics/area_sw.cpp @@ -268,8 +268,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 3a853f81f34..ebedfd6e4b8 100644 --- a/servers/physics/body_pair_sw.cpp +++ b/servers/physics/body_pair_sw.cpp @@ -488,8 +488,8 @@ void BodyPairSW::shift_shape_indices(const CollisionObjectSW *p_object, int p_re } } -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 359677fb20a..3037c386fe6 100644 --- a/servers/physics/body_sw.cpp +++ b/servers/physics/body_sw.cpp @@ -699,8 +699,11 @@ void BodySW::set_force_integration_callback(ObjectID p_id, const StringName &p_m } } -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_solver_sat.cpp b/servers/physics/collision_solver_sat.cpp index 67cbd298a6d..99a1d255874 100644 --- a/servers/physics/collision_solver_sat.cpp +++ b/servers/physics/collision_solver_sat.cpp @@ -251,7 +251,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/gjk_epa.cpp b/servers/physics/gjk_epa.cpp index 67cb1d796ed..1c5b78660d7 100644 --- a/servers/physics/gjk_epa.cpp +++ b/servers/physics/gjk_epa.cpp @@ -475,15 +475,18 @@ struct EPA { struct sList { sFace *root; U count; - sList() - : root(0), count(0) {} + sList() : + root(0), + count(0) {} }; struct sHorizon { sFace *cf; sFace *ff; U nf; - sHorizon() - : cf(0), ff(0), nf(0) {} + sHorizon() : + cf(0), + ff(0), + nf(0) {} }; struct eStatus { enum _ { @@ -822,7 +825,7 @@ bool Penetration(const ShapeSW *shape0, return (false); } -/* Symbols cleanup */ + /* Symbols cleanup */ #undef GJK_MAX_ITERATIONS #undef GJK_ACCURARY @@ -840,7 +843,7 @@ bool Penetration(const ShapeSW *shape0, #undef EPA_PLANE_EPS #undef EPA_INSIDE_EPS -} // end of namespace +} // namespace GjkEpa2 bool gjk_epa_calculate_distance(const ShapeSW *p_shape_A, const Transform &p_transform_A, const ShapeSW *p_shape_B, const Transform &p_transform_B, Vector3 &r_result_A, Vector3 &r_result_B) { diff --git a/servers/physics/joints/cone_twist_joint_sw.cpp b/servers/physics/joints/cone_twist_joint_sw.cpp index 48e8dc58c63..35482bd5688 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 dd6410623b9..f5c4b84617f 100644 --- a/servers/physics/joints/generic_6dof_joint_sw.cpp +++ b/servers/physics/joints/generic_6dof_joint_sw.cpp @@ -247,9 +247,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 4d73825928e..a9bc708fd36 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 7de77786eba..3aa480c2b33 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 Matrix3 &world2A, const Matrix3 &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 0085712035b..8c466978ba0 100644 --- a/servers/physics/joints/pin_joint_sw.cpp +++ b/servers/physics/joints/pin_joint_sw.cpp @@ -146,8 +146,8 @@ float 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 c982ac6db79..36776f04118 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 b15ae080492..29581c73370 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 c94c546b0e1..1e7c663c7de 100644 --- a/servers/physics_2d/area_2d_sw.cpp +++ b/servers/physics_2d/area_2d_sw.cpp @@ -269,8 +269,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 dcd9189641e..91dc44d6c21 100644 --- a/servers/physics_2d/body_2d_sw.cpp +++ b/servers/physics_2d/body_2d_sw.cpp @@ -643,8 +643,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 2cacaf209a0..ec1c7e9b5b0 100644 --- a/servers/physics_2d/body_pair_2d_sw.cpp +++ b/servers/physics_2d/body_pair_2d_sw.cpp @@ -418,7 +418,7 @@ bool BodyPair2DSW::setup(float 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 { @@ -516,8 +516,8 @@ void BodyPair2DSW::shift_shape_indices(const CollisionObject2DSW *p_object, int } } -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 2c23acbb7ab..8303e331a40 100644 --- a/servers/physics_2d/joints_2d_sw.cpp +++ b/servers/physics_2d/joints_2d_sw.cpp @@ -292,8 +292,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; @@ -437,8 +437,8 @@ void GrooveJoint2DSW::solve(float 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; @@ -546,8 +546,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 995e54d7e51..b5db3c91298 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 a95c9fecf87..04b15414de0 100644 --- a/servers/physics_2d/physics_2d_server_wrap_mt.cpp +++ b/servers/physics_2d/physics_2d_server_wrap_mt.cpp @@ -150,8 +150,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/visual/rasterizer.h b/servers/visual/rasterizer.h index e1187a2af36..76026765170 100644 --- a/servers/visual/rasterizer.h +++ b/servers/visual/rasterizer.h @@ -118,8 +118,8 @@ protected: return k; } - FixedMaterial() - : dirty_list(this) { + FixedMaterial() : + dirty_list(this) { use_alpha = false; use_color_array = false; diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index 78181dba8eb..0c8861d030f 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -1952,7 +1952,7 @@ Error ShaderLanguage::parse_expression(Parser &parser, Node *p_parent, Node **r_ priority = 2; break; - // shift left/right =2 + // shift left/right =2 case TK_OP_LESS: priority = 4; break; case TK_OP_LESS_EQUAL: priority = 4; break; @@ -1964,16 +1964,16 @@ Error ShaderLanguage::parse_expression(Parser &parser, Node *p_parent, Node **r_ priority = 5; break; - //bit and =5 - //bit xor =6 - //bit or=7 + //bit and =5 + //bit xor =6 + //bit or=7 case TK_OP_AND: priority = 8; break; case TK_OP_OR: priority = 9; break; - // ?: = 10 + // ?: = 10 case TK_OP_ASSIGN_ADD: priority = 11; break; case TK_OP_ASSIGN_SUB: priority = 11; break; diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp index e9d8b086dc8..6a474bfc7b3 100644 --- a/servers/visual/visual_server_raster.cpp +++ b/servers/visual/visual_server_raster.cpp @@ -4606,7 +4606,7 @@ void VisualServerRaster::_light_instance_update_pssm_shadow(Instance *p_light, S distances[i + 1], p_camera->vaspect - ); + ); } break; case Camera::PERSPECTIVE: { @@ -4617,7 +4617,7 @@ void VisualServerRaster::_light_instance_update_pssm_shadow(Instance *p_light, S distances[i + 1], p_camera->vaspect - ); + ); } break; } @@ -5960,7 +5960,7 @@ void VisualServerRaster::_render_camera(Viewport *p_viewport, Camera *p_camera, p_camera->zfar, p_camera->vaspect - ); + ); ortho = true; } break; case Camera::PERSPECTIVE: { @@ -5972,7 +5972,7 @@ void VisualServerRaster::_render_camera(Viewport *p_viewport, Camera *p_camera, p_camera->zfar, p_camera->vaspect - ); + ); ortho = false; } break; diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h index 359f11942bc..ba0ac7d31a9 100644 --- a/servers/visual/visual_server_raster.h +++ b/servers/visual/visual_server_raster.h @@ -511,8 +511,8 @@ class VisualServerRaster : public VisualServer { SelfList update_list; - Viewport() - : update_list(this) { + Viewport() : + update_list(this) { transparent_bg = false; render_target_update_mode = RENDER_TARGET_UPDATE_WHEN_VISIBLE; queue_capture = false; diff --git a/servers/visual/visual_server_wrap_mt.cpp b/servers/visual/visual_server_wrap_mt.cpp index ccb4a01dbc5..b5c64608f46 100644 --- a/servers/visual/visual_server_wrap_mt.cpp +++ b/servers/visual/visual_server_wrap_mt.cpp @@ -166,8 +166,8 @@ void VisualServerWrapMT::finish() { memdelete(draw_mutex); } -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 ea3ab7dac04..46308bc3291 100644 --- a/servers/visual/visual_server_wrap_mt.h +++ b/servers/visual/visual_server_wrap_mt.h @@ -69,7 +69,6 @@ class VisualServerWrapMT : public VisualServer { List mesh_id_pool; //#define DEBUG_SYNC - #ifdef DEBUG_SYNC #define SYNC_DEBUG print_line("sync on: " + String(__FUNCTION__)); #else