PoolVector is gone, replaced by Vector
Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector<Type>`.
This commit is contained in:
parent
fb8c93c10b
commit
3205a92ad8
406 changed files with 5314 additions and 8271 deletions
|
|
@ -415,7 +415,7 @@ void PolygonPathFinder::_set_data(const Dictionary &p_data) {
|
|||
ERR_FAIL_COND(!p_data.has("segments"));
|
||||
ERR_FAIL_COND(!p_data.has("bounds"));
|
||||
|
||||
PoolVector<Vector2> p = p_data["points"];
|
||||
Vector<Vector2> p = p_data["points"];
|
||||
Array c = p_data["connections"];
|
||||
|
||||
ERR_FAIL_COND(c.size() != p.size());
|
||||
|
|
@ -425,11 +425,11 @@ void PolygonPathFinder::_set_data(const Dictionary &p_data) {
|
|||
int pc = p.size();
|
||||
points.resize(pc + 2);
|
||||
|
||||
PoolVector<Vector2>::Read pr = p.read();
|
||||
const Vector2 *pr = p.ptr();
|
||||
for (int i = 0; i < pc; i++) {
|
||||
points.write[i].pos = pr[i];
|
||||
PoolVector<int> con = c[i];
|
||||
PoolVector<int>::Read cr = con.read();
|
||||
Vector<int> con = c[i];
|
||||
const int *cr = con.ptr();
|
||||
int cc = con.size();
|
||||
for (int j = 0; j < cc; j++) {
|
||||
|
||||
|
|
@ -439,19 +439,19 @@ void PolygonPathFinder::_set_data(const Dictionary &p_data) {
|
|||
|
||||
if (p_data.has("penalties")) {
|
||||
|
||||
PoolVector<float> penalties = p_data["penalties"];
|
||||
Vector<float> penalties = p_data["penalties"];
|
||||
if (penalties.size() == pc) {
|
||||
PoolVector<float>::Read pr2 = penalties.read();
|
||||
const float *pr2 = penalties.ptr();
|
||||
for (int i = 0; i < pc; i++) {
|
||||
points.write[i].penalty = pr2[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PoolVector<int> segs = p_data["segments"];
|
||||
Vector<int> segs = p_data["segments"];
|
||||
int sc = segs.size();
|
||||
ERR_FAIL_COND(sc & 1);
|
||||
PoolVector<int>::Read sr = segs.read();
|
||||
const int *sr = segs.ptr();
|
||||
for (int i = 0; i < sc; i += 2) {
|
||||
|
||||
Edge e(sr[i], sr[i + 1]);
|
||||
|
|
@ -463,25 +463,25 @@ void PolygonPathFinder::_set_data(const Dictionary &p_data) {
|
|||
Dictionary PolygonPathFinder::_get_data() const {
|
||||
|
||||
Dictionary d;
|
||||
PoolVector<Vector2> p;
|
||||
PoolVector<int> ind;
|
||||
Vector<Vector2> p;
|
||||
Vector<int> ind;
|
||||
Array connections;
|
||||
p.resize(MAX(0, points.size() - 2));
|
||||
connections.resize(MAX(0, points.size() - 2));
|
||||
ind.resize(edges.size() * 2);
|
||||
PoolVector<float> penalties;
|
||||
Vector<float> penalties;
|
||||
penalties.resize(MAX(0, points.size() - 2));
|
||||
{
|
||||
PoolVector<Vector2>::Write wp = p.write();
|
||||
PoolVector<float>::Write pw = penalties.write();
|
||||
Vector2 *wp = p.ptrw();
|
||||
float *pw = penalties.ptrw();
|
||||
|
||||
for (int i = 0; i < points.size() - 2; i++) {
|
||||
wp[i] = points[i].pos;
|
||||
pw[i] = points[i].penalty;
|
||||
PoolVector<int> c;
|
||||
Vector<int> c;
|
||||
c.resize(points[i].connections.size());
|
||||
{
|
||||
PoolVector<int>::Write cw = c.write();
|
||||
int *cw = c.ptrw();
|
||||
int idx = 0;
|
||||
for (Set<int>::Element *E = points[i].connections.front(); E; E = E->next()) {
|
||||
cw[idx++] = E->get();
|
||||
|
|
@ -492,7 +492,7 @@ Dictionary PolygonPathFinder::_get_data() const {
|
|||
}
|
||||
{
|
||||
|
||||
PoolVector<int>::Write iw = ind.write();
|
||||
int *iw = ind.ptrw();
|
||||
int idx = 0;
|
||||
for (Set<Edge>::Element *E = edges.front(); E; E = E->next()) {
|
||||
iw[idx++] = E->get().points[0];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue