summaryrefslogtreecommitdiff
path: root/scene/animation
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-01-25 14:52:40 -0300
committerGitHub <noreply@github.com>2017-01-25 14:52:40 -0300
commit4c28f35b2c6dacd30a0e10453af1bcd977de9342 (patch)
tree8d843a57b0a49a6bc09a799a5fc7bdb3540b944b /scene/animation
parent7e1afeafd4a347c309562c6783119f64e99fc317 (diff)
parent7dbb1c0571c0d1fb26c28552b09430807cc4d717 (diff)
Merge pull request #7002 from RandomShaper/vcs-friendliness
Greater VCS friendliness
Diffstat (limited to 'scene/animation')
-rw-r--r--scene/animation/animation_player.cpp19
-rw-r--r--scene/animation/animation_player.h2
2 files changed, 12 insertions, 9 deletions
diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp
index 958b065881..e02b2b2b41 100644
--- a/scene/animation/animation_player.cpp
+++ b/scene/animation/animation_player.cpp
@@ -118,17 +118,20 @@ bool AnimationPlayer::_get(const StringName& p_name,Variant &r_ret) const {
} else if (name=="blend_times") {
- Array array;
-
- array.resize(blend_times.size()*3);
- int idx=0;
+ Vector<BlendKey> keys;
for(Map<BlendKey, float >::Element *E=blend_times.front();E;E=E->next()) {
- array.set(idx*3+0,E->key().from);
- array.set(idx*3+1,E->key().to);
- array.set(idx*3+2,E->get());
- idx++;
+ keys.ordered_insert(E->key());
}
+
+ Array array;
+ for(int i=0;i<keys.size();i++) {
+
+ array.push_back(keys[i].from);
+ array.push_back(keys[i].to);
+ array.push_back(blend_times[keys[i]]);
+ }
+
r_ret=array;
} else if (name=="autoplay") {
r_ret=autoplay;
diff --git a/scene/animation/animation_player.h b/scene/animation/animation_player.h
index 41bae6c928..7fab651213 100644
--- a/scene/animation/animation_player.h
+++ b/scene/animation/animation_player.h
@@ -142,7 +142,7 @@ private:
StringName from;
StringName to;
- bool operator<(const BlendKey& bk) const { return from==bk.from?to<bk.to:from<bk.from; }
+ bool operator<(const BlendKey& bk) const { return from==bk.from?String(to)<String(bk.to):String(from)<String(bk.from); }
};