diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-14 14:29:06 +0200 |
|---|---|---|
| committer | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-14 16:54:55 +0200 |
| commit | 07bc4e2f96f8f47991339654ff4ab16acc19d44f (patch) | |
| tree | 43cdc7cfe8239c23065616a931de3769d2db1e86 /scene/animation/animation_node_state_machine.cpp | |
| parent | 0be6d925dc3c6413bce7a3ccb49631b8e4a6e67a (diff) | |
| download | redot-engine-07bc4e2f96f8f47991339654ff4ab16acc19d44f.tar.gz | |
Style: Enforce separation line between function definitions
I couldn't find a tool that enforces it, so I went the manual route:
```
find -name "thirdparty" -prune \
-o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \
-o -name "*.glsl" > files
perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files)
misc/scripts/fix_style.sh -c
```
This adds a newline after all `}` on the first column, unless they
are followed by `#` (typically `#endif`). This leads to having lots
of places with two lines between function/class definitions, but
clang-format then fixes it as we enforce max one line of separation.
This doesn't fix potential occurrences of function definitions which
are indented (e.g. for a helper class defined in a .cpp), but it's
better than nothing. Also can't be made to run easily on CI/hooks so
we'll have to be careful with new code.
Part of #33027.
Diffstat (limited to 'scene/animation/animation_node_state_machine.cpp')
| -rw-r--r-- | scene/animation/animation_node_state_machine.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/scene/animation/animation_node_state_machine.cpp b/scene/animation/animation_node_state_machine.cpp index 4a387772a8..7c4f84b373 100644 --- a/scene/animation/animation_node_state_machine.cpp +++ b/scene/animation/animation_node_state_machine.cpp @@ -150,24 +150,31 @@ void AnimationNodeStateMachinePlayback::start(const StringName &p_state) { start_request = p_state; stop_request = false; } + void AnimationNodeStateMachinePlayback::stop() { stop_request = true; } + bool AnimationNodeStateMachinePlayback::is_playing() const { return playing; } + StringName AnimationNodeStateMachinePlayback::get_current_node() const { return current; } + StringName AnimationNodeStateMachinePlayback::get_blend_from_node() const { return fading_from; } + Vector<StringName> AnimationNodeStateMachinePlayback::get_travel_path() const { return path; } + float AnimationNodeStateMachinePlayback::get_current_play_pos() const { return pos_current; } + float AnimationNodeStateMachinePlayback::get_current_length() const { return len_current; } @@ -605,6 +612,7 @@ void AnimationNodeStateMachine::get_child_nodes(List<ChildNode> *r_child_nodes) bool AnimationNodeStateMachine::has_node(const StringName &p_name) const { return states.has(p_name); } + void AnimationNodeStateMachine::remove_node(const StringName &p_name) { ERR_FAIL_COND(!states.has(p_name)); @@ -728,10 +736,12 @@ Ref<AnimationNodeStateMachineTransition> AnimationNodeStateMachine::get_transiti ERR_FAIL_INDEX_V(p_transition, transitions.size(), Ref<AnimationNodeStateMachineTransition>()); return transitions[p_transition].transition; } + StringName AnimationNodeStateMachine::get_transition_from(int p_transition) const { ERR_FAIL_INDEX_V(p_transition, transitions.size(), StringName()); return transitions[p_transition].from; } + StringName AnimationNodeStateMachine::get_transition_to(int p_transition) const { ERR_FAIL_INDEX_V(p_transition, transitions.size(), StringName()); return transitions[p_transition].to; @@ -740,6 +750,7 @@ StringName AnimationNodeStateMachine::get_transition_to(int p_transition) const int AnimationNodeStateMachine::get_transition_count() const { return transitions.size(); } + void AnimationNodeStateMachine::remove_transition(const StringName &p_from, const StringName &p_to) { for (int i = 0; i < transitions.size(); i++) { if (transitions[i].from == p_from && transitions[i].to == p_to) { @@ -893,6 +904,7 @@ bool AnimationNodeStateMachine::_get(const StringName &p_name, Variant &r_ret) c return false; } + void AnimationNodeStateMachine::_get_property_list(List<PropertyInfo> *p_list) const { List<StringName> names; for (Map<StringName, State>::Element *E = states.front(); E; E = E->next()) { |
