aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Grams2016-03-07 17:21:07 -0500
committerRémi Verschelde2016-04-02 21:59:07 +0200
commit60e4cfbcb78b158ea366dab2e36fa08509d93355 (patch)
tree2bb4def090a896c25542ef80bc2fb8640dd05567
parent656aa0a501309af374a8a42dc7e01be41fab0d85 (diff)
downloadgodot-60e4cfbcb78b158ea366dab2e36fa08509d93355.tar.gz
godot-60e4cfbcb78b158ea366dab2e36fa08509d93355.tar.zst
godot-60e4cfbcb78b158ea366dab2e36fa08509d93355.zip
TimeScale node: scale return value (time remaining).
(cherry picked from commit 2e1b1234a339e5aa651b6462fe03461c65c98bc4)
-rw-r--r--scene/animation/animation_tree_player.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/scene/animation/animation_tree_player.cpp b/scene/animation/animation_tree_player.cpp
index b07611b31..67c7eae1b 100644
--- a/scene/animation/animation_tree_player.cpp
+++ b/scene/animation/animation_tree_player.cpp
@@ -637,10 +637,12 @@ float AnimationTreePlayer::_process_node(const StringName& p_node,AnimationNode
} break;
case NODE_TIMESCALE: {
TimeScaleNode *tsn = static_cast<TimeScaleNode*>(nb);
+ float rem;
if (p_seek)
- return _process_node(tsn->inputs[0].node,r_prev_anim,p_weight,p_time,switched,true,p_filter,p_reverse_weight);
+ rem = _process_node(tsn->inputs[0].node,r_prev_anim,p_weight,p_time,switched,true,p_filter,p_reverse_weight);
else
- return _process_node(tsn->inputs[0].node,r_prev_anim,p_weight,p_time*tsn->scale,switched,false,p_filter,p_reverse_weight);
+ rem = _process_node(tsn->inputs[0].node,r_prev_anim,p_weight,p_time*tsn->scale,switched,false,p_filter,p_reverse_weight);
+ return rem / tsn->scale;
} break;
case NODE_TIMESEEK: {