diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-01-07 18:25:37 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-01-07 18:26:38 -0300 |
commit | 2ab83e1abbf5ee6d00e16056a9e9394114026f28 (patch) | |
tree | 7efbb375cc4d00d8e8589fcf1b6a1303bec5df2d /scene/resources/multimesh.cpp | |
parent | 2a38a5eaa844043b846e03d6655f84caf8a31e74 (diff) | |
download | redot-engine-2ab83e1abbf5ee6d00e16056a9e9394114026f28.tar.gz |
Memory pool vectors (DVector) have been enormously simplified in code, and renamed to PoolVector
Diffstat (limited to 'scene/resources/multimesh.cpp')
-rw-r--r-- | scene/resources/multimesh.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/scene/resources/multimesh.cpp b/scene/resources/multimesh.cpp index 802f58e8ca..143870c920 100644 --- a/scene/resources/multimesh.cpp +++ b/scene/resources/multimesh.cpp @@ -31,17 +31,17 @@ -void MultiMesh::_set_transform_array(const DVector<Vector3>& p_array) { +void MultiMesh::_set_transform_array(const PoolVector<Vector3>& p_array) { int instance_count = get_instance_count(); - DVector<Vector3> xforms = p_array; + PoolVector<Vector3> xforms = p_array; int len=xforms.size(); ERR_FAIL_COND((len/4) != instance_count); if (len==0) return; - DVector<Vector3>::Read r = xforms.read(); + PoolVector<Vector3>::Read r = xforms.read(); for(int i=0;i<len/4;i++) { @@ -56,17 +56,17 @@ void MultiMesh::_set_transform_array(const DVector<Vector3>& p_array) { } -DVector<Vector3> MultiMesh::_get_transform_array() const { +PoolVector<Vector3> MultiMesh::_get_transform_array() const { int instance_count = get_instance_count(); if (instance_count==0) - return DVector<Vector3>(); + return PoolVector<Vector3>(); - DVector<Vector3> xforms; + PoolVector<Vector3> xforms; xforms.resize(instance_count*4); - DVector<Vector3>::Write w = xforms.write(); + PoolVector<Vector3>::Write w = xforms.write(); for(int i=0;i<instance_count;i++) { @@ -82,17 +82,17 @@ DVector<Vector3> MultiMesh::_get_transform_array() const { } -void MultiMesh::_set_color_array(const DVector<Color>& p_array) { +void MultiMesh::_set_color_array(const PoolVector<Color>& p_array) { int instance_count = get_instance_count(); - DVector<Color> colors = p_array; + PoolVector<Color> colors = p_array; int len=colors.size(); ERR_FAIL_COND(len != instance_count); if (len==0) return; - DVector<Color>::Read r = colors.read(); + PoolVector<Color>::Read r = colors.read(); for(int i=0;i<len;i++) { @@ -101,14 +101,14 @@ void MultiMesh::_set_color_array(const DVector<Color>& p_array) { } -DVector<Color> MultiMesh::_get_color_array() const { +PoolVector<Color> MultiMesh::_get_color_array() const { int instance_count = get_instance_count(); if (instance_count==0) - return DVector<Color>(); + return PoolVector<Color>(); - DVector<Color> colors; + PoolVector<Color> colors; colors.resize(instance_count); for(int i=0;i<instance_count;i++) { |