summaryrefslogtreecommitdiff
path: root/scene/animation
diff options
context:
space:
mode:
Diffstat (limited to 'scene/animation')
-rw-r--r--scene/animation/animation_blend_tree.cpp4
-rw-r--r--scene/animation/animation_node_state_machine.cpp6
-rw-r--r--scene/animation/animation_player.cpp8
-rw-r--r--scene/animation/animation_tree.cpp8
4 files changed, 13 insertions, 13 deletions
diff --git a/scene/animation/animation_blend_tree.cpp b/scene/animation/animation_blend_tree.cpp
index 495f60d4c9..4bddae3b14 100644
--- a/scene/animation/animation_blend_tree.cpp
+++ b/scene/animation/animation_blend_tree.cpp
@@ -1089,7 +1089,7 @@ bool AnimationNodeBlendTree::_get(const StringName &p_name, Variant &r_ret) cons
conns.resize(nc.size() * 3);
int idx = 0;
- for (NodeConnection &E : nc) {
+ for (const NodeConnection &E : nc) {
conns[idx * 3 + 0] = E.input_node;
conns[idx * 3 + 1] = E.input_index;
conns[idx * 3 + 2] = E.output_node;
@@ -1110,7 +1110,7 @@ void AnimationNodeBlendTree::_get_property_list(List<PropertyInfo> *p_list) cons
}
names.sort_custom<StringName::AlphCompare>();
- for (StringName &E : names) {
+ for (const StringName &E : names) {
String name = E;
if (name != "output") {
p_list->push_back(PropertyInfo(Variant::OBJECT, "nodes/" + name + "/node", PROPERTY_HINT_RESOURCE_TYPE, "AnimationNode", PROPERTY_USAGE_NOEDITOR));
diff --git a/scene/animation/animation_node_state_machine.cpp b/scene/animation/animation_node_state_machine.cpp
index 383d92d37f..bf53b554bf 100644
--- a/scene/animation/animation_node_state_machine.cpp
+++ b/scene/animation/animation_node_state_machine.cpp
@@ -512,7 +512,7 @@ void AnimationNodeStateMachine::get_parameter_list(List<PropertyInfo> *r_list) c
}
advance_conditions.sort_custom<StringName::AlphCompare>();
- for (StringName &E : advance_conditions) {
+ for (const StringName &E : advance_conditions) {
r_list->push_back(PropertyInfo(Variant::BOOL, E));
}
}
@@ -679,7 +679,7 @@ void AnimationNodeStateMachine::get_node_list(List<StringName> *r_nodes) const {
}
nodes.sort_custom<StringName::AlphCompare>();
- for (StringName &E : nodes) {
+ for (const StringName &E : nodes) {
r_nodes->push_back(E);
}
}
@@ -902,7 +902,7 @@ void AnimationNodeStateMachine::_get_property_list(List<PropertyInfo> *p_list) c
}
names.sort_custom<StringName::AlphCompare>();
- for (StringName &name : names) {
+ for (const StringName &name : names) {
p_list->push_back(PropertyInfo(Variant::OBJECT, "states/" + name + "/node", PROPERTY_HINT_RESOURCE_TYPE, "AnimationNode", PROPERTY_USAGE_NOEDITOR));
p_list->push_back(PropertyInfo(Variant::VECTOR2, "states/" + name + "/position", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR));
}
diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp
index 0f557519b2..67b6205a65 100644
--- a/scene/animation/animation_player.cpp
+++ b/scene/animation/animation_player.cpp
@@ -176,7 +176,7 @@ void AnimationPlayer::_get_property_list(List<PropertyInfo> *p_list) const {
anim_names.sort();
- for (PropertyInfo &E : anim_names) {
+ for (const PropertyInfo &E : anim_names) {
p_list->push_back(E);
}
@@ -1076,7 +1076,7 @@ void AnimationPlayer::get_animation_list(List<StringName> *p_animations) const {
anims.sort();
- for (String &E : anims) {
+ for (const String &E : anims) {
p_animations->push_back(E);
}
}
@@ -1118,7 +1118,7 @@ void AnimationPlayer::queue(const StringName &p_name) {
Vector<String> AnimationPlayer::get_queue() {
Vector<String> ret;
- for (StringName &E : queued) {
+ for (const StringName &E : queued) {
ret.push_back(E);
}
@@ -1502,7 +1502,7 @@ void AnimationPlayer::get_argument_options(const StringName &p_function, int p_i
if (p_idx == 0 && (p_function == "play" || p_function == "play_backwards" || p_function == "remove_animation" || p_function == "has_animation" || p_function == "queue")) {
List<StringName> al;
get_animation_list(&al);
- for (StringName &E : al) {
+ for (const StringName &E : al) {
r_options->push_back(quote_style + String(E) + quote_style);
}
}
diff --git a/scene/animation/animation_tree.cpp b/scene/animation/animation_tree.cpp
index d277808e1f..00b847168d 100644
--- a/scene/animation/animation_tree.cpp
+++ b/scene/animation/animation_tree.cpp
@@ -76,7 +76,7 @@ void AnimationNode::get_child_nodes(List<ChildNode> *r_child_nodes) {
Dictionary cn = get_script_instance()->call("_get_child_nodes");
List<Variant> keys;
cn.get_key_list(&keys);
- for (Variant &E : keys) {
+ for (const Variant &E : keys) {
ChildNode child;
child.name = E;
child.node = cn[E];
@@ -536,7 +536,7 @@ bool AnimationTree::_update_caches(AnimationPlayer *player) {
List<StringName> sname;
player->get_animation_list(&sname);
- for (StringName &E : sname) {
+ for (const StringName &E : sname) {
Ref<Animation> anim = player->get_animation(E);
for (int i = 0; i < anim->get_track_count(); i++) {
NodePath path = anim->track_get_path(i);
@@ -816,7 +816,7 @@ void AnimationTree::_process_graph(float p_delta) {
{
bool can_call = is_inside_tree() && !Engine::get_singleton()->is_editor_hint();
- for (AnimationNode::AnimationState &as : state.animation_states) {
+ for (const AnimationNode::AnimationState &as : state.animation_states) {
Ref<Animation> a = as.animation;
float time = as.time;
float delta = as.delta;
@@ -1369,7 +1369,7 @@ void AnimationTree::_update_properties_for_node(const String &p_base_path, Ref<A
List<AnimationNode::ChildNode> children;
node->get_child_nodes(&children);
- for (AnimationNode::ChildNode &E : children) {
+ for (const AnimationNode::ChildNode &E : children) {
_update_properties_for_node(p_base_path + E.name + "/", E.node);
}
}