summaryrefslogtreecommitdiff
path: root/scene/resources/animation.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-01-07 18:25:37 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-01-07 18:26:38 -0300
commit2ab83e1abbf5ee6d00e16056a9e9394114026f28 (patch)
tree7efbb375cc4d00d8e8589fcf1b6a1303bec5df2d /scene/resources/animation.cpp
parent2a38a5eaa844043b846e03d6655f84caf8a31e74 (diff)
Memory pool vectors (DVector) have been enormously simplified in code, and renamed to PoolVector
Diffstat (limited to 'scene/resources/animation.cpp')
-rw-r--r--scene/resources/animation.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp
index b5c438d953..76c6f29bcb 100644
--- a/scene/resources/animation.cpp
+++ b/scene/resources/animation.cpp
@@ -79,14 +79,14 @@ bool Animation::_set(const StringName& p_name, const Variant& p_value) {
if (track_get_type(track)==TYPE_TRANSFORM) {
TransformTrack *tt = static_cast<TransformTrack*>(tracks[track]);
- DVector<float> values=p_value;
+ PoolVector<float> values=p_value;
int vcount=values.size();
#if 0 // old compatibility hack
if ((vcount%11) == 0) {
- DVector<float>::Read r = values.read();
+ PoolVector<float>::Read r = values.read();
tt->transforms.resize(vcount/11);
@@ -121,7 +121,7 @@ bool Animation::_set(const StringName& p_name, const Variant& p_value) {
#endif
ERR_FAIL_COND_V(vcount%12,false); // shuld be multiple of 11
- DVector<float>::Read r = values.read();
+ PoolVector<float>::Read r = values.read();
tt->transforms.resize(vcount/12);
@@ -172,7 +172,7 @@ bool Animation::_set(const StringName& p_name, const Variant& p_value) {
- DVector<float> times=d["times"];
+ PoolVector<float> times=d["times"];
Array values=d["values"];
ERR_FAIL_COND_V(times.size()!=values.size(),false);
@@ -181,7 +181,7 @@ bool Animation::_set(const StringName& p_name, const Variant& p_value) {
int valcount=times.size();
- DVector<float>::Read rt = times.read();
+ PoolVector<float>::Read rt = times.read();
vt->values.resize(valcount);
@@ -193,10 +193,10 @@ bool Animation::_set(const StringName& p_name, const Variant& p_value) {
if (d.has("transitions")) {
- DVector<float> transitions = d["transitions"];
+ PoolVector<float> transitions = d["transitions"];
ERR_FAIL_COND_V(transitions.size()!=valcount,false);
- DVector<float>::Read rtr = transitions.read();
+ PoolVector<float>::Read rtr = transitions.read();
for(int i=0;i<valcount;i++) {
@@ -218,7 +218,7 @@ bool Animation::_set(const StringName& p_name, const Variant& p_value) {
ERR_FAIL_COND_V(!d.has("times"),false);
ERR_FAIL_COND_V(!d.has("values"),false);
- DVector<float> times=d["times"];
+ PoolVector<float> times=d["times"];
Array values=d["values"];
ERR_FAIL_COND_V(times.size()!=values.size(),false);
@@ -227,7 +227,7 @@ bool Animation::_set(const StringName& p_name, const Variant& p_value) {
int valcount=times.size();
- DVector<float>::Read rt = times.read();
+ PoolVector<float>::Read rt = times.read();
for(int i=0;i<valcount;i++) {
@@ -236,10 +236,10 @@ bool Animation::_set(const StringName& p_name, const Variant& p_value) {
if (d.has("transitions")) {
- DVector<float> transitions = d["transitions"];
+ PoolVector<float> transitions = d["transitions"];
ERR_FAIL_COND_V(transitions.size()!=valcount,false);
- DVector<float>::Read rtr = transitions.read();
+ PoolVector<float>::Read rtr = transitions.read();
for(int i=0;i<valcount;i++) {
@@ -297,11 +297,11 @@ bool Animation::_get(const StringName& p_name,Variant &r_ret) const {
if (track_get_type(track)==TYPE_TRANSFORM) {
- DVector<real_t> keys;
+ PoolVector<real_t> keys;
int kk=track_get_key_count(track);
keys.resize(kk*12);
- DVector<real_t>::Write w = keys.write();
+ PoolVector<real_t>::Write w = keys.write();
int idx=0;
for(int i=0;i<track_get_key_count(track);i++) {
@@ -327,7 +327,7 @@ bool Animation::_get(const StringName& p_name,Variant &r_ret) const {
w[idx++]=scale.z;
}
- w = DVector<real_t>::Write();
+ w = PoolVector<real_t>::Write();
r_ret=keys;
return true;
@@ -338,8 +338,8 @@ bool Animation::_get(const StringName& p_name,Variant &r_ret) const {
Dictionary d;
- DVector<float> key_times;
- DVector<float> key_transitions;
+ PoolVector<float> key_times;
+ PoolVector<float> key_transitions;
Array key_values;
int kk=vt->values.size();
@@ -348,8 +348,8 @@ bool Animation::_get(const StringName& p_name,Variant &r_ret) const {
key_transitions.resize(kk);
key_values.resize(kk);
- DVector<float>::Write wti=key_times.write();
- DVector<float>::Write wtr=key_transitions.write();
+ PoolVector<float>::Write wti=key_times.write();
+ PoolVector<float>::Write wtr=key_transitions.write();
int idx=0;
@@ -363,8 +363,8 @@ bool Animation::_get(const StringName& p_name,Variant &r_ret) const {
idx++;
}
- wti=DVector<float>::Write();
- wtr=DVector<float>::Write();
+ wti=PoolVector<float>::Write();
+ wtr=PoolVector<float>::Write();
d["times"]=key_times;
d["transitions"]=key_transitions;
@@ -382,8 +382,8 @@ bool Animation::_get(const StringName& p_name,Variant &r_ret) const {
Dictionary d;
- DVector<float> key_times;
- DVector<float> key_transitions;
+ PoolVector<float> key_times;
+ PoolVector<float> key_transitions;
Array key_values;
int kk=track_get_key_count(track);
@@ -392,8 +392,8 @@ bool Animation::_get(const StringName& p_name,Variant &r_ret) const {
key_transitions.resize(kk);
key_values.resize(kk);
- DVector<float>::Write wti=key_times.write();
- DVector<float>::Write wtr=key_transitions.write();
+ PoolVector<float>::Write wti=key_times.write();
+ PoolVector<float>::Write wtr=key_transitions.write();
int idx=0;
for(int i=0;i<track_get_key_count(track);i++) {
@@ -404,8 +404,8 @@ bool Animation::_get(const StringName& p_name,Variant &r_ret) const {
idx++;
}
- wti=DVector<float>::Write();
- wtr=DVector<float>::Write();
+ wti=PoolVector<float>::Write();
+ wtr=PoolVector<float>::Write();
d["times"]=key_times;
d["transitions"]=key_transitions;