From 0be6d925dc3c6413bce7a3ccb49631b8e4a6e67a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 14 May 2020 13:23:58 +0200 Subject: Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027. --- scene/animation/animation_player.h | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'scene/animation/animation_player.h') diff --git a/scene/animation/animation_player.h b/scene/animation/animation_player.h index d709082f62..c7b3d7fc7b 100644 --- a/scene/animation/animation_player.h +++ b/scene/animation/animation_player.h @@ -85,7 +85,6 @@ private: }; struct TrackNodeCache { - NodePath path; uint32_t id = 0; RES resource; @@ -108,7 +107,6 @@ private: bool animation_playing = false; struct PropertyAnim { - TrackNodeCache *owner = nullptr; SpecialProperty special = SP_NONE; //small optimization Vector subpath; @@ -123,7 +121,6 @@ private: Map property_anim; struct BezierAnim { - Vector bezier_property; TrackNodeCache *owner = nullptr; float bezier_accum = 0.0; @@ -139,12 +136,10 @@ private: }; struct TrackNodeCacheKey { - ObjectID id; int bone_idx; inline bool operator<(const TrackNodeCacheKey &p_right) const { - if (id == p_right.id) return bone_idx < p_right.bone_idx; else @@ -175,7 +170,6 @@ private: Map animation_set; struct BlendKey { - StringName from; StringName to; bool operator<(const BlendKey &bk) const { return from == bk.from ? String(to) < String(bk.to) : String(from) < String(bk.from); } @@ -184,13 +178,11 @@ private: Map blend_times; struct PlaybackData { - AnimationData *from; float pos; float speed_scale; PlaybackData() { - pos = 0; speed_scale = 1.0; from = nullptr; @@ -198,21 +190,18 @@ private: }; struct Blend { - PlaybackData data; float blend_time; float blend_left; Blend() { - blend_left = 0; blend_time = 0; } }; struct Playback { - List blend; PlaybackData current; StringName assigned; @@ -246,12 +235,10 @@ private: // bind helpers Vector _get_animation_list() const { - List animations; get_animation_list(&animations); Vector ret; while (animations.size()) { - ret.push_back(animations.front()->get()); animations.pop_front(); } -- cgit v1.2.3 From 0ee0fa42e6639b6fa474b7cf6afc6b1a78142185 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 14 May 2020 16:41:43 +0200 Subject: Style: Enforce braces around if blocks and loops Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html --- scene/animation/animation_player.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scene/animation/animation_player.h') diff --git a/scene/animation/animation_player.h b/scene/animation/animation_player.h index c7b3d7fc7b..1a66665803 100644 --- a/scene/animation/animation_player.h +++ b/scene/animation/animation_player.h @@ -140,10 +140,11 @@ private: int bone_idx; inline bool operator<(const TrackNodeCacheKey &p_right) const { - if (id == p_right.id) + if (id == p_right.id) { return bone_idx < p_right.bone_idx; - else + } else { return id < p_right.id; + } } }; -- cgit v1.2.3