summaryrefslogtreecommitdiff
path: root/servers/physics_2d
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 /servers/physics_2d
parent2a38a5eaa844043b846e03d6655f84caf8a31e74 (diff)
Memory pool vectors (DVector) have been enormously simplified in code, and renamed to PoolVector
Diffstat (limited to 'servers/physics_2d')
-rw-r--r--servers/physics_2d/shape_2d_sw.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/servers/physics_2d/shape_2d_sw.cpp b/servers/physics_2d/shape_2d_sw.cpp
index 6506349ead..e9089e6173 100644
--- a/servers/physics_2d/shape_2d_sw.cpp
+++ b/servers/physics_2d/shape_2d_sw.cpp
@@ -693,11 +693,11 @@ void ConvexPolygonShape2DSW::set_data(const Variant& p_data) {
point_count=0;
if (p_data.get_type()==Variant::VECTOR2_ARRAY) {
- DVector<Vector2> arr=p_data;
+ PoolVector<Vector2> arr=p_data;
ERR_FAIL_COND(arr.size()==0);
point_count=arr.size();
points = memnew_arr(Point,point_count);
- DVector<Vector2>::Read r = arr.read();
+ PoolVector<Vector2>::Read r = arr.read();
for(int i=0;i<point_count;i++) {
points[i].pos=r[i];
@@ -711,12 +711,12 @@ void ConvexPolygonShape2DSW::set_data(const Variant& p_data) {
}
} else {
- DVector<real_t> dvr = p_data;
+ PoolVector<real_t> dvr = p_data;
point_count=dvr.size()/4;
ERR_FAIL_COND(point_count==0);
points = memnew_arr(Point,point_count);
- DVector<real_t>::Read r = dvr.read();
+ PoolVector<real_t>::Read r = dvr.read();
for(int i=0;i<point_count;i++) {
@@ -741,7 +741,7 @@ void ConvexPolygonShape2DSW::set_data(const Variant& p_data) {
Variant ConvexPolygonShape2DSW::get_data() const {
- DVector<Vector2> dvr;
+ PoolVector<Vector2> dvr;
dvr.resize(point_count);
@@ -970,7 +970,7 @@ void ConcavePolygonShape2DSW::set_data(const Variant& p_data) {
if (p_data.get_type()==Variant::VECTOR2_ARRAY) {
- DVector<Vector2> p2arr = p_data;
+ PoolVector<Vector2> p2arr = p_data;
int len = p2arr.size();
ERR_FAIL_COND(len%2);
@@ -984,7 +984,7 @@ void ConcavePolygonShape2DSW::set_data(const Variant& p_data) {
return;
}
- DVector<Vector2>::Read arr = p2arr.read();
+ PoolVector<Vector2>::Read arr = p2arr.read();
Map<Point2,int> pointmap;
for(int i=0;i<len;i+=2) {
@@ -1046,17 +1046,17 @@ void ConcavePolygonShape2DSW::set_data(const Variant& p_data) {
Variant ConcavePolygonShape2DSW::get_data() const {
- DVector<Vector2> rsegments;
+ PoolVector<Vector2> rsegments;
int len = segments.size();
rsegments.resize(len*2);
- DVector<Vector2>::Write w = rsegments.write();
+ PoolVector<Vector2>::Write w = rsegments.write();
for(int i=0;i<len;i++) {
w[(i<<1)+0]=points[segments[i].points[0]];
w[(i<<1)+1]=points[segments[i].points[1]];
}
- w=DVector<Vector2>::Write();
+ w=PoolVector<Vector2>::Write();
return rsegments;
}