Actually use the vector write proxies in TerraMesher's build_mesh.

This commit is contained in:
Relintai 2021-08-10 12:36:48 +02:00
parent 2cbb13ea58
commit ecf09d1245

View File

@ -178,7 +178,11 @@ Array TerraMesher::build_mesh() {
#endif #endif
for (int i = 0; i < _vertices.size(); ++i) { for (int i = 0; i < _vertices.size(); ++i) {
#if !GODOT4
w[i] = _vertices[i].vertex;
#else
array.set(i, _vertices[i].vertex); array.set(i, _vertices[i].vertex);
#endif
} }
#if !GODOT4 #if !GODOT4
@ -200,7 +204,11 @@ Array TerraMesher::build_mesh() {
#endif #endif
for (int i = 0; i < _vertices.size(); ++i) { for (int i = 0; i < _vertices.size(); ++i) {
#if !GODOT4
w[i] = _vertices[i].normal;
#else
array.set(i, _vertices[i].normal); array.set(i, _vertices[i].normal);
#endif
} }
#if !GODOT4 #if !GODOT4
@ -217,7 +225,11 @@ Array TerraMesher::build_mesh() {
#endif #endif
for (int i = 0; i < _vertices.size(); ++i) { for (int i = 0; i < _vertices.size(); ++i) {
#if !GODOT4
w[i] = _vertices[i].color;
#else
array.set(i, _vertices[i].color); array.set(i, _vertices[i].color);
#endif
} }
#if !GODOT4 #if !GODOT4
@ -234,7 +246,11 @@ Array TerraMesher::build_mesh() {
#endif #endif
for (int i = 0; i < _vertices.size(); ++i) { for (int i = 0; i < _vertices.size(); ++i) {
#if !GODOT4
w[i] = _vertices[i].uv;
#else
array.set(i, _vertices[i].uv); array.set(i, _vertices[i].uv);
#endif
} }
#if !GODOT4 #if !GODOT4
@ -252,7 +268,11 @@ Array TerraMesher::build_mesh() {
#endif #endif
for (int i = 0; i < _vertices.size(); ++i) { for (int i = 0; i < _vertices.size(); ++i) {
#if !GODOT4
w[i] = _vertices[i].uv2;
#else
array.set(i, _vertices[i].uv2); array.set(i, _vertices[i].uv2);
#endif
} }
#if !GODOT4 #if !GODOT4
@ -269,7 +289,11 @@ Array TerraMesher::build_mesh() {
#endif #endif
for (int i = 0; i < _indices.size(); ++i) { for (int i = 0; i < _indices.size(); ++i) {
#if !GODOT4
w[i] = _indices[i];
#else
array.set(i, _indices[i]); array.set(i, _indices[i]);
#endif
} }
#if !GODOT4 #if !GODOT4