diff options
Diffstat (limited to 'scene/animation')
-rw-r--r-- | scene/animation/animation_blend_space_1d.cpp | 8 | ||||
-rw-r--r-- | scene/animation/animation_blend_space_2d.cpp | 14 | ||||
-rw-r--r-- | scene/animation/animation_blend_tree.cpp | 10 | ||||
-rw-r--r-- | scene/animation/animation_node_state_machine.cpp | 14 | ||||
-rw-r--r-- | scene/animation/animation_player.cpp | 13 | ||||
-rw-r--r-- | scene/animation/animation_tree.cpp | 8 | ||||
-rw-r--r-- | scene/animation/tween.cpp | 14 |
7 files changed, 46 insertions, 35 deletions
diff --git a/scene/animation/animation_blend_space_1d.cpp b/scene/animation/animation_blend_space_1d.cpp index 3818c7edd1..6e5d964b76 100644 --- a/scene/animation/animation_blend_space_1d.cpp +++ b/scene/animation/animation_blend_space_1d.cpp @@ -54,7 +54,7 @@ void AnimationNodeBlendSpace1D::_validate_property(PropertyInfo &property) const } void AnimationNodeBlendSpace1D::_tree_changed() { - emit_signal("tree_changed"); + emit_signal(SNAME("tree_changed")); } void AnimationNodeBlendSpace1D::_bind_methods() { @@ -120,7 +120,7 @@ void AnimationNodeBlendSpace1D::add_blend_point(const Ref<AnimationRootNode> &p_ blend_points[p_at_index].node->connect("tree_changed", callable_mp(this, &AnimationNodeBlendSpace1D::_tree_changed), varray(), CONNECT_REFERENCE_COUNTED); blend_points_used++; - emit_signal("tree_changed"); + emit_signal(SNAME("tree_changed")); } void AnimationNodeBlendSpace1D::set_blend_point_position(int p_point, float p_position) { @@ -140,7 +140,7 @@ void AnimationNodeBlendSpace1D::set_blend_point_node(int p_point, const Ref<Anim blend_points[p_point].node = p_node; blend_points[p_point].node->connect("tree_changed", callable_mp(this, &AnimationNodeBlendSpace1D::_tree_changed), varray(), CONNECT_REFERENCE_COUNTED); - emit_signal("tree_changed"); + emit_signal(SNAME("tree_changed")); } float AnimationNodeBlendSpace1D::get_blend_point_position(int p_point) const { @@ -164,7 +164,7 @@ void AnimationNodeBlendSpace1D::remove_blend_point(int p_point) { } blend_points_used--; - emit_signal("tree_changed"); + emit_signal(SNAME("tree_changed")); } int AnimationNodeBlendSpace1D::get_blend_point_count() const { diff --git a/scene/animation/animation_blend_space_2d.cpp b/scene/animation/animation_blend_space_2d.cpp index 0871423fbd..6878cbaa12 100644 --- a/scene/animation/animation_blend_space_2d.cpp +++ b/scene/animation/animation_blend_space_2d.cpp @@ -84,7 +84,7 @@ void AnimationNodeBlendSpace2D::add_blend_point(const Ref<AnimationRootNode> &p_ _queue_auto_triangles(); - emit_signal("tree_changed"); + emit_signal(SNAME("tree_changed")); } void AnimationNodeBlendSpace2D::set_blend_point_position(int p_point, const Vector2 &p_position) { @@ -103,7 +103,7 @@ void AnimationNodeBlendSpace2D::set_blend_point_node(int p_point, const Ref<Anim blend_points[p_point].node = p_node; blend_points[p_point].node->connect("tree_changed", callable_mp(this, &AnimationNodeBlendSpace2D::_tree_changed), varray(), CONNECT_REFERENCE_COUNTED); - emit_signal("tree_changed"); + emit_signal(SNAME("tree_changed")); } Vector2 AnimationNodeBlendSpace2D::get_blend_point_position(int p_point) const { @@ -143,7 +143,7 @@ void AnimationNodeBlendSpace2D::remove_blend_point(int p_point) { blend_points[i] = blend_points[i + 1]; } blend_points_used--; - emit_signal("tree_changed"); + emit_signal(SNAME("tree_changed")); } int AnimationNodeBlendSpace2D::get_blend_point_count() const { @@ -321,7 +321,7 @@ void AnimationNodeBlendSpace2D::_queue_auto_triangles() { } trianges_dirty = true; - call_deferred("_update_triangles"); + call_deferred(SNAME("_update_triangles")); } void AnimationNodeBlendSpace2D::_update_triangles() { @@ -332,7 +332,7 @@ void AnimationNodeBlendSpace2D::_update_triangles() { trianges_dirty = false; triangles.clear(); if (blend_points_used < 3) { - emit_signal("triangles_updated"); + emit_signal(SNAME("triangles_updated")); return; } @@ -347,7 +347,7 @@ void AnimationNodeBlendSpace2D::_update_triangles() { for (int i = 0; i < triangles.size(); i++) { add_triangle(triangles[i].points[0], triangles[i].points[1], triangles[i].points[2]); } - emit_signal("triangles_updated"); + emit_signal(SNAME("triangles_updated")); } Vector2 AnimationNodeBlendSpace2D::get_closest_point(const Vector2 &p_point) { @@ -586,7 +586,7 @@ Ref<AnimationNode> AnimationNodeBlendSpace2D::get_child_by_name(const StringName } void AnimationNodeBlendSpace2D::_tree_changed() { - emit_signal("tree_changed"); + emit_signal(SNAME("tree_changed")); } void AnimationNodeBlendSpace2D::set_blend_mode(BlendMode p_blend_mode) { diff --git a/scene/animation/animation_blend_tree.cpp b/scene/animation/animation_blend_tree.cpp index 6a988042b5..200a688067 100644 --- a/scene/animation/animation_blend_tree.cpp +++ b/scene/animation/animation_blend_tree.cpp @@ -816,7 +816,7 @@ void AnimationNodeBlendTree::add_node(const StringName &p_name, Ref<AnimationNod nodes[p_name] = n; emit_changed(); - emit_signal("tree_changed"); + emit_signal(SNAME("tree_changed")); p_node->connect("tree_changed", callable_mp(this, &AnimationNodeBlendTree::_tree_changed), varray(), CONNECT_REFERENCE_COUNTED); p_node->connect("changed", callable_mp(this, &AnimationNodeBlendTree::_node_changed), varray(p_name), CONNECT_REFERENCE_COUNTED); @@ -896,7 +896,7 @@ void AnimationNodeBlendTree::remove_node(const StringName &p_name) { } emit_changed(); - emit_signal("tree_changed"); + emit_signal(SNAME("tree_changed")); } void AnimationNodeBlendTree::rename_node(const StringName &p_name, const StringName &p_new_name) { @@ -921,7 +921,7 @@ void AnimationNodeBlendTree::rename_node(const StringName &p_name, const StringN //connection must be done with new name nodes[p_new_name].node->connect("changed", callable_mp(this, &AnimationNodeBlendTree::_node_changed), varray(p_new_name), CONNECT_REFERENCE_COUNTED); - emit_signal("tree_changed"); + emit_signal(SNAME("tree_changed")); } void AnimationNodeBlendTree::connect_node(const StringName &p_input_node, int p_input_index, const StringName &p_output_node) { @@ -1125,11 +1125,11 @@ void AnimationNodeBlendTree::reset_state() { graph_offset = Vector2(); nodes.clear(); emit_changed(); - emit_signal("tree_changed"); + emit_signal(SNAME("tree_changed")); } void AnimationNodeBlendTree::_tree_changed() { - emit_signal("tree_changed"); + emit_signal(SNAME("tree_changed")); } void AnimationNodeBlendTree::_node_changed(const StringName &p_node) { diff --git a/scene/animation/animation_node_state_machine.cpp b/scene/animation/animation_node_state_machine.cpp index f494f5c163..6496331cb0 100644 --- a/scene/animation/animation_node_state_machine.cpp +++ b/scene/animation/animation_node_state_machine.cpp @@ -57,7 +57,7 @@ void AnimationNodeStateMachineTransition::set_advance_condition(const StringName } else { advance_condition_name = StringName(); } - emit_signal("advance_condition_changed"); + emit_signal(SNAME("advance_condition_changed")); } StringName AnimationNodeStateMachineTransition::get_advance_condition() const { @@ -539,7 +539,7 @@ void AnimationNodeStateMachine::add_node(const StringName &p_name, Ref<Animation states[p_name] = state; emit_changed(); - emit_signal("tree_changed"); + emit_signal(SNAME("tree_changed")); p_node->connect("tree_changed", callable_mp(this, &AnimationNodeStateMachine::_tree_changed), varray(), CONNECT_REFERENCE_COUNTED); } @@ -559,7 +559,7 @@ void AnimationNodeStateMachine::replace_node(const StringName &p_name, Ref<Anima states[p_name].node = p_node; emit_changed(); - emit_signal("tree_changed"); + emit_signal(SNAME("tree_changed")); p_node->connect("tree_changed", callable_mp(this, &AnimationNodeStateMachine::_tree_changed), varray(), CONNECT_REFERENCE_COUNTED); } @@ -636,7 +636,7 @@ void AnimationNodeStateMachine::remove_node(const StringName &p_name) { }*/ emit_changed(); - emit_signal("tree_changed"); + emit_signal(SNAME("tree_changed")); } void AnimationNodeStateMachine::rename_node(const StringName &p_name, const StringName &p_new_name) { @@ -669,7 +669,7 @@ void AnimationNodeStateMachine::rename_node(const StringName &p_name, const Stri }*/ //path.clear(); //clear path - emit_signal("tree_changed"); + emit_signal(SNAME("tree_changed")); } void AnimationNodeStateMachine::get_node_list(List<StringName> *r_nodes) const { @@ -923,7 +923,7 @@ void AnimationNodeStateMachine::reset_state() { graph_offset = Vector2(); emit_changed(); - emit_signal("tree_changed"); + emit_signal(SNAME("tree_changed")); } void AnimationNodeStateMachine::set_node_position(const StringName &p_name, const Vector2 &p_position) { @@ -937,7 +937,7 @@ Vector2 AnimationNodeStateMachine::get_node_position(const StringName &p_name) c } void AnimationNodeStateMachine::_tree_changed() { - emit_signal("tree_changed"); + emit_signal(SNAME("tree_changed")); } void AnimationNodeStateMachine::_bind_methods() { diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index 6154eef3cf..14ca325c25 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -557,6 +557,7 @@ void AnimationPlayer::_animation_process_animation(AnimationData *p_anim, float } #endif + static_assert(VARIANT_ARG_MAX == 8, "This code needs to be updated if VARIANT_ARG_MAX != 8"); if (can_call) { if (method_call_mode == ANIMATION_METHOD_CALL_DEFERRED) { MessageQueue::get_singleton()->push_call( @@ -566,7 +567,10 @@ void AnimationPlayer::_animation_process_animation(AnimationData *p_anim, float s >= 2 ? params[1] : Variant(), s >= 3 ? params[2] : Variant(), s >= 4 ? params[3] : Variant(), - s >= 5 ? params[4] : Variant()); + s >= 5 ? params[4] : Variant(), + s >= 6 ? params[5] : Variant(), + s >= 7 ? params[6] : Variant(), + s >= 8 ? params[7] : Variant()); } else { nc->node->call( method, @@ -574,7 +578,10 @@ void AnimationPlayer::_animation_process_animation(AnimationData *p_anim, float s >= 2 ? params[1] : Variant(), s >= 3 ? params[2] : Variant(), s >= 4 ? params[3] : Variant(), - s >= 5 ? params[4] : Variant()); + s >= 5 ? params[4] : Variant(), + s >= 6 ? params[5] : Variant(), + s >= 7 ? params[6] : Variant(), + s >= 8 ? params[7] : Variant()); } } } @@ -1325,7 +1332,7 @@ float AnimationPlayer::get_current_animation_length() const { void AnimationPlayer::_animation_changed() { clear_caches(); - emit_signal("caches_cleared"); + emit_signal(SNAME("caches_cleared")); if (is_playing()) { playback.seeked = true; //need to restart stuff, like audio } diff --git a/scene/animation/animation_tree.cpp b/scene/animation/animation_tree.cpp index 1e07f83d09..72448fc4f7 100644 --- a/scene/animation/animation_tree.cpp +++ b/scene/animation/animation_tree.cpp @@ -985,6 +985,7 @@ void AnimationTree::_process_graph(float p_delta) { int s = params.size(); + static_assert(VARIANT_ARG_MAX == 8, "This code needs to be updated if VARIANT_ARG_MAX != 8"); ERR_CONTINUE(s > VARIANT_ARG_MAX); if (can_call) { t->object->call_deferred( @@ -993,7 +994,10 @@ void AnimationTree::_process_graph(float p_delta) { s >= 2 ? params[1] : Variant(), s >= 3 ? params[2] : Variant(), s >= 4 ? params[3] : Variant(), - s >= 5 ? params[4] : Variant()); + s >= 5 ? params[4] : Variant(), + s >= 6 ? params[5] : Variant(), + s >= 7 ? params[6] : Variant(), + s >= 8 ? params[7] : Variant()); } } @@ -1327,7 +1331,7 @@ void AnimationTree::_tree_changed() { return; } - call_deferred("_update_properties"); + call_deferred(SNAME("_update_properties")); properties_dirty = true; } diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp index 7bf616e602..761046c14a 100644 --- a/scene/animation/tween.cpp +++ b/scene/animation/tween.cpp @@ -264,7 +264,7 @@ bool Tween::step(float p_delta) { rem_delta = step_delta; if (!step_active) { - emit_signal("step_finished", current_step); + emit_signal(SNAME("step_finished"), current_step); current_step++; if (current_step == tweeners.size()) { @@ -272,9 +272,9 @@ bool Tween::step(float p_delta) { if (loops_done == loops) { running = false; dead = true; - emit_signal("finished"); + emit_signal(SNAME("finished")); } else { - emit_signal("loop_finished", loops_done); + emit_signal(SNAME("loop_finished"), loops_done); current_step = 0; start_tweeners(); } @@ -690,7 +690,7 @@ bool PropertyTweener::step(float &r_delta) { } else { finished = true; r_delta = elapsed_time - delay - duration; - emit_signal("finished"); + emit_signal(SNAME("finished")); return false; } } @@ -745,7 +745,7 @@ bool IntervalTweener::step(float &r_delta) { } else { finished = true; r_delta = elapsed_time - duration; - emit_signal("finished"); + emit_signal(SNAME("finished")); return false; } } @@ -784,7 +784,7 @@ bool CallbackTweener::step(float &r_delta) { finished = true; r_delta = elapsed_time - delay; - emit_signal("finished"); + emit_signal(SNAME("finished")); return false; } @@ -854,7 +854,7 @@ bool MethodTweener::step(float &r_delta) { } else { finished = true; r_delta = elapsed_time - delay - duration; - emit_signal("finished"); + emit_signal(SNAME("finished")); return false; } } |