diff options
author | Juan Linietsky <juan@godotengine.org> | 2020-02-17 18:06:54 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2020-02-18 10:10:36 +0100 |
commit | 3205a92ad872f918c8322cdcd1434c231a1fd251 (patch) | |
tree | db44242ca27432eb8ea849679752d0835d2ae41a /modules | |
parent | fb8c93c10b4b73d5f18f1ed287497728800e22b5 (diff) |
PoolVector is gone, replaced by Vector
Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are
sugar for `Vector<Type>`.
Diffstat (limited to 'modules')
101 files changed, 1514 insertions, 2500 deletions
diff --git a/modules/arkit/arkit_interface.h b/modules/arkit/arkit_interface.h index cb18350409..4f8f726816 100644 --- a/modules/arkit/arkit_interface.h +++ b/modules/arkit/arkit_interface.h @@ -62,7 +62,7 @@ private: Ref<CameraFeed> feed; int image_width[2]; int image_height[2]; - PoolVector<uint8_t> img_data[2]; + Vector<uint8_t> img_data[2]; struct anchor_map { ARVRPositionalTracker *tracker; diff --git a/modules/arkit/arkit_interface.mm b/modules/arkit/arkit_interface.mm index 1896a34e46..39447e8dab 100644 --- a/modules/arkit/arkit_interface.mm +++ b/modules/arkit/arkit_interface.mm @@ -488,7 +488,7 @@ void ARKitInterface::process() { img_data[0].resize(new_width * new_height); } - PoolVector<uint8_t>::Write w = img_data[0].write(); + uint8_t *w = img_data[0].write(); if (new_width == bytes_per_row) { memcpy(w.ptr(), dataY, new_width * new_height); } else { @@ -519,7 +519,7 @@ void ARKitInterface::process() { img_data[1].resize(2 * new_width * new_height); } - PoolVector<uint8_t>::Write w = img_data[1].write(); + uint8_t *w = img_data[1].write(); if ((2 * new_width) == bytes_per_row) { memcpy(w.ptr(), dataCbCr, 2 * new_width * new_height); } else { diff --git a/modules/assimp/editor_scene_importer_assimp.cpp b/modules/assimp/editor_scene_importer_assimp.cpp index 2e653f4c5d..01d49e7995 100644 --- a/modules/assimp/editor_scene_importer_assimp.cpp +++ b/modules/assimp/editor_scene_importer_assimp.cpp @@ -1217,17 +1217,17 @@ EditorSceneImporterAssimp::_generate_mesh_from_surface_indices(ImportState &stat const size_t num_vertices = ai_mesh->mAnimMeshes[j]->mNumVertices; array_copy[Mesh::ARRAY_INDEX] = Variant(); if (ai_mesh->mAnimMeshes[j]->HasPositions()) { - PoolVector3Array vertices; + PackedVector3Array vertices; vertices.resize(num_vertices); for (size_t l = 0; l < num_vertices; l++) { const aiVector3D ai_pos = ai_mesh->mAnimMeshes[j]->mVertices[l]; Vector3 position = Vector3(ai_pos.x, ai_pos.y, ai_pos.z); - vertices.write()[l] = position; + vertices.ptrw()[l] = position; } - PoolVector3Array new_vertices = array_copy[VisualServer::ARRAY_VERTEX].duplicate(true); + PackedVector3Array new_vertices = array_copy[VisualServer::ARRAY_VERTEX].duplicate(true); ERR_CONTINUE(vertices.size() != new_vertices.size()); for (int32_t l = 0; l < new_vertices.size(); l++) { - PoolVector3Array::Write w = new_vertices.write(); + Vector3 *w = new_vertices.ptrw(); w[l] = vertices[l]; } array_copy[VisualServer::ARRAY_VERTEX] = new_vertices; @@ -1235,53 +1235,53 @@ EditorSceneImporterAssimp::_generate_mesh_from_surface_indices(ImportState &stat int32_t color_set = 0; if (ai_mesh->mAnimMeshes[j]->HasVertexColors(color_set)) { - PoolColorArray colors; + PackedColorArray colors; colors.resize(num_vertices); for (size_t l = 0; l < num_vertices; l++) { const aiColor4D ai_color = ai_mesh->mAnimMeshes[j]->mColors[color_set][l]; Color color = Color(ai_color.r, ai_color.g, ai_color.b, ai_color.a); - colors.write()[l] = color; + colors.ptrw()[l] = color; } - PoolColorArray new_colors = array_copy[VisualServer::ARRAY_COLOR].duplicate(true); + PackedColorArray new_colors = array_copy[VisualServer::ARRAY_COLOR].duplicate(true); ERR_CONTINUE(colors.size() != new_colors.size()); for (int32_t l = 0; l < colors.size(); l++) { - PoolColorArray::Write w = new_colors.write(); + Color *w = new_colors.ptrw(); w[l] = colors[l]; } array_copy[VisualServer::ARRAY_COLOR] = new_colors; } if (ai_mesh->mAnimMeshes[j]->HasNormals()) { - PoolVector3Array normals; + PackedVector3Array normals; normals.resize(num_vertices); for (size_t l = 0; l < num_vertices; l++) { const aiVector3D ai_normal = ai_mesh->mAnimMeshes[j]->mNormals[l]; Vector3 normal = Vector3(ai_normal.x, ai_normal.y, ai_normal.z); - normals.write()[l] = normal; + normals.ptrw()[l] = normal; } - PoolVector3Array new_normals = array_copy[VisualServer::ARRAY_NORMAL].duplicate(true); + PackedVector3Array new_normals = array_copy[VisualServer::ARRAY_NORMAL].duplicate(true); ERR_CONTINUE(normals.size() != new_normals.size()); for (int l = 0; l < normals.size(); l++) { - PoolVector3Array::Write w = new_normals.write(); + Vector3 *w = new_normals.ptrw(); w[l] = normals[l]; } array_copy[VisualServer::ARRAY_NORMAL] = new_normals; } if (ai_mesh->mAnimMeshes[j]->HasTangentsAndBitangents()) { - PoolColorArray tangents; + PackedColorArray tangents; tangents.resize(num_vertices); - PoolColorArray::Write w = tangents.write(); + Color *w = tangents.ptrw(); for (size_t l = 0; l < num_vertices; l++) { AssimpUtils::calc_tangent_from_mesh(ai_mesh, j, l, l, w); } - PoolRealArray new_tangents = array_copy[VisualServer::ARRAY_TANGENT].duplicate(true); + PackedRealArray new_tangents = array_copy[VisualServer::ARRAY_TANGENT].duplicate(true); ERR_CONTINUE(new_tangents.size() != tangents.size() * 4); for (int32_t l = 0; l < tangents.size(); l++) { - new_tangents.write()[l + 0] = tangents[l].r; - new_tangents.write()[l + 1] = tangents[l].g; - new_tangents.write()[l + 2] = tangents[l].b; - new_tangents.write()[l + 3] = tangents[l].a; + new_tangents.ptrw()[l + 0] = tangents[l].r; + new_tangents.ptrw()[l + 1] = tangents[l].g; + new_tangents.ptrw()[l + 2] = tangents[l].b; + new_tangents.ptrw()[l + 3] = tangents[l].a; } array_copy[VisualServer::ARRAY_TANGENT] = new_tangents; } diff --git a/modules/assimp/import_utils.h b/modules/assimp/import_utils.h index d037efce21..80b67b5453 100644 --- a/modules/assimp/import_utils.h +++ b/modules/assimp/import_utils.h @@ -98,7 +98,7 @@ public: /** * calculate tangents for mesh data from assimp data */ - static void calc_tangent_from_mesh(const aiMesh *ai_mesh, int i, int tri_index, int index, PoolColorArray::Write &w) { + static void calc_tangent_from_mesh(const aiMesh *ai_mesh, int i, int tri_index, int index, Color *w) { const aiVector3D normals = ai_mesh->mAnimMeshes[i]->mNormals[tri_index]; const Vector3 godot_normal = Vector3(normals.x, normals.y, normals.z); const aiVector3D tangent = ai_mesh->mAnimMeshes[i]->mTangents[tri_index]; @@ -375,17 +375,17 @@ public: } else { Ref<Image> img; img.instance(); - PoolByteArray arr; + PackedByteArray arr; uint32_t size = tex->mWidth * tex->mHeight; arr.resize(size); - memcpy(arr.write().ptr(), tex->pcData, size); + memcpy(arr.ptrw(), tex->pcData, size); ERR_FAIL_COND_V(arr.size() % 4 != 0, Ref<Image>()); //ARGB8888 to RGBA8888 for (int32_t i = 0; i < arr.size() / 4; i++) { - arr.write().ptr()[(4 * i) + 3] = arr[(4 * i) + 0]; - arr.write().ptr()[(4 * i) + 0] = arr[(4 * i) + 1]; - arr.write().ptr()[(4 * i) + 1] = arr[(4 * i) + 2]; - arr.write().ptr()[(4 * i) + 2] = arr[(4 * i) + 3]; + arr.ptrw()[(4 * i) + 3] = arr[(4 * i) + 0]; + arr.ptrw()[(4 * i) + 0] = arr[(4 * i) + 1]; + arr.ptrw()[(4 * i) + 1] = arr[(4 * i) + 2]; + arr.ptrw()[(4 * i) + 2] = arr[(4 * i) + 3]; } img->create(tex->mWidth, tex->mHeight, true, Image::FORMAT_RGBA8, arr); ERR_FAIL_COND_V(img.is_null(), Ref<Image>()); diff --git a/modules/basis_universal/register_types.cpp b/modules/basis_universal/register_types.cpp index f5ae424b56..13f4d5fc48 100644 --- a/modules/basis_universal/register_types.cpp +++ b/modules/basis_universal/register_types.cpp @@ -52,9 +52,9 @@ enum BasisDecompressFormat { basist::etc1_global_selector_codebook *sel_codebook = nullptr; -static PoolVector<uint8_t> basis_universal_packer(const Ref<Image> &p_image, Image::UsedChannels p_channels) { +static Vector<uint8_t> basis_universal_packer(const Ref<Image> &p_image, Image::UsedChannels p_channels) { - PoolVector<uint8_t> budata; + Vector<uint8_t> budata; #ifdef TOOLS_ENABLED @@ -74,10 +74,10 @@ static PoolVector<uint8_t> basis_universal_packer(const Ref<Image> &p_image, Ima basisu::image buimg(image->get_width(), image->get_height()); { - PoolVector<uint8_t> vec = image->get_data(); - PoolVector<uint8_t>::Read r = vec.read(); + Vector<uint8_t> vec = image->get_data(); + const uint8_t *r = vec.ptr(); - memcpy(buimg.get_ptr(), r.ptr(), vec.size()); + memcpy(buimg.get_ptr(), r, vec.size()); } //image->save_png("pepeche.png"); @@ -145,10 +145,10 @@ static PoolVector<uint8_t> basis_universal_packer(const Ref<Image> &p_image, Ima budata.resize(buvec.size() + 4); { - PoolVector<uint8_t>::Write w = budata.write(); - uint32_t *decf = (uint32_t *)w.ptr(); + uint8_t *w = budata.ptrw(); + uint32_t *decf = (uint32_t *)w; *decf = decompress_format; - memcpy(w.ptr() + 4, &buvec[0], buvec.size()); + memcpy(w + 4, &buvec[0], buvec.size()); } } @@ -156,11 +156,11 @@ static PoolVector<uint8_t> basis_universal_packer(const Ref<Image> &p_image, Ima return budata; } -static Ref<Image> basis_universal_unpacker(const PoolVector<uint8_t> &p_buffer) { +static Ref<Image> basis_universal_unpacker(const Vector<uint8_t> &p_buffer) { Ref<Image> image; - PoolVector<uint8_t>::Read r = p_buffer.read(); - const uint8_t *ptr = r.ptr(); + const uint8_t *r = p_buffer.ptr(); + const uint8_t *ptr = r; int size = p_buffer.size(); basist::transcoder_texture_format format; @@ -241,12 +241,12 @@ static Ref<Image> basis_universal_unpacker(const PoolVector<uint8_t> &p_buffer) tr.get_image_info(ptr, size, info, 0); int block_size = basist::basis_get_bytes_per_block(format); - PoolVector<uint8_t> gpudata; + Vector<uint8_t> gpudata; gpudata.resize(info.m_total_blocks * block_size); { - PoolVector<uint8_t>::Write w = gpudata.write(); - uint8_t *dst = w.ptr(); + uint8_t *w = gpudata.ptrw(); + uint8_t *dst = w; for (int i = 0; i < gpudata.size(); i++) dst[i] = 0x00; diff --git a/modules/basis_universal/texture_basisu.cpp b/modules/basis_universal/texture_basisu.cpp index 3b3805157b..12f3241c98 100644 --- a/modules/basis_universal/texture_basisu.cpp +++ b/modules/basis_universal/texture_basisu.cpp @@ -44,7 +44,7 @@ void TextureBasisU::_bind_methods() { ClassDB::bind_method(D_METHOD("get_basisu_data"), &TextureBasisU::get_data); ClassDB::bind_method(D_METHOD("import"), &TextureBasisU::import); - ADD_PROPERTY(PropertyInfo(Variant::POOL_BYTE_ARRAY, "basisu_data"), "set_basisu_data", "get_basisu_data"); + ADD_PROPERTY(PropertyInfo(Variant::PACKED_BYTE_ARRAY, "basisu_data"), "set_basisu_data", "get_basisu_data"); }; @@ -81,13 +81,13 @@ uint32_t TextureBasisU::get_flags() const { }; -void TextureBasisU::set_basisu_data(const PoolVector<uint8_t>& p_data) { +void TextureBasisU::set_basisu_data(const Vector<uint8_t>& p_data) { #ifdef TOOLS_ENABLED data = p_data; #endif - PoolVector<uint8_t>::Read r = p_data.read(); + const uint8_t* r = p_data.ptr(); const void* ptr = r.ptr(); int size = p_data.size(); @@ -114,11 +114,11 @@ void TextureBasisU::set_basisu_data(const PoolVector<uint8_t>& p_data) { tex_size = Size2(info.m_width, info.m_height); int block_size = basist::basis_get_bytes_per_block(format); - PoolVector<uint8_t> gpudata; + Vector<uint8_t> gpudata; gpudata.resize(info.m_total_blocks * block_size); { - PoolVector<uint8_t>::Write w = gpudata.write(); + uint8_t* w = gpudata.ptrw(); uint8_t* dst = w.ptr(); for (int i=0; i<gpudata.size(); i++) dst[i] = 0x00; @@ -152,7 +152,7 @@ Error TextureBasisU::import(const Ref<Image>& p_img) { #ifdef TOOLS_ENABLED - PoolVector<uint8_t> budata; + Vector<uint8_t> budata; { Image::Format format = p_img->get_format(); @@ -168,9 +168,9 @@ Error TextureBasisU::import(const Ref<Image>& p_img) { basisu::image buimg(p_img->get_width(), p_img->get_height()); int size = p_img->get_width() * p_img->get_height() * 4; - PoolVector<uint8_t> vec = copy->get_data(); + Vector<uint8_t> vec = copy->get_data(); { - PoolVector<uint8_t>::Read r = vec.read(); + const uint8_t* r = vec.ptr(); memcpy(buimg.get_ptr(), r.ptr(), size); }; @@ -198,7 +198,7 @@ Error TextureBasisU::import(const Ref<Image>& p_img) { budata.resize(buvec.size()); { - PoolVector<uint8_t>::Write w = budata.write(); + uint8_t* w = budata.ptrw(); memcpy(w.ptr(), &buvec[0], budata.size()); }; }; @@ -213,7 +213,7 @@ Error TextureBasisU::import(const Ref<Image>& p_img) { }; -PoolVector<uint8_t> TextureBasisU::get_basisu_data() const { +Vector<uint8_t> TextureBasisU::get_basisu_data() const { return data; }; diff --git a/modules/basis_universal/texture_basisu.h b/modules/basis_universal/texture_basisu.h index 8474a63258..8de151ede0 100644 --- a/modules/basis_universal/texture_basisu.h +++ b/modules/basis_universal/texture_basisu.h @@ -47,7 +47,7 @@ class TextureBasisU : public Texture { uint32_t flags; - PoolVector<uint8_t> data; + Vector<uint8_t> data; static void _bind_methods(); @@ -64,9 +64,9 @@ public: Error import(const Ref<Image> &p_img); - void set_basisu_data(const PoolVector<uint8_t>& p_data); + void set_basisu_data(const Vector<uint8_t>& p_data); - PoolVector<uint8_t> get_basisu_data() const; + Vector<uint8_t> get_basisu_data() const; String get_img_path() const; TextureBasisU(); diff --git a/modules/bmp/image_loader_bmp.cpp b/modules/bmp/image_loader_bmp.cpp index 5ce6d59daa..71e5076e78 100644 --- a/modules/bmp/image_loader_bmp.cpp +++ b/modules/bmp/image_loader_bmp.cpp @@ -65,7 +65,7 @@ Error ImageLoaderBMP::convert_to_image(Ref<Image> p_image, } // Image data (might be indexed) - PoolVector<uint8_t> data; + Vector<uint8_t> data; int data_len = 0; if (bits_per_pixel <= 8) { // indexed @@ -76,8 +76,8 @@ Error ImageLoaderBMP::convert_to_image(Ref<Image> p_image, ERR_FAIL_COND_V(data_len == 0, ERR_BUG); err = data.resize(data_len); - PoolVector<uint8_t>::Write data_w = data.write(); - uint8_t *write_buffer = data_w.ptr(); + uint8_t *data_w = data.ptrw(); + uint8_t *write_buffer = data_w; const uint32_t width_bytes = width * bits_per_pixel / 8; const uint32_t line_width = (width_bytes + 3) & ~3; @@ -158,11 +158,11 @@ Error ImageLoaderBMP::convert_to_image(Ref<Image> p_image, } else { // data is in indexed format, extend it // Palette data - PoolVector<uint8_t> palette_data; + Vector<uint8_t> palette_data; palette_data.resize(color_table_size * 4); - PoolVector<uint8_t>::Write palette_data_w = palette_data.write(); - uint8_t *pal = palette_data_w.ptr(); + uint8_t *palette_data_w = palette_data.ptrw(); + uint8_t *pal = palette_data_w; const uint8_t *cb = p_color_buffer; @@ -177,11 +177,11 @@ Error ImageLoaderBMP::convert_to_image(Ref<Image> p_image, cb += 4; } // Extend palette to image - PoolVector<uint8_t> extended_data; + Vector<uint8_t> extended_data; extended_data.resize(data.size() * 4); - PoolVector<uint8_t>::Write ex_w = extended_data.write(); - uint8_t *dest = ex_w.ptr(); + uint8_t *ex_w = extended_data.ptrw(); + uint8_t *dest = ex_w; const int num_pixels = width * height; @@ -260,27 +260,27 @@ Error ImageLoaderBMP::load_image(Ref<Image> p_image, FileAccess *f, ERR_FAIL_COND_V(color_table_size == 0, ERR_BUG); } - PoolVector<uint8_t> bmp_color_table; + Vector<uint8_t> bmp_color_table; // Color table is usually 4 bytes per color -> [B][G][R][0] bmp_color_table.resize(color_table_size * 4); - PoolVector<uint8_t>::Write bmp_color_table_w = bmp_color_table.write(); - f->get_buffer(bmp_color_table_w.ptr(), color_table_size * 4); + uint8_t *bmp_color_table_w = bmp_color_table.ptrw(); + f->get_buffer(bmp_color_table_w, color_table_size * 4); f->seek(bmp_header.bmp_file_header.bmp_file_offset); uint32_t bmp_buffer_size = (bmp_header.bmp_file_header.bmp_file_size - bmp_header.bmp_file_header.bmp_file_offset); - PoolVector<uint8_t> bmp_buffer; + Vector<uint8_t> bmp_buffer; err = bmp_buffer.resize(bmp_buffer_size); if (err == OK) { - PoolVector<uint8_t>::Write bmp_buffer_w = bmp_buffer.write(); - f->get_buffer(bmp_buffer_w.ptr(), bmp_buffer_size); + uint8_t *bmp_buffer_w = bmp_buffer.ptrw(); + f->get_buffer(bmp_buffer_w, bmp_buffer_size); - PoolVector<uint8_t>::Read bmp_buffer_r = bmp_buffer.read(); - PoolVector<uint8_t>::Read bmp_color_table_r = bmp_color_table.read(); - err = convert_to_image(p_image, bmp_buffer_r.ptr(), - bmp_color_table_r.ptr(), color_table_size, bmp_header); + const uint8_t *bmp_buffer_r = bmp_buffer.ptr(); + const uint8_t *bmp_color_table_r = bmp_color_table.ptr(); + err = convert_to_image(p_image, bmp_buffer_r, + bmp_color_table_r, color_table_size, bmp_header); } f->close(); } diff --git a/modules/bullet/shape_bullet.cpp b/modules/bullet/shape_bullet.cpp index f46db09e4a..1690950049 100644 --- a/modules/bullet/shape_bullet.cpp +++ b/modules/bullet/shape_bullet.cpp @@ -142,11 +142,11 @@ btScaledBvhTriangleMeshShape *ShapeBullet::create_shape_concave(btBvhTriangleMes } } -btHeightfieldTerrainShape *ShapeBullet::create_shape_height_field(PoolVector<real_t> &p_heights, int p_width, int p_depth, real_t p_min_height, real_t p_max_height) { +btHeightfieldTerrainShape *ShapeBullet::create_shape_height_field(Vector<real_t> &p_heights, int p_width, int p_depth, real_t p_min_height, real_t p_max_height) { const btScalar ignoredHeightScale(1); const int YAxis = 1; // 0=X, 1=Y, 2=Z const bool flipQuadEdges = false; - const void *heightsPtr = p_heights.read().ptr(); + const void *heightsPtr = p_heights.ptr(); btHeightfieldTerrainShape *heightfield = bulletnew(btHeightfieldTerrainShape(p_width, p_depth, heightsPtr, ignoredHeightScale, p_min_height, p_max_height, YAxis, PHY_FLOAT, flipQuadEdges)); @@ -370,7 +370,7 @@ ConcavePolygonShapeBullet::~ConcavePolygonShapeBullet() { delete meshShape->getTriangleInfoMap(); bulletdelete(meshShape); } - faces = PoolVector<Vector3>(); + faces = Vector<Vector3>(); } void ConcavePolygonShapeBullet::set_data(const Variant &p_data) { @@ -385,7 +385,7 @@ PhysicsServer::ShapeType ConcavePolygonShapeBullet::get_type() const { return PhysicsServer::SHAPE_CONCAVE_POLYGON; } -void ConcavePolygonShapeBullet::setup(PoolVector<Vector3> p_faces) { +void ConcavePolygonShapeBullet::setup(Vector<Vector3> p_faces) { faces = p_faces; if (meshShape) { /// Clear previous created shape @@ -401,8 +401,8 @@ void ConcavePolygonShapeBullet::setup(PoolVector<Vector3> p_faces) { btTriangleMesh *shapeInterface = bulletnew(btTriangleMesh); src_face_count /= 3; - PoolVector<Vector3>::Read r = p_faces.read(); - const Vector3 *facesr = r.ptr(); + const Vector3 *r = p_faces.ptr(); + const Vector3 *facesr = r; btVector3 supVec_0; btVector3 supVec_1; @@ -471,10 +471,10 @@ void HeightMapShapeBullet::set_data(const Variant &p_data) { // TODO This code will need adjustments if real_t is set to `double`, // because that precision is unnecessary for a heightmap and Bullet doesn't support it... - PoolVector<real_t> l_heights; + Vector<real_t> l_heights; Variant l_heights_v = d["heights"]; - if (l_heights_v.get_type() == Variant::POOL_REAL_ARRAY) { + if (l_heights_v.get_type() == Variant::PACKED_REAL_ARRAY) { // Ready-to-use heights can be passed l_heights = l_heights_v; @@ -491,13 +491,13 @@ void HeightMapShapeBullet::set_data(const Variant &p_data) { // We could convert here automatically but it's better to not be intrusive and let the caller do it if necessary. ERR_FAIL_COND(l_image->get_format() != Image::FORMAT_RF); - PoolByteArray im_data = l_image->get_data(); + PackedByteArray im_data = l_image->get_data(); l_heights.resize(l_image->get_width() * l_image->get_height()); - PoolRealArray::Write w = l_heights.write(); - PoolByteArray::Read r = im_data.read(); - float *rp = (float *)r.ptr(); + real_t *w = l_heights.ptrw(); + const uint8_t *r = im_data.ptr(); + float *rp = (float *)r; // At this point, `rp` could be used directly for Bullet, but I don't know how safe it would be. for (int i = 0; i < l_heights.size(); ++i) { @@ -505,7 +505,7 @@ void HeightMapShapeBullet::set_data(const Variant &p_data) { } } else { - ERR_FAIL_MSG("Expected PoolRealArray or float Image."); + ERR_FAIL_MSG("Expected PackedRealArray or float Image."); } ERR_FAIL_COND(l_width <= 0); @@ -515,7 +515,7 @@ void HeightMapShapeBullet::set_data(const Variant &p_data) { // Compute min and max heights if not specified. if (!d.has("min_height") && !d.has("max_height")) { - PoolVector<real_t>::Read r = l_heights.read(); + const real_t *r = l_heights.ptr(); int heights_size = l_heights.size(); for (int i = 0; i < heights_size; ++i) { @@ -540,7 +540,7 @@ PhysicsServer::ShapeType HeightMapShapeBullet::get_type() const { return PhysicsServer::SHAPE_HEIGHTMAP; } -void HeightMapShapeBullet::setup(PoolVector<real_t> &p_heights, int p_width, int p_depth, real_t p_min_height, real_t p_max_height) { +void HeightMapShapeBullet::setup(Vector<real_t> &p_heights, int p_width, int p_depth, real_t p_min_height, real_t p_max_height) { // TODO cell size must be tweaked using localScaling, which is a shared property for all Bullet shapes // If this array is resized outside of here, it should be preserved due to CoW diff --git a/modules/bullet/shape_bullet.h b/modules/bullet/shape_bullet.h index 8d3512cab4..27bf011ca1 100644 --- a/modules/bullet/shape_bullet.h +++ b/modules/bullet/shape_bullet.h @@ -90,7 +90,7 @@ public: /// IMPORTANT: Remember to delete the shape interface by calling: delete my_shape->getMeshInterface(); static class btConvexPointCloudShape *create_shape_convex(btAlignedObjectArray<btVector3> &p_vertices, const btVector3 &p_local_scaling = btVector3(1, 1, 1)); static class btScaledBvhTriangleMeshShape *create_shape_concave(btBvhTriangleMeshShape *p_mesh_shape, const btVector3 &p_local_scaling = btVector3(1, 1, 1)); - static class btHeightfieldTerrainShape *create_shape_height_field(PoolVector<real_t> &p_heights, int p_width, int p_depth, real_t p_min_height, real_t p_max_height); + static class btHeightfieldTerrainShape *create_shape_height_field(Vector<real_t> &p_heights, int p_width, int p_depth, real_t p_min_height, real_t p_max_height); static class btRayShape *create_shape_ray(real_t p_length, bool p_slips_on_slope); }; @@ -203,7 +203,7 @@ class ConcavePolygonShapeBullet : public ShapeBullet { class btBvhTriangleMeshShape *meshShape; public: - PoolVector<Vector3> faces; + Vector<Vector3> faces; ConcavePolygonShapeBullet(); virtual ~ConcavePolygonShapeBullet(); @@ -214,13 +214,13 @@ public: virtual btCollisionShape *create_bt_shape(const btVector3 &p_implicit_scale, real_t p_extra_edge = 0); private: - void setup(PoolVector<Vector3> p_faces); + void setup(Vector<Vector3> p_faces); }; class HeightMapShapeBullet : public ShapeBullet { public: - PoolVector<real_t> heights; + Vector<real_t> heights; int width; int depth; real_t min_height; @@ -234,7 +234,7 @@ public: virtual btCollisionShape *create_bt_shape(const btVector3 &p_implicit_scale, real_t p_extra_edge = 0); private: - void setup(PoolVector<real_t> &p_heights, int p_width, int p_depth, real_t p_min_height, real_t p_max_height); + void setup(Vector<real_t> &p_heights, int p_width, int p_depth, real_t p_min_height, real_t p_max_height); }; class RayShapeBullet : public ShapeBullet { diff --git a/modules/bullet/soft_body_bullet.cpp b/modules/bullet/soft_body_bullet.cpp index a7988279c0..f21206dd0d 100644 --- a/modules/bullet/soft_body_bullet.cpp +++ b/modules/bullet/soft_body_bullet.cpp @@ -184,7 +184,7 @@ void SoftBodyBullet::get_node_offset(int p_node_index, Vector3 &r_offset) const return; Array arrays = soft_mesh->surface_get_arrays(0); - PoolVector<Vector3> vertices(arrays[VS::ARRAY_VERTEX]); + Vector<Vector3> vertices(arrays[VS::ARRAY_VERTEX]); if (0 <= p_node_index && vertices.size() > p_node_index) { r_offset = vertices[p_node_index]; @@ -230,8 +230,8 @@ void SoftBodyBullet::reset_all_node_positions() { return; Array arrays = soft_mesh->surface_get_arrays(0); - PoolVector<Vector3> vs_vertices(arrays[VS::ARRAY_VERTEX]); - PoolVector<Vector3>::Read vs_vertices_read = vs_vertices.read(); + Vector<Vector3> vs_vertices(arrays[VS::ARRAY_VERTEX]); + const Vector3 *vs_vertices_read = vs_vertices.ptr(); for (int vertex_index = bt_soft_body->m_nodes.size() - 1; 0 <= vertex_index; --vertex_index) { @@ -320,7 +320,7 @@ void SoftBodyBullet::set_drag_coefficient(real_t p_val) { } } -void SoftBodyBullet::set_trimesh_body_shape(PoolVector<int> p_indices, PoolVector<Vector3> p_vertices) { +void SoftBodyBullet::set_trimesh_body_shape(Vector<int> p_indices, Vector<Vector3> p_vertices) { /// Assert the current soft body is destroyed destroy_soft_body(); @@ -339,7 +339,7 @@ void SoftBodyBullet::set_trimesh_body_shape(PoolVector<int> p_indices, PoolVecto const int vs_vertices_size(p_vertices.size()); - PoolVector<Vector3>::Read p_vertices_read = p_vertices.read(); + const Vector3 *p_vertices_read = p_vertices.ptr(); for (int vs_vertex_index = 0; vs_vertex_index < vs_vertices_size; ++vs_vertex_index) { @@ -366,7 +366,7 @@ void SoftBodyBullet::set_trimesh_body_shape(PoolVector<int> p_indices, PoolVecto { // Parse vertices to bullet bt_vertices.resize(indices_map_size * 3); - PoolVector<Vector3>::Read p_vertices_read = p_vertices.read(); + const Vector3 *p_vertices_read = p_vertices.ptr(); for (int i = 0; i < indices_map_size; ++i) { bt_vertices.write[3 * i + 0] = p_vertices_read[indices_table[i][0]].x; @@ -382,7 +382,7 @@ void SoftBodyBullet::set_trimesh_body_shape(PoolVector<int> p_indices, PoolVecto bt_triangles.resize(triangles_size * 3); - PoolVector<int>::Read p_indices_read = p_indices.read(); + const int *p_indices_read = p_indices.ptr(); for (int i = 0; i < triangles_size; ++i) { bt_triangles.write[3 * i + 0] = vs_indices_to_physics_table[p_indices_read[3 * i + 2]]; diff --git a/modules/bullet/soft_body_bullet.h b/modules/bullet/soft_body_bullet.h index b98116b073..2df8ce074f 100644 --- a/modules/bullet/soft_body_bullet.h +++ b/modules/bullet/soft_body_bullet.h @@ -152,7 +152,7 @@ public: _FORCE_INLINE_ real_t get_drag_coefficient() const { return drag_coefficient; } private: - void set_trimesh_body_shape(PoolVector<int> p_indices, PoolVector<Vector3> p_vertices); + void set_trimesh_body_shape(Vector<int> p_indices, Vector<Vector3> p_vertices); void setup_soft_body(); void pin_node(int p_node_index); diff --git a/modules/camera/camera_ios.mm b/modules/camera/camera_ios.mm index 8059277503..f01135f251 100644 --- a/modules/camera/camera_ios.mm +++ b/modules/camera/camera_ios.mm @@ -44,7 +44,7 @@ Ref<CameraFeed> feed; size_t width[2]; size_t height[2]; - PoolVector<uint8_t> img_data[2]; + Vector<uint8_t> img_data[2]; AVCaptureDeviceInput *input; AVCaptureVideoDataOutput *output; @@ -175,7 +175,7 @@ img_data[0].resize(new_width * new_height); } - PoolVector<uint8_t>::Write w = img_data[0].write(); + uint8_t *w = img_data[0].ptrw(); memcpy(w.ptr(), dataY, new_width * new_height); img[0].instance(); @@ -196,7 +196,7 @@ img_data[1].resize(2 * new_width * new_height); } - PoolVector<uint8_t>::Write w = img_data[1].write(); + uint8_t *w = img_data[1].ptrw(); memcpy(w.ptr(), dataCbCr, 2 * new_width * new_height); ///TODO GLES2 doesn't support FORMAT_RG8, need to do some form of conversion diff --git a/modules/camera/camera_osx.mm b/modules/camera/camera_osx.mm index 658ddb728b..9a72174723 100644 --- a/modules/camera/camera_osx.mm +++ b/modules/camera/camera_osx.mm @@ -42,7 +42,7 @@ Ref<CameraFeed> feed; size_t width[2]; size_t height[2]; - PoolVector<uint8_t> img_data[2]; + Vector<uint8_t> img_data[2]; AVCaptureDeviceInput *input; AVCaptureVideoDataOutput *output; @@ -159,8 +159,8 @@ img_data[0].resize(new_width * new_height); } - PoolVector<uint8_t>::Write w = img_data[0].write(); - memcpy(w.ptr(), dataY, new_width * new_height); + uint8_t *w = img_data[0].ptrw(); + memcpy(w, dataY, new_width * new_height); img[0].instance(); img[0]->create(new_width, new_height, 0, Image::FORMAT_R8, img_data[0]); @@ -177,8 +177,8 @@ img_data[1].resize(2 * new_width * new_height); } - PoolVector<uint8_t>::Write w = img_data[1].write(); - memcpy(w.ptr(), dataCbCr, 2 * new_width * new_height); + uint8_t *w = img_data[1].ptrw(); + memcpy(w, dataCbCr, 2 * new_width * new_height); ///TODO GLES2 doesn't support FORMAT_RG8, need to do some form of conversion img[1].instance(); diff --git a/modules/csg/csg.cpp b/modules/csg/csg.cpp index cc3bbed27f..36055ce840 100644 --- a/modules/csg/csg.cpp +++ b/modules/csg/csg.cpp @@ -39,7 +39,7 @@ void CSGBrush::clear() { faces.clear(); } -void CSGBrush::build_from_faces(const PoolVector<Vector3> &p_vertices, const PoolVector<Vector2> &p_uvs, const PoolVector<bool> &p_smooth, const PoolVector<Ref<Material> > &p_materials, const PoolVector<bool> &p_invert_faces) { +void CSGBrush::build_from_faces(const Vector<Vector3> &p_vertices, const Vector<Vector2> &p_uvs, const Vector<bool> &p_smooth, const Vector<Ref<Material> > &p_materials, const Vector<bool> &p_invert_faces) { clear(); @@ -47,15 +47,15 @@ void CSGBrush::build_from_faces(const PoolVector<Vector3> &p_vertices, const Poo ERR_FAIL_COND((vc % 3) != 0); - PoolVector<Vector3>::Read rv = p_vertices.read(); + const Vector3 *rv = p_vertices.ptr(); int uvc = p_uvs.size(); - PoolVector<Vector2>::Read ruv = p_uvs.read(); + const Vector2 *ruv = p_uvs.ptr(); int sc = p_smooth.size(); - PoolVector<bool>::Read rs = p_smooth.read(); + const bool *rs = p_smooth.ptr(); int mc = p_materials.size(); - PoolVector<Ref<Material> >::Read rm = p_materials.read(); + const Ref<Material> *rm = p_materials.ptr(); int ic = p_invert_faces.size(); - PoolVector<bool>::Read ri = p_invert_faces.read(); + const bool *ri = p_invert_faces.ptr(); Map<Ref<Material>, int> material_map; diff --git a/modules/csg/csg.h b/modules/csg/csg.h index a11e55c72a..472a96d5df 100644 --- a/modules/csg/csg.h +++ b/modules/csg/csg.h @@ -38,7 +38,7 @@ #include "core/math/transform.h" #include "core/math/vector3.h" #include "core/oa_hash_map.h" -#include "core/pool_vector.h" + #include "scene/resources/material.h" struct CSGBrush { @@ -58,7 +58,7 @@ struct CSGBrush { void _regen_face_aabbs(); //create a brush from faces - void build_from_faces(const PoolVector<Vector3> &p_vertices, const PoolVector<Vector2> &p_uvs, const PoolVector<bool> &p_smooth, const PoolVector<Ref<Material> > &p_materials, const PoolVector<bool> &p_invert_faces); + void build_from_faces(const Vector<Vector3> &p_vertices, const Vector<Vector2> &p_uvs, const Vector<bool> &p_smooth, const Vector<Ref<Material> > &p_materials, const Vector<bool> &p_invert_faces); void copy_from(const CSGBrush &p_brush, const Transform &p_xform); void clear(); diff --git a/modules/csg/csg_gizmos.cpp b/modules/csg/csg_gizmos.cpp index 49387606f3..1b63bccb06 100644 --- a/modules/csg/csg_gizmos.cpp +++ b/modules/csg/csg_gizmos.cpp @@ -336,12 +336,12 @@ void CSGShapeSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { Ref<Material> handles_material = get_material("handles"); - PoolVector<Vector3> faces = cs->get_brush_faces(); + Vector<Vector3> faces = cs->get_brush_faces(); Vector<Vector3> lines; lines.resize(faces.size() * 2); { - PoolVector<Vector3>::Read r = faces.read(); + const Vector3 *r = faces.ptr(); for (int i = 0; i < lines.size(); i += 6) { int f = i / 6; diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp index 33e4e9748c..e0c0aa6a51 100644 --- a/modules/csg/csg_shape.cpp +++ b/modules/csg/csg_shape.cpp @@ -334,16 +334,16 @@ void CSGShape::_update_shape() { surfaces.write[i].material = n->materials[i]; } - surfaces.write[i].verticesw = surfaces.write[i].vertices.write(); - surfaces.write[i].normalsw = surfaces.write[i].normals.write(); - surfaces.write[i].uvsw = surfaces.write[i].uvs.write(); + surfaces.write[i].verticesw = surfaces.write[i].vertices.ptrw(); + surfaces.write[i].normalsw = surfaces.write[i].normals.ptrw(); + surfaces.write[i].uvsw = surfaces.write[i].uvs.ptrw(); if (calculate_tangents) { - surfaces.write[i].tansw = surfaces.write[i].tans.write(); + surfaces.write[i].tansw = surfaces.write[i].tans.ptrw(); } } //fill arrays - PoolVector<Vector3> physics_faces; + Vector<Vector3> physics_faces; bool fill_physics_faces = false; if (root_collision_shape.is_valid()) { physics_faces.resize(n->faces.size() * 3); @@ -351,10 +351,10 @@ void CSGShape::_update_shape() { } { - PoolVector<Vector3>::Write physicsw; + Vector3 *physicsw; if (fill_physics_faces) { - physicsw = physics_faces.write(); + physicsw = physics_faces.ptrw(); } for (int i = 0; i < n->faces.size(); i++) { @@ -435,12 +435,6 @@ void CSGShape::_update_shape() { have_tangents = genTangSpaceDefault(&msc); } - // unset write access - surfaces.write[i].verticesw.release(); - surfaces.write[i].normalsw.release(); - surfaces.write[i].uvsw.release(); - surfaces.write[i].tansw.release(); - if (surfaces[i].last_added == 0) continue; @@ -470,18 +464,18 @@ AABB CSGShape::get_aabb() const { return node_aabb; } -PoolVector<Vector3> CSGShape::get_brush_faces() { - ERR_FAIL_COND_V(!is_inside_tree(), PoolVector<Vector3>()); +Vector<Vector3> CSGShape::get_brush_faces() { + ERR_FAIL_COND_V(!is_inside_tree(), Vector<Vector3>()); CSGBrush *b = _get_brush(); if (!b) { - return PoolVector<Vector3>(); + return Vector<Vector3>(); } - PoolVector<Vector3> faces; + Vector<Vector3> faces; int fc = b->faces.size(); faces.resize(fc * 3); { - PoolVector<Vector3>::Write w = faces.write(); + Vector3 *w = faces.ptrw(); for (int i = 0; i < fc; i++) { w[i * 3 + 0] = b->faces[i].vertices[0]; w[i * 3 + 1] = b->faces[i].vertices[1]; @@ -492,9 +486,9 @@ PoolVector<Vector3> CSGShape::get_brush_faces() { return faces; } -PoolVector<Face3> CSGShape::get_faces(uint32_t p_usage_flags) const { +Vector<Face3> CSGShape::get_faces(uint32_t p_usage_flags) const { - return PoolVector<Face3>(); + return Vector<Face3>(); } void CSGShape::_notification(int p_what) { @@ -671,15 +665,15 @@ CSGCombiner::CSGCombiner() { ///////////////////// -CSGBrush *CSGPrimitive::_create_brush_from_arrays(const PoolVector<Vector3> &p_vertices, const PoolVector<Vector2> &p_uv, const PoolVector<bool> &p_smooth, const PoolVector<Ref<Material> > &p_materials) { +CSGBrush *CSGPrimitive::_create_brush_from_arrays(const Vector<Vector3> &p_vertices, const Vector<Vector2> &p_uv, const Vector<bool> &p_smooth, const Vector<Ref<Material> > &p_materials) { CSGBrush *brush = memnew(CSGBrush); - PoolVector<bool> invert; + Vector<bool> invert; invert.resize(p_vertices.size() / 3); { int ic = invert.size(); - PoolVector<bool>::Write w = invert.write(); + bool *w = invert.ptrw(); for (int i = 0; i < ic; i++) { w[i] = invert_faces; } @@ -721,10 +715,10 @@ CSGBrush *CSGMesh::_build_brush() { if (!mesh.is_valid()) return NULL; - PoolVector<Vector3> vertices; - PoolVector<bool> smooth; - PoolVector<Ref<Material> > materials; - PoolVector<Vector2> uvs; + Vector<Vector3> vertices; + Vector<bool> smooth; + Vector<Ref<Material> > materials; + Vector<Vector2> uvs; Ref<Material> material = get_material(); for (int i = 0; i < mesh->get_surface_count(); i++) { @@ -740,25 +734,25 @@ CSGBrush *CSGMesh::_build_brush() { ERR_FAIL_COND_V(arrays.size() == 0, NULL); } - PoolVector<Vector3> avertices = arrays[Mesh::ARRAY_VERTEX]; + Vector<Vector3> avertices = arrays[Mesh::ARRAY_VERTEX]; if (avertices.size() == 0) continue; - PoolVector<Vector3>::Read vr = avertices.read(); + const Vector3 *vr = avertices.ptr(); - PoolVector<Vector3> anormals = arrays[Mesh::ARRAY_NORMAL]; - PoolVector<Vector3>::Read nr; + Vector<Vector3> anormals = arrays[Mesh::ARRAY_NORMAL]; + const Vector3 *nr; bool nr_used = false; if (anormals.size()) { - nr = anormals.read(); + nr = anormals.ptr(); nr_used = true; } - PoolVector<Vector2> auvs = arrays[Mesh::ARRAY_TEX_UV]; - PoolVector<Vector2>::Read uvr; + Vector<Vector2> auvs = arrays[Mesh::ARRAY_TEX_UV]; + const Vector2 *uvr; bool uvr_used = false; if (auvs.size()) { - uvr = auvs.read(); + uvr = auvs.ptr(); uvr_used = true; } @@ -769,7 +763,7 @@ CSGBrush *CSGMesh::_build_brush() { mat = mesh->surface_get_material(i); } - PoolVector<int> aindices = arrays[Mesh::ARRAY_INDEX]; + Vector<int> aindices = arrays[Mesh::ARRAY_INDEX]; if (aindices.size()) { int as = vertices.size(); int is = aindices.size(); @@ -779,12 +773,12 @@ CSGBrush *CSGMesh::_build_brush() { materials.resize((as + is) / 3); uvs.resize(as + is); - PoolVector<Vector3>::Write vw = vertices.write(); - PoolVector<bool>::Write sw = smooth.write(); - PoolVector<Vector2>::Write uvw = uvs.write(); - PoolVector<Ref<Material> >::Write mw = materials.write(); + Vector3 *vw = vertices.ptrw(); + bool *sw = smooth.ptrw(); + Vector2 *uvw = uvs.ptrw(); + Ref<Material> *mw = materials.ptrw(); - PoolVector<int>::Read ir = aindices.read(); + const int *ir = aindices.ptr(); for (int j = 0; j < is; j += 3) { @@ -825,10 +819,10 @@ CSGBrush *CSGMesh::_build_brush() { uvs.resize(as + is); materials.resize((as + is) / 3); - PoolVector<Vector3>::Write vw = vertices.write(); - PoolVector<bool>::Write sw = smooth.write(); - PoolVector<Vector2>::Write uvw = uvs.write(); - PoolVector<Ref<Material> >::Write mw = materials.write(); + Vector3 *vw = vertices.ptrw(); + bool *sw = smooth.ptrw(); + Vector2 *uvw = uvs.ptrw(); + Ref<Material> *mw = materials.ptrw(); for (int j = 0; j < is; j += 3) { @@ -932,11 +926,11 @@ CSGBrush *CSGSphere::_build_brush() { bool invert_val = is_inverting_faces(); Ref<Material> material = get_material(); - PoolVector<Vector3> faces; - PoolVector<Vector2> uvs; - PoolVector<bool> smooth; - PoolVector<Ref<Material> > materials; - PoolVector<bool> invert; + Vector<Vector3> faces; + Vector<Vector2> uvs; + Vector<bool> smooth; + Vector<Ref<Material> > materials; + Vector<bool> invert; faces.resize(face_count * 3); uvs.resize(face_count * 3); @@ -947,11 +941,11 @@ CSGBrush *CSGSphere::_build_brush() { { - PoolVector<Vector3>::Write facesw = faces.write(); - PoolVector<Vector2>::Write uvsw = uvs.write(); - PoolVector<bool>::Write smoothw = smooth.write(); - PoolVector<Ref<Material> >::Write materialsw = materials.write(); - PoolVector<bool>::Write invertw = invert.write(); + Vector3 *facesw = faces.ptrw(); + Vector2 *uvsw = uvs.ptrw(); + bool *smoothw = smooth.ptrw(); + Ref<Material> *materialsw = materials.ptrw(); + bool *invertw = invert.ptrw(); int face = 0; @@ -1135,11 +1129,11 @@ CSGBrush *CSGBox::_build_brush() { bool invert_val = is_inverting_faces(); Ref<Material> material = get_material(); - PoolVector<Vector3> faces; - PoolVector<Vector2> uvs; - PoolVector<bool> smooth; - PoolVector<Ref<Material> > materials; - PoolVector<bool> invert; + Vector<Vector3> faces; + Vector<Vector2> uvs; + Vector<bool> smooth; + Vector<Ref<Material> > materials; + Vector<bool> invert; faces.resize(face_count * 3); uvs.resize(face_count * 3); @@ -1150,11 +1144,11 @@ CSGBrush *CSGBox::_build_brush() { { - PoolVector<Vector3>::Write facesw = faces.write(); - PoolVector<Vector2>::Write uvsw = uvs.write(); - PoolVector<bool>::Write smoothw = smooth.write(); - PoolVector<Ref<Material> >::Write materialsw = materials.write(); - PoolVector<bool>::Write invertw = invert.write(); + Vector3 *facesw = faces.ptrw(); + Vector2 *uvsw = uvs.ptrw(); + bool *smoothw = smooth.ptrw(); + Ref<Material> *materialsw = materials.ptrw(); + bool *invertw = invert.ptrw(); int face = 0; @@ -1313,11 +1307,11 @@ CSGBrush *CSGCylinder::_build_brush() { bool invert_val = is_inverting_faces(); Ref<Material> material = get_material(); - PoolVector<Vector3> faces; - PoolVector<Vector2> uvs; - PoolVector<bool> smooth; - PoolVector<Ref<Material> > materials; - PoolVector<bool> invert; + Vector<Vector3> faces; + Vector<Vector2> uvs; + Vector<bool> smooth; + Vector<Ref<Material> > materials; + Vector<bool> invert; faces.resize(face_count * 3); uvs.resize(face_count * 3); @@ -1328,11 +1322,11 @@ CSGBrush *CSGCylinder::_build_brush() { { - PoolVector<Vector3>::Write facesw = faces.write(); - PoolVector<Vector2>::Write uvsw = uvs.write(); - PoolVector<bool>::Write smoothw = smooth.write(); - PoolVector<Ref<Material> >::Write materialsw = materials.write(); - PoolVector<bool>::Write invertw = invert.write(); + Vector3 *facesw = faces.ptrw(); + Vector2 *uvsw = uvs.ptrw(); + bool *smoothw = smooth.ptrw(); + Ref<Material> *materialsw = materials.ptrw(); + bool *invertw = invert.ptrw(); int face = 0; @@ -1562,11 +1556,11 @@ CSGBrush *CSGTorus::_build_brush() { bool invert_val = is_inverting_faces(); Ref<Material> material = get_material(); - PoolVector<Vector3> faces; - PoolVector<Vector2> uvs; - PoolVector<bool> smooth; - PoolVector<Ref<Material> > materials; - PoolVector<bool> invert; + Vector<Vector3> faces; + Vector<Vector2> uvs; + Vector<bool> smooth; + Vector<Ref<Material> > materials; + Vector<bool> invert; faces.resize(face_count * 3); uvs.resize(face_count * 3); @@ -1577,11 +1571,11 @@ CSGBrush *CSGTorus::_build_brush() { { - PoolVector<Vector3>::Write facesw = faces.write(); - PoolVector<Vector2>::Write uvsw = uvs.write(); - PoolVector<bool>::Write smoothw = smooth.write(); - PoolVector<Ref<Material> >::Write materialsw = materials.write(); - PoolVector<bool>::Write invertw = invert.write(); + Vector3 *facesw = faces.ptrw(); + Vector2 *uvsw = uvs.ptrw(); + bool *smoothw = smooth.ptrw(); + Ref<Material> *materialsw = materials.ptrw(); + bool *invertw = invert.ptrw(); int face = 0; @@ -1856,11 +1850,11 @@ CSGBrush *CSGPolygon::_build_brush() { bool invert_val = is_inverting_faces(); Ref<Material> material = get_material(); - PoolVector<Vector3> faces; - PoolVector<Vector2> uvs; - PoolVector<bool> smooth; - PoolVector<Ref<Material> > materials; - PoolVector<bool> invert; + Vector<Vector3> faces; + Vector<Vector2> uvs; + Vector<bool> smooth; + Vector<Ref<Material> > materials; + Vector<bool> invert; faces.resize(face_count * 3); uvs.resize(face_count * 3); @@ -1872,11 +1866,11 @@ CSGBrush *CSGPolygon::_build_brush() { AABB aabb; //must be computed { - PoolVector<Vector3>::Write facesw = faces.write(); - PoolVector<Vector2>::Write uvsw = uvs.write(); - PoolVector<bool>::Write smoothw = smooth.write(); - PoolVector<Ref<Material> >::Write materialsw = materials.write(); - PoolVector<bool>::Write invertw = invert.write(); + Vector3 *facesw = faces.ptrw(); + Vector2 *uvsw = uvs.ptrw(); + bool *smoothw = smooth.ptrw(); + Ref<Material> *materialsw = materials.ptrw(); + bool *invertw = invert.ptrw(); int face = 0; @@ -2318,7 +2312,7 @@ void CSGPolygon::_bind_methods() { ClassDB::bind_method(D_METHOD("_path_exited"), &CSGPolygon::_path_exited); ClassDB::bind_method(D_METHOD("_path_changed"), &CSGPolygon::_path_changed); - ADD_PROPERTY(PropertyInfo(Variant::POOL_VECTOR2_ARRAY, "polygon"), "set_polygon", "get_polygon"); + ADD_PROPERTY(PropertyInfo(Variant::PACKED_VECTOR2_ARRAY, "polygon"), "set_polygon", "get_polygon"); ADD_PROPERTY(PropertyInfo(Variant::INT, "mode", PROPERTY_HINT_ENUM, "Depth,Spin,Path"), "set_mode", "get_mode"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "depth", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_depth", "get_depth"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "spin_degrees", PROPERTY_HINT_RANGE, "1,360,0.1"), "set_spin_degrees", "get_spin_degrees"); diff --git a/modules/csg/csg_shape.h b/modules/csg/csg_shape.h index 1098feea51..909437e39b 100644 --- a/modules/csg/csg_shape.h +++ b/modules/csg/csg_shape.h @@ -80,17 +80,17 @@ private: }; struct ShapeUpdateSurface { - PoolVector<Vector3> vertices; - PoolVector<Vector3> normals; - PoolVector<Vector2> uvs; - PoolVector<float> tans; + Vector<Vector3> vertices; + Vector<Vector3> normals; + Vector<Vector2> uvs; + Vector<float> tans; Ref<Material> material; int last_added; - PoolVector<Vector3>::Write verticesw; - PoolVector<Vector3>::Write normalsw; - PoolVector<Vector2>::Write uvsw; - PoolVector<float>::Write tansw; + Vector3 *verticesw; + Vector3 *normalsw; + Vector2 *uvsw; + float *tansw; }; //mikktspace callbacks @@ -122,10 +122,10 @@ public: void set_operation(Operation p_operation); Operation get_operation() const; - virtual PoolVector<Vector3> get_brush_faces(); + virtual Vector<Vector3> get_brush_faces(); virtual AABB get_aabb() const; - virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; + virtual Vector<Face3> get_faces(uint32_t p_usage_flags) const; void set_use_collision(bool p_enable); bool is_using_collision() const; @@ -172,7 +172,7 @@ private: bool invert_faces; protected: - CSGBrush *_create_brush_from_arrays(const PoolVector<Vector3> &p_vertices, const PoolVector<Vector2> &p_uv, const PoolVector<bool> &p_smooth, const PoolVector<Ref<Material> > &p_materials); + CSGBrush *_create_brush_from_arrays(const Vector<Vector3> &p_vertices, const Vector<Vector2> &p_uv, const Vector<bool> &p_smooth, const Vector<Ref<Material> > &p_materials); static void _bind_methods(); public: diff --git a/modules/cvtt/image_compress_cvtt.cpp b/modules/cvtt/image_compress_cvtt.cpp index 4d762b7a7b..9dbaa88202 100644 --- a/modules/cvtt/image_compress_cvtt.cpp +++ b/modules/cvtt/image_compress_cvtt.cpp @@ -179,7 +179,7 @@ void image_compress_cvtt(Image *p_image, float p_lossy_quality, Image::UsedChann p_image->convert(Image::FORMAT_RGBH); } - PoolVector<uint8_t>::Read rb = p_image->get_data().read(); + const uint8_t *rb = p_image->get_data().ptr(); const uint16_t *source_data = reinterpret_cast<const uint16_t *>(&rb[0]); int pixel_element_count = w * h * 3; @@ -195,15 +195,15 @@ void image_compress_cvtt(Image *p_image, float p_lossy_quality, Image::UsedChann p_image->convert(Image::FORMAT_RGBA8); //still uses RGBA to convert } - PoolVector<uint8_t>::Read rb = p_image->get_data().read(); + const uint8_t *rb = p_image->get_data().ptr(); - PoolVector<uint8_t> data; + Vector<uint8_t> data; int target_size = Image::get_image_data_size(w, h, target_format, p_image->has_mipmaps()); int mm_count = p_image->has_mipmaps() ? Image::get_image_required_mipmaps(w, h, target_format) : 0; data.resize(target_size); int shift = Image::get_format_pixel_rshift(target_format); - PoolVector<uint8_t>::Write wb = data.write(); + uint8_t *wb = data.ptrw(); int dst_ofs = 0; @@ -219,7 +219,7 @@ void image_compress_cvtt(Image *p_image, float p_lossy_quality, Image::UsedChann int num_job_threads = OS::get_singleton()->can_use_threads() ? (OS::get_singleton()->get_processor_count() - 1) : 0; #endif - PoolVector<CVTTCompressionRowTask> tasks; + Vector<CVTTCompressionRowTask> tasks; for (int i = 0; i <= mm_count; i++) { @@ -254,12 +254,12 @@ void image_compress_cvtt(Image *p_image, float p_lossy_quality, Image::UsedChann } if (num_job_threads > 0) { - PoolVector<Thread *> threads; + Vector<Thread *> threads; threads.resize(num_job_threads); - PoolVector<Thread *>::Write threads_wb = threads.write(); + Thread **threads_wb = threads.ptrw(); - PoolVector<CVTTCompressionRowTask>::Read tasks_rb = tasks.read(); + const CVTTCompressionRowTask *tasks_rb = tasks.ptr(); job_queue.job_tasks = &tasks_rb[0]; job_queue.current_task = 0; @@ -304,14 +304,14 @@ void image_decompress_cvtt(Image *p_image) { int w = p_image->get_width(); int h = p_image->get_height(); - PoolVector<uint8_t>::Read rb = p_image->get_data().read(); + const uint8_t *rb = p_image->get_data().ptr(); - PoolVector<uint8_t> data; + Vector<uint8_t> data; int target_size = Image::get_image_data_size(w, h, target_format, p_image->has_mipmaps()); int mm_count = p_image->get_mipmap_count(); data.resize(target_size); - PoolVector<uint8_t>::Write wb = data.write(); + uint8_t *wb = data.ptrw(); int bytes_per_pixel = is_hdr ? 6 : 4; @@ -388,8 +388,5 @@ void image_decompress_cvtt(Image *p_image) { h >>= 1; } - rb.release(); - wb.release(); - p_image->create(p_image->get_width(), p_image->get_height(), p_image->has_mipmaps(), target_format, data); } diff --git a/modules/dds/texture_loader_dds.cpp b/modules/dds/texture_loader_dds.cpp index 5494744c48..a04989449c 100644 --- a/modules/dds/texture_loader_dds.cpp +++ b/modules/dds/texture_loader_dds.cpp @@ -222,7 +222,7 @@ RES ResourceFormatDDS::load(const String &p_path, const String &p_original_path, if (!(flags & DDSD_MIPMAPCOUNT)) mipmaps = 1; - PoolVector<uint8_t> src_data; + Vector<uint8_t> src_data; const DDSFormatInfo &info = dds_format_info[dds_format]; uint32_t w = width; @@ -245,8 +245,8 @@ RES ResourceFormatDDS::load(const String &p_path, const String &p_original_path, } src_data.resize(size); - PoolVector<uint8_t>::Write wb = src_data.write(); - f->get_buffer(wb.ptr(), size); + uint8_t *wb = src_data.ptrw(); + f->get_buffer(wb, size); } else if (info.palette) { @@ -278,8 +278,8 @@ RES ResourceFormatDDS::load(const String &p_path, const String &p_original_path, } src_data.resize(size + 256 * colsize); - PoolVector<uint8_t>::Write wb = src_data.write(); - f->get_buffer(wb.ptr(), size); + uint8_t *wb = src_data.ptrw(); + f->get_buffer(wb, size); for (int i = 0; i < 256; i++) { @@ -309,8 +309,8 @@ RES ResourceFormatDDS::load(const String &p_path, const String &p_original_path, size = size * 2; src_data.resize(size); - PoolVector<uint8_t>::Write wb = src_data.write(); - f->get_buffer(wb.ptr(), size); + uint8_t *wb = src_data.ptrw(); + f->get_buffer(wb, size); switch (dds_format) { diff --git a/modules/etc/image_etc.cpp b/modules/etc/image_etc.cpp index 24ee8e458e..0dbd5ca905 100644 --- a/modules/etc/image_etc.cpp +++ b/modules/etc/image_etc.cpp @@ -143,16 +143,16 @@ static void _compress_etc(Image *p_img, float p_lossy_quality, bool force_etc1_f } } - PoolVector<uint8_t>::Read r = img->get_data().read(); - ERR_FAIL_COND(!r.ptr()); + const uint8_t *r = img->get_data().ptr(); + ERR_FAIL_COND(!r); unsigned int target_size = Image::get_image_data_size(imgw, imgh, etc_format, p_img->has_mipmaps()); int mmc = 1 + (p_img->has_mipmaps() ? Image::get_image_required_mipmaps(imgw, imgh, etc_format) : 0); - PoolVector<uint8_t> dst_data; + Vector<uint8_t> dst_data; dst_data.resize(target_size); - PoolVector<uint8_t>::Write w = dst_data.write(); + uint8_t *w = dst_data.ptrw(); // prepare parameters to be passed to etc2comp int num_cpus = OS::get_singleton()->get_processor_count(); diff --git a/modules/etc/texture_loader_pkm.cpp b/modules/etc/texture_loader_pkm.cpp index facdc2e473..e460c70cec 100644 --- a/modules/etc/texture_loader_pkm.cpp +++ b/modules/etc/texture_loader_pkm.cpp @@ -71,13 +71,12 @@ RES ResourceFormatPKM::load(const String &p_path, const String &p_original_path, h.origWidth = f->get_16(); h.origHeight = f->get_16(); - PoolVector<uint8_t> src_data; + Vector<uint8_t> src_data; uint32_t size = h.texWidth * h.texHeight / 2; src_data.resize(size); - PoolVector<uint8_t>::Write wb = src_data.write(); - f->get_buffer(wb.ptr(), size); - wb.release(); + uint8_t *wb = src_data.ptrw(); + f->get_buffer(wb, size); int mipmaps = h.format; int width = h.origWidth; diff --git a/modules/gdnative/arvr/arvr_interface_gdnative.h b/modules/gdnative/arvr/arvr_interface_gdnative.h index 1077bef994..e38eb435c6 100644 --- a/modules/gdnative/arvr/arvr_interface_gdnative.h +++ b/modules/gdnative/arvr/arvr_interface_gdnative.h @@ -75,8 +75,8 @@ public: virtual bool is_stereo(); virtual Transform get_transform_for_eye(ARVRInterface::Eyes p_eye, const Transform &p_cam_transform); - // we expose a PoolVector<float> version of this function to GDNative - PoolVector<float> _get_projection_for_eye(ARVRInterface::Eyes p_eye, real_t p_aspect, real_t p_z_near, real_t p_z_far); + // we expose a Vector<float> version of this function to GDNative + Vector<float> _get_projection_for_eye(ARVRInterface::Eyes p_eye, real_t p_aspect, real_t p_z_near, real_t p_z_far); // and a CameraMatrix version to ARVRServer virtual CameraMatrix get_projection_for_eye(ARVRInterface::Eyes p_eye, real_t p_aspect, real_t p_z_near, real_t p_z_far); diff --git a/modules/gdnative/gdnative/array.cpp b/modules/gdnative/gdnative/array.cpp index 4a0308edec..0c764ab8fd 100644 --- a/modules/gdnative/gdnative/array.cpp +++ b/modules/gdnative/gdnative/array.cpp @@ -34,7 +34,6 @@ #include "core/os/memory.h" #include "core/color.h" -#include "core/pool_vector.h" #include "core/variant.h" @@ -53,9 +52,9 @@ void GDAPI godot_array_new_copy(godot_array *r_dest, const godot_array *p_src) { memnew_placement(dest, Array(*src)); } -void GDAPI godot_array_new_pool_color_array(godot_array *r_dest, const godot_pool_color_array *p_pca) { +void GDAPI godot_array_new_packed_color_array(godot_array *r_dest, const godot_packed_color_array *p_pca) { Array *dest = (Array *)r_dest; - PoolVector<Color> *pca = (PoolVector<Color> *)p_pca; + Vector<Color> *pca = (Vector<Color> *)p_pca; memnew_placement(dest, Array); dest->resize(pca->size()); @@ -65,9 +64,9 @@ void GDAPI godot_array_new_pool_color_array(godot_array *r_dest, const godot_poo } } -void GDAPI godot_array_new_pool_vector3_array(godot_array *r_dest, const godot_pool_vector3_array *p_pv3a) { +void GDAPI godot_array_new_packed_vector3_array(godot_array *r_dest, const godot_packed_vector3_array *p_pv3a) { Array *dest = (Array *)r_dest; - PoolVector<Vector3> *pca = (PoolVector<Vector3> *)p_pv3a; + Vector<Vector3> *pca = (Vector<Vector3> *)p_pv3a; memnew_placement(dest, Array); dest->resize(pca->size()); @@ -77,9 +76,9 @@ void GDAPI godot_array_new_pool_vector3_array(godot_array *r_dest, const godot_p } } -void GDAPI godot_array_new_pool_vector2_array(godot_array *r_dest, const godot_pool_vector2_array *p_pv2a) { +void GDAPI godot_array_new_packed_vector2_array(godot_array *r_dest, const godot_packed_vector2_array *p_pv2a) { Array *dest = (Array *)r_dest; - PoolVector<Vector2> *pca = (PoolVector<Vector2> *)p_pv2a; + Vector<Vector2> *pca = (Vector<Vector2> *)p_pv2a; memnew_placement(dest, Array); dest->resize(pca->size()); @@ -89,9 +88,9 @@ void GDAPI godot_array_new_pool_vector2_array(godot_array *r_dest, const godot_p } } -void GDAPI godot_array_new_pool_string_array(godot_array *r_dest, const godot_pool_string_array *p_psa) { +void GDAPI godot_array_new_packed_string_array(godot_array *r_dest, const godot_packed_string_array *p_psa) { Array *dest = (Array *)r_dest; - PoolVector<String> *pca = (PoolVector<String> *)p_psa; + Vector<String> *pca = (Vector<String> *)p_psa; memnew_placement(dest, Array); dest->resize(pca->size()); @@ -101,9 +100,9 @@ void GDAPI godot_array_new_pool_string_array(godot_array *r_dest, const godot_po } } -void GDAPI godot_array_new_pool_real_array(godot_array *r_dest, const godot_pool_real_array *p_pra) { +void GDAPI godot_array_new_packed_real_array(godot_array *r_dest, const godot_packed_real_array *p_pra) { Array *dest = (Array *)r_dest; - PoolVector<godot_real> *pca = (PoolVector<godot_real> *)p_pra; + Vector<godot_real> *pca = (Vector<godot_real> *)p_pra; memnew_placement(dest, Array); dest->resize(pca->size()); @@ -113,9 +112,9 @@ void GDAPI godot_array_new_pool_real_array(godot_array *r_dest, const godot_pool } } -void GDAPI godot_array_new_pool_int_array(godot_array *r_dest, const godot_pool_int_array *p_pia) { +void GDAPI godot_array_new_packed_int_array(godot_array *r_dest, const godot_packed_int_array *p_pia) { Array *dest = (Array *)r_dest; - PoolVector<godot_int> *pca = (PoolVector<godot_int> *)p_pia; + Vector<godot_int> *pca = (Vector<godot_int> *)p_pia; memnew_placement(dest, Array); dest->resize(pca->size()); @@ -125,9 +124,9 @@ void GDAPI godot_array_new_pool_int_array(godot_array *r_dest, const godot_pool_ } } -void GDAPI godot_array_new_pool_byte_array(godot_array *r_dest, const godot_pool_byte_array *p_pba) { +void GDAPI godot_array_new_packed_byte_array(godot_array *r_dest, const godot_packed_byte_array *p_pba) { Array *dest = (Array *)r_dest; - PoolVector<uint8_t> *pca = (PoolVector<uint8_t> *)p_pba; + Vector<uint8_t> *pca = (Vector<uint8_t> *)p_pba; memnew_placement(dest, Array); dest->resize(pca->size()); diff --git a/modules/gdnative/gdnative/pool_arrays.cpp b/modules/gdnative/gdnative/pool_arrays.cpp index bae1290d59..589b4d4dfe 100644 --- a/modules/gdnative/gdnative/pool_arrays.cpp +++ b/modules/gdnative/gdnative/pool_arrays.cpp @@ -31,7 +31,7 @@ #include "gdnative/pool_arrays.h" #include "core/array.h" -#include "core/pool_vector.h" + #include "core/variant.h" #include "core/color.h" @@ -46,21 +46,21 @@ extern "C" { // byte -void GDAPI godot_pool_byte_array_new(godot_pool_byte_array *r_dest) { - PoolVector<uint8_t> *dest = (PoolVector<uint8_t> *)r_dest; - memnew_placement(dest, PoolVector<uint8_t>); +void GDAPI godot_packed_byte_array_new(godot_packed_byte_array *r_dest) { + Vector<uint8_t> *dest = (Vector<uint8_t> *)r_dest; + memnew_placement(dest, Vector<uint8_t>); } -void GDAPI godot_pool_byte_array_new_copy(godot_pool_byte_array *r_dest, const godot_pool_byte_array *p_src) { - PoolVector<uint8_t> *dest = (PoolVector<uint8_t> *)r_dest; - const PoolVector<uint8_t> *src = (const PoolVector<uint8_t> *)p_src; - memnew_placement(dest, PoolVector<uint8_t>(*src)); +void GDAPI godot_packed_byte_array_new_copy(godot_packed_byte_array *r_dest, const godot_packed_byte_array *p_src) { + Vector<uint8_t> *dest = (Vector<uint8_t> *)r_dest; + const Vector<uint8_t> *src = (const Vector<uint8_t> *)p_src; + memnew_placement(dest, Vector<uint8_t>(*src)); } -void GDAPI godot_pool_byte_array_new_with_array(godot_pool_byte_array *r_dest, const godot_array *p_a) { - PoolVector<uint8_t> *dest = (PoolVector<uint8_t> *)r_dest; +void GDAPI godot_packed_byte_array_new_with_array(godot_packed_byte_array *r_dest, const godot_array *p_a) { + Vector<uint8_t> *dest = (Vector<uint8_t> *)r_dest; Array *a = (Array *)p_a; - memnew_placement(dest, PoolVector<uint8_t>); + memnew_placement(dest, Vector<uint8_t>); dest->resize(a->size()); for (int i = 0; i < a->size(); i++) { @@ -68,93 +68,83 @@ void GDAPI godot_pool_byte_array_new_with_array(godot_pool_byte_array *r_dest, c } } -void GDAPI godot_pool_byte_array_append(godot_pool_byte_array *p_self, const uint8_t p_data) { - PoolVector<uint8_t> *self = (PoolVector<uint8_t> *)p_self; - self->append(p_data); +void GDAPI godot_packed_byte_array_append(godot_packed_byte_array *p_self, const uint8_t p_data) { + Vector<uint8_t> *self = (Vector<uint8_t> *)p_self; + self->push_back(p_data); } -void GDAPI godot_pool_byte_array_append_array(godot_pool_byte_array *p_self, const godot_pool_byte_array *p_array) { - PoolVector<uint8_t> *self = (PoolVector<uint8_t> *)p_self; - PoolVector<uint8_t> *array = (PoolVector<uint8_t> *)p_array; +void GDAPI godot_packed_byte_array_append_array(godot_packed_byte_array *p_self, const godot_packed_byte_array *p_array) { + Vector<uint8_t> *self = (Vector<uint8_t> *)p_self; + Vector<uint8_t> *array = (Vector<uint8_t> *)p_array; self->append_array(*array); } -godot_error GDAPI godot_pool_byte_array_insert(godot_pool_byte_array *p_self, const godot_int p_idx, const uint8_t p_data) { - PoolVector<uint8_t> *self = (PoolVector<uint8_t> *)p_self; +godot_error GDAPI godot_packed_byte_array_insert(godot_packed_byte_array *p_self, const godot_int p_idx, const uint8_t p_data) { + Vector<uint8_t> *self = (Vector<uint8_t> *)p_self; return (godot_error)self->insert(p_idx, p_data); } -void GDAPI godot_pool_byte_array_invert(godot_pool_byte_array *p_self) { - PoolVector<uint8_t> *self = (PoolVector<uint8_t> *)p_self; +void GDAPI godot_packed_byte_array_invert(godot_packed_byte_array *p_self) { + Vector<uint8_t> *self = (Vector<uint8_t> *)p_self; self->invert(); } -void GDAPI godot_pool_byte_array_push_back(godot_pool_byte_array *p_self, const uint8_t p_data) { - PoolVector<uint8_t> *self = (PoolVector<uint8_t> *)p_self; +void GDAPI godot_packed_byte_array_push_back(godot_packed_byte_array *p_self, const uint8_t p_data) { + Vector<uint8_t> *self = (Vector<uint8_t> *)p_self; self->push_back(p_data); } -void GDAPI godot_pool_byte_array_remove(godot_pool_byte_array *p_self, const godot_int p_idx) { - PoolVector<uint8_t> *self = (PoolVector<uint8_t> *)p_self; +void GDAPI godot_packed_byte_array_remove(godot_packed_byte_array *p_self, const godot_int p_idx) { + Vector<uint8_t> *self = (Vector<uint8_t> *)p_self; self->remove(p_idx); } -void GDAPI godot_pool_byte_array_resize(godot_pool_byte_array *p_self, const godot_int p_size) { - PoolVector<uint8_t> *self = (PoolVector<uint8_t> *)p_self; +void GDAPI godot_packed_byte_array_resize(godot_packed_byte_array *p_self, const godot_int p_size) { + Vector<uint8_t> *self = (Vector<uint8_t> *)p_self; self->resize(p_size); } -godot_pool_byte_array_read_access GDAPI *godot_pool_byte_array_read(const godot_pool_byte_array *p_self) { - const PoolVector<uint8_t> *self = (const PoolVector<uint8_t> *)p_self; - return (godot_pool_byte_array_read_access *)memnew(PoolVector<uint8_t>::Read(self->read())); -} - -godot_pool_byte_array_write_access GDAPI *godot_pool_byte_array_write(godot_pool_byte_array *p_self) { - PoolVector<uint8_t> *self = (PoolVector<uint8_t> *)p_self; - return (godot_pool_byte_array_write_access *)memnew(PoolVector<uint8_t>::Write(self->write())); -} - -void GDAPI godot_pool_byte_array_set(godot_pool_byte_array *p_self, const godot_int p_idx, const uint8_t p_data) { - PoolVector<uint8_t> *self = (PoolVector<uint8_t> *)p_self; +void GDAPI godot_packed_byte_array_set(godot_packed_byte_array *p_self, const godot_int p_idx, const uint8_t p_data) { + Vector<uint8_t> *self = (Vector<uint8_t> *)p_self; self->set(p_idx, p_data); } -uint8_t GDAPI godot_pool_byte_array_get(const godot_pool_byte_array *p_self, const godot_int p_idx) { - const PoolVector<uint8_t> *self = (const PoolVector<uint8_t> *)p_self; +uint8_t GDAPI godot_packed_byte_array_get(const godot_packed_byte_array *p_self, const godot_int p_idx) { + const Vector<uint8_t> *self = (const Vector<uint8_t> *)p_self; return self->get(p_idx); } -godot_int GDAPI godot_pool_byte_array_size(const godot_pool_byte_array *p_self) { - const PoolVector<uint8_t> *self = (const PoolVector<uint8_t> *)p_self; +godot_int GDAPI godot_packed_byte_array_size(const godot_packed_byte_array *p_self) { + const Vector<uint8_t> *self = (const Vector<uint8_t> *)p_self; return self->size(); } -godot_bool GDAPI godot_pool_byte_array_empty(const godot_pool_byte_array *p_self) { - const PoolVector<uint8_t> *self = (const PoolVector<uint8_t> *)p_self; +godot_bool GDAPI godot_packed_byte_array_empty(const godot_packed_byte_array *p_self) { + const Vector<uint8_t> *self = (const Vector<uint8_t> *)p_self; return self->empty(); } -void GDAPI godot_pool_byte_array_destroy(godot_pool_byte_array *p_self) { - ((PoolVector<uint8_t> *)p_self)->~PoolVector(); +void GDAPI godot_packed_byte_array_destroy(godot_packed_byte_array *p_self) { + ((Vector<uint8_t> *)p_self)->~Vector(); } // int -void GDAPI godot_pool_int_array_new(godot_pool_int_array *r_dest) { - PoolVector<godot_int> *dest = (PoolVector<godot_int> *)r_dest; - memnew_placement(dest, PoolVector<godot_int>); +void GDAPI godot_packed_int_array_new(godot_packed_int_array *r_dest) { + Vector<godot_int> *dest = (Vector<godot_int> *)r_dest; + memnew_placement(dest, Vector<godot_int>); } -void GDAPI godot_pool_int_array_new_copy(godot_pool_int_array *r_dest, const godot_pool_int_array *p_src) { - PoolVector<godot_int> *dest = (PoolVector<godot_int> *)r_dest; - const PoolVector<godot_int> *src = (const PoolVector<godot_int> *)p_src; - memnew_placement(dest, PoolVector<godot_int>(*src)); +void GDAPI godot_packed_int_array_new_copy(godot_packed_int_array *r_dest, const godot_packed_int_array *p_src) { + Vector<godot_int> *dest = (Vector<godot_int> *)r_dest; + const Vector<godot_int> *src = (const Vector<godot_int> *)p_src; + memnew_placement(dest, Vector<godot_int>(*src)); } -void GDAPI godot_pool_int_array_new_with_array(godot_pool_int_array *r_dest, const godot_array *p_a) { - PoolVector<godot_int> *dest = (PoolVector<godot_int> *)r_dest; +void GDAPI godot_packed_int_array_new_with_array(godot_packed_int_array *r_dest, const godot_array *p_a) { + Vector<godot_int> *dest = (Vector<godot_int> *)r_dest; Array *a = (Array *)p_a; - memnew_placement(dest, PoolVector<godot_int>); + memnew_placement(dest, Vector<godot_int>); dest->resize(a->size()); for (int i = 0; i < a->size(); i++) { @@ -162,93 +152,83 @@ void GDAPI godot_pool_int_array_new_with_array(godot_pool_int_array *r_dest, con } } -void GDAPI godot_pool_int_array_append(godot_pool_int_array *p_self, const godot_int p_data) { - PoolVector<godot_int> *self = (PoolVector<godot_int> *)p_self; - self->append(p_data); +void GDAPI godot_packed_int_array_append(godot_packed_int_array *p_self, const godot_int p_data) { + Vector<godot_int> *self = (Vector<godot_int> *)p_self; + self->push_back(p_data); } -void GDAPI godot_pool_int_array_append_array(godot_pool_int_array *p_self, const godot_pool_int_array *p_array) { - PoolVector<godot_int> *self = (PoolVector<godot_int> *)p_self; - PoolVector<godot_int> *array = (PoolVector<godot_int> *)p_array; +void GDAPI godot_packed_int_array_append_array(godot_packed_int_array *p_self, const godot_packed_int_array *p_array) { + Vector<godot_int> *self = (Vector<godot_int> *)p_self; + Vector<godot_int> *array = (Vector<godot_int> *)p_array; self->append_array(*array); } -godot_error GDAPI godot_pool_int_array_insert(godot_pool_int_array *p_self, const godot_int p_idx, const godot_int p_data) { - PoolVector<godot_int> *self = (PoolVector<godot_int> *)p_self; +godot_error GDAPI godot_packed_int_array_insert(godot_packed_int_array *p_self, const godot_int p_idx, const godot_int p_data) { + Vector<godot_int> *self = (Vector<godot_int> *)p_self; return (godot_error)self->insert(p_idx, p_data); } -void GDAPI godot_pool_int_array_invert(godot_pool_int_array *p_self) { - PoolVector<godot_int> *self = (PoolVector<godot_int> *)p_self; +void GDAPI godot_packed_int_array_invert(godot_packed_int_array *p_self) { + Vector<godot_int> *self = (Vector<godot_int> *)p_self; self->invert(); } -void GDAPI godot_pool_int_array_push_back(godot_pool_int_array *p_self, const godot_int p_data) { - PoolVector<godot_int> *self = (PoolVector<godot_int> *)p_self; +void GDAPI godot_packed_int_array_push_back(godot_packed_int_array *p_self, const godot_int p_data) { + Vector<godot_int> *self = (Vector<godot_int> *)p_self; self->push_back(p_data); } -void GDAPI godot_pool_int_array_remove(godot_pool_int_array *p_self, const godot_int p_idx) { - PoolVector<godot_int> *self = (PoolVector<godot_int> *)p_self; +void GDAPI godot_packed_int_array_remove(godot_packed_int_array *p_self, const godot_int p_idx) { + Vector<godot_int> *self = (Vector<godot_int> *)p_self; self->remove(p_idx); } -void GDAPI godot_pool_int_array_resize(godot_pool_int_array *p_self, const godot_int p_size) { - PoolVector<godot_int> *self = (PoolVector<godot_int> *)p_self; +void GDAPI godot_packed_int_array_resize(godot_packed_int_array *p_self, const godot_int p_size) { + Vector<godot_int> *self = (Vector<godot_int> *)p_self; self->resize(p_size); } -godot_pool_int_array_read_access GDAPI *godot_pool_int_array_read(const godot_pool_int_array *p_self) { - const PoolVector<godot_int> *self = (const PoolVector<godot_int> *)p_self; - return (godot_pool_int_array_read_access *)memnew(PoolVector<godot_int>::Read(self->read())); -} - -godot_pool_int_array_write_access GDAPI *godot_pool_int_array_write(godot_pool_int_array *p_self) { - PoolVector<godot_int> *self = (PoolVector<godot_int> *)p_self; - return (godot_pool_int_array_write_access *)memnew(PoolVector<godot_int>::Write(self->write())); -} - -void GDAPI godot_pool_int_array_set(godot_pool_int_array *p_self, const godot_int p_idx, const godot_int p_data) { - PoolVector<godot_int> *self = (PoolVector<godot_int> *)p_self; +void GDAPI godot_packed_int_array_set(godot_packed_int_array *p_self, const godot_int p_idx, const godot_int p_data) { + Vector<godot_int> *self = (Vector<godot_int> *)p_self; self->set(p_idx, p_data); } -godot_int GDAPI godot_pool_int_array_get(const godot_pool_int_array *p_self, const godot_int p_idx) { - const PoolVector<godot_int> *self = (const PoolVector<godot_int> *)p_self; +godot_int GDAPI godot_packed_int_array_get(const godot_packed_int_array *p_self, const godot_int p_idx) { + const Vector<godot_int> *self = (const Vector<godot_int> *)p_self; return self->get(p_idx); } -godot_int GDAPI godot_pool_int_array_size(const godot_pool_int_array *p_self) { - const PoolVector<godot_int> *self = (const PoolVector<godot_int> *)p_self; +godot_int GDAPI godot_packed_int_array_size(const godot_packed_int_array *p_self) { + const Vector<godot_int> *self = (const Vector<godot_int> *)p_self; return self->size(); } -godot_bool GDAPI godot_pool_int_array_empty(const godot_pool_int_array *p_self) { - const PoolVector<godot_int> *self = (const PoolVector<godot_int> *)p_self; +godot_bool GDAPI godot_packed_int_array_empty(const godot_packed_int_array *p_self) { + const Vector<godot_int> *self = (const Vector<godot_int> *)p_self; return self->empty(); } -void GDAPI godot_pool_int_array_destroy(godot_pool_int_array *p_self) { - ((PoolVector<godot_int> *)p_self)->~PoolVector(); +void GDAPI godot_packed_int_array_destroy(godot_packed_int_array *p_self) { + ((Vector<godot_int> *)p_self)->~Vector(); } // real -void GDAPI godot_pool_real_array_new(godot_pool_real_array *r_dest) { - PoolVector<godot_real> *dest = (PoolVector<godot_real> *)r_dest; - memnew_placement(dest, PoolVector<godot_real>); +void GDAPI godot_packed_real_array_new(godot_packed_real_array *r_dest) { + Vector<godot_real> *dest = (Vector<godot_real> *)r_dest; + memnew_placement(dest, Vector<godot_real>); } -void GDAPI godot_pool_real_array_new_copy(godot_pool_real_array *r_dest, const godot_pool_real_array *p_src) { - PoolVector<godot_real> *dest = (PoolVector<godot_real> *)r_dest; - const PoolVector<godot_real> *src = (const PoolVector<godot_real> *)p_src; - memnew_placement(dest, PoolVector<godot_real>(*src)); +void GDAPI godot_packed_real_array_new_copy(godot_packed_real_array *r_dest, const godot_packed_real_array *p_src) { + Vector<godot_real> *dest = (Vector<godot_real> *)r_dest; + const Vector<godot_real> *src = (const Vector<godot_real> *)p_src; + memnew_placement(dest, Vector<godot_real>(*src)); } -void GDAPI godot_pool_real_array_new_with_array(godot_pool_real_array *r_dest, const godot_array *p_a) { - PoolVector<godot_real> *dest = (PoolVector<godot_real> *)r_dest; +void GDAPI godot_packed_real_array_new_with_array(godot_packed_real_array *r_dest, const godot_array *p_a) { + Vector<godot_real> *dest = (Vector<godot_real> *)r_dest; Array *a = (Array *)p_a; - memnew_placement(dest, PoolVector<godot_real>); + memnew_placement(dest, Vector<godot_real>); dest->resize(a->size()); for (int i = 0; i < a->size(); i++) { @@ -256,93 +236,83 @@ void GDAPI godot_pool_real_array_new_with_array(godot_pool_real_array *r_dest, c } } -void GDAPI godot_pool_real_array_append(godot_pool_real_array *p_self, const godot_real p_data) { - PoolVector<godot_real> *self = (PoolVector<godot_real> *)p_self; - self->append(p_data); +void GDAPI godot_packed_real_array_append(godot_packed_real_array *p_self, const godot_real p_data) { + Vector<godot_real> *self = (Vector<godot_real> *)p_self; + self->push_back(p_data); } -void GDAPI godot_pool_real_array_append_array(godot_pool_real_array *p_self, const godot_pool_real_array *p_array) { - PoolVector<godot_real> *self = (PoolVector<godot_real> *)p_self; - PoolVector<godot_real> *array = (PoolVector<godot_real> *)p_array; +void GDAPI godot_packed_real_array_append_array(godot_packed_real_array *p_self, const godot_packed_real_array *p_array) { + Vector<godot_real> *self = (Vector<godot_real> *)p_self; + Vector<godot_real> *array = (Vector<godot_real> *)p_array; self->append_array(*array); } -godot_error GDAPI godot_pool_real_array_insert(godot_pool_real_array *p_self, const godot_int p_idx, const godot_real p_data) { - PoolVector<godot_real> *self = (PoolVector<godot_real> *)p_self; +godot_error GDAPI godot_packed_real_array_insert(godot_packed_real_array *p_self, const godot_int p_idx, const godot_real p_data) { + Vector<godot_real> *self = (Vector<godot_real> *)p_self; return (godot_error)self->insert(p_idx, p_data); } -void GDAPI godot_pool_real_array_invert(godot_pool_real_array *p_self) { - PoolVector<godot_real> *self = (PoolVector<godot_real> *)p_self; +void GDAPI godot_packed_real_array_invert(godot_packed_real_array *p_self) { + Vector<godot_real> *self = (Vector<godot_real> *)p_self; self->invert(); } -void GDAPI godot_pool_real_array_push_back(godot_pool_real_array *p_self, const godot_real p_data) { - PoolVector<godot_real> *self = (PoolVector<godot_real> *)p_self; +void GDAPI godot_packed_real_array_push_back(godot_packed_real_array *p_self, const godot_real p_data) { + Vector<godot_real> *self = (Vector<godot_real> *)p_self; self->push_back(p_data); } -void GDAPI godot_pool_real_array_remove(godot_pool_real_array *p_self, const godot_int p_idx) { - PoolVector<godot_real> *self = (PoolVector<godot_real> *)p_self; +void GDAPI godot_packed_real_array_remove(godot_packed_real_array *p_self, const godot_int p_idx) { + Vector<godot_real> *self = (Vector<godot_real> *)p_self; self->remove(p_idx); } -void GDAPI godot_pool_real_array_resize(godot_pool_real_array *p_self, const godot_int p_size) { - PoolVector<godot_real> *self = (PoolVector<godot_real> *)p_self; +void GDAPI godot_packed_real_array_resize(godot_packed_real_array *p_self, const godot_int p_size) { + Vector<godot_real> *self = (Vector<godot_real> *)p_self; self->resize(p_size); } -godot_pool_real_array_read_access GDAPI *godot_pool_real_array_read(const godot_pool_real_array *p_self) { - const PoolVector<godot_real> *self = (const PoolVector<godot_real> *)p_self; - return (godot_pool_real_array_read_access *)memnew(PoolVector<godot_real>::Read(self->read())); -} - -godot_pool_int_array_write_access GDAPI *godot_pool_real_array_write(godot_pool_real_array *p_self) { - PoolVector<godot_real> *self = (PoolVector<godot_real> *)p_self; - return (godot_pool_real_array_write_access *)memnew(PoolVector<godot_real>::Write(self->write())); -} - -void GDAPI godot_pool_real_array_set(godot_pool_real_array *p_self, const godot_int p_idx, const godot_real p_data) { - PoolVector<godot_real> *self = (PoolVector<godot_real> *)p_self; +void GDAPI godot_packed_real_array_set(godot_packed_real_array *p_self, const godot_int p_idx, const godot_real p_data) { + Vector<godot_real> *self = (Vector<godot_real> *)p_self; self->set(p_idx, p_data); } -godot_real GDAPI godot_pool_real_array_get(const godot_pool_real_array *p_self, const godot_int p_idx) { - const PoolVector<godot_real> *self = (const PoolVector<godot_real> *)p_self; +godot_real GDAPI godot_packed_real_array_get(const godot_packed_real_array *p_self, const godot_int p_idx) { + const Vector<godot_real> *self = (const Vector<godot_real> *)p_self; return self->get(p_idx); } -godot_int GDAPI godot_pool_real_array_size(const godot_pool_real_array *p_self) { - const PoolVector<godot_real> *self = (const PoolVector<godot_real> *)p_self; +godot_int GDAPI godot_packed_real_array_size(const godot_packed_real_array *p_self) { + const Vector<godot_real> *self = (const Vector<godot_real> *)p_self; return self->size(); } -godot_bool GDAPI godot_pool_real_array_empty(const godot_pool_real_array *p_self) { - const PoolVector<godot_real> *self = (const PoolVector<godot_real> *)p_self; +godot_bool GDAPI godot_packed_real_array_empty(const godot_packed_real_array *p_self) { + const Vector<godot_real> *self = (const Vector<godot_real> *)p_self; return self->empty(); } -void GDAPI godot_pool_real_array_destroy(godot_pool_real_array *p_self) { - ((PoolVector<godot_real> *)p_self)->~PoolVector(); +void GDAPI godot_packed_real_array_destroy(godot_packed_real_array *p_self) { + ((Vector<godot_real> *)p_self)->~Vector(); } // string -void GDAPI godot_pool_string_array_new(godot_pool_string_array *r_dest) { - PoolVector<String> *dest = (PoolVector<String> *)r_dest; - memnew_placement(dest, PoolVector<String>); +void GDAPI godot_packed_string_array_new(godot_packed_string_array *r_dest) { + Vector<String> *dest = (Vector<String> *)r_dest; + memnew_placement(dest, Vector<String>); } -void GDAPI godot_pool_string_array_new_copy(godot_pool_string_array *r_dest, const godot_pool_string_array *p_src) { - PoolVector<String> *dest = (PoolVector<String> *)r_dest; - const PoolVector<String> *src = (const PoolVector<String> *)p_src; - memnew_placement(dest, PoolVector<String>(*src)); +void GDAPI godot_packed_string_array_new_copy(godot_packed_string_array *r_dest, const godot_packed_string_array *p_src) { + Vector<String> *dest = (Vector<String> *)r_dest; + const Vector<String> *src = (const Vector<String> *)p_src; + memnew_placement(dest, Vector<String>(*src)); } -void GDAPI godot_pool_string_array_new_with_array(godot_pool_string_array *r_dest, const godot_array *p_a) { - PoolVector<String> *dest = (PoolVector<String> *)r_dest; +void GDAPI godot_packed_string_array_new_with_array(godot_packed_string_array *r_dest, const godot_array *p_a) { + Vector<String> *dest = (Vector<String> *)r_dest; Array *a = (Array *)p_a; - memnew_placement(dest, PoolVector<String>); + memnew_placement(dest, Vector<String>); dest->resize(a->size()); for (int i = 0; i < a->size(); i++) { @@ -350,63 +320,53 @@ void GDAPI godot_pool_string_array_new_with_array(godot_pool_string_array *r_des } } -void GDAPI godot_pool_string_array_append(godot_pool_string_array *p_self, const godot_string *p_data) { - PoolVector<String> *self = (PoolVector<String> *)p_self; +void GDAPI godot_packed_string_array_append(godot_packed_string_array *p_self, const godot_string *p_data) { + Vector<String> *self = (Vector<String> *)p_self; String &s = *(String *)p_data; - self->append(s); + self->push_back(s); } -void GDAPI godot_pool_string_array_append_array(godot_pool_string_array *p_self, const godot_pool_string_array *p_array) { - PoolVector<String> *self = (PoolVector<String> *)p_self; - PoolVector<String> *array = (PoolVector<String> *)p_array; +void GDAPI godot_packed_string_array_append_array(godot_packed_string_array *p_self, const godot_packed_string_array *p_array) { + Vector<String> *self = (Vector<String> *)p_self; + Vector<String> *array = (Vector<String> *)p_array; self->append_array(*array); } -godot_error GDAPI godot_pool_string_array_insert(godot_pool_string_array *p_self, const godot_int p_idx, const godot_string *p_data) { - PoolVector<String> *self = (PoolVector<String> *)p_self; +godot_error GDAPI godot_packed_string_array_insert(godot_packed_string_array *p_self, const godot_int p_idx, const godot_string *p_data) { + Vector<String> *self = (Vector<String> *)p_self; String &s = *(String *)p_data; return (godot_error)self->insert(p_idx, s); } -void GDAPI godot_pool_string_array_invert(godot_pool_string_array *p_self) { - PoolVector<String> *self = (PoolVector<String> *)p_self; +void GDAPI godot_packed_string_array_invert(godot_packed_string_array *p_self) { + Vector<String> *self = (Vector<String> *)p_self; self->invert(); } -void GDAPI godot_pool_string_array_push_back(godot_pool_string_array *p_self, const godot_string *p_data) { - PoolVector<String> *self = (PoolVector<String> *)p_self; +void GDAPI godot_packed_string_array_push_back(godot_packed_string_array *p_self, const godot_string *p_data) { + Vector<String> *self = (Vector<String> *)p_self; String &s = *(String *)p_data; self->push_back(s); } -void GDAPI godot_pool_string_array_remove(godot_pool_string_array *p_self, const godot_int p_idx) { - PoolVector<String> *self = (PoolVector<String> *)p_self; +void GDAPI godot_packed_string_array_remove(godot_packed_string_array *p_self, const godot_int p_idx) { + Vector<String> *self = (Vector<String> *)p_self; self->remove(p_idx); } -void GDAPI godot_pool_string_array_resize(godot_pool_string_array *p_self, const godot_int p_size) { - PoolVector<String> *self = (PoolVector<String> *)p_self; +void GDAPI godot_packed_string_array_resize(godot_packed_string_array *p_self, const godot_int p_size) { + Vector<String> *self = (Vector<String> *)p_self; self->resize(p_size); } -godot_pool_string_array_read_access GDAPI *godot_pool_string_array_read(const godot_pool_string_array *p_self) { - const PoolVector<String> *self = (const PoolVector<String> *)p_self; - return (godot_pool_string_array_read_access *)memnew(PoolVector<String>::Read(self->read())); -} - -godot_pool_string_array_write_access GDAPI *godot_pool_string_array_write(godot_pool_string_array *p_self) { - PoolVector<String> *self = (PoolVector<String> *)p_self; - return (godot_pool_string_array_write_access *)memnew(PoolVector<String>::Write(self->write())); -} - -void GDAPI godot_pool_string_array_set(godot_pool_string_array *p_self, const godot_int p_idx, const godot_string *p_data) { - PoolVector<String> *self = (PoolVector<String> *)p_self; +void GDAPI godot_packed_string_array_set(godot_packed_string_array *p_self, const godot_int p_idx, const godot_string *p_data) { + Vector<String> *self = (Vector<String> *)p_self; String &s = *(String *)p_data; self->set(p_idx, s); } -godot_string GDAPI godot_pool_string_array_get(const godot_pool_string_array *p_self, const godot_int p_idx) { - const PoolVector<String> *self = (const PoolVector<String> *)p_self; +godot_string GDAPI godot_packed_string_array_get(const godot_packed_string_array *p_self, const godot_int p_idx) { + const Vector<String> *self = (const Vector<String> *)p_self; godot_string str; String *s = (String *)&str; memnew_placement(s, String); @@ -414,37 +374,37 @@ godot_string GDAPI godot_pool_string_array_get(const godot_pool_string_array *p_ return str; } -godot_int GDAPI godot_pool_string_array_size(const godot_pool_string_array *p_self) { - const PoolVector<String> *self = (const PoolVector<String> *)p_self; +godot_int GDAPI godot_packed_string_array_size(const godot_packed_string_array *p_self) { + const Vector<String> *self = (const Vector<String> *)p_self; return self->size(); } -godot_bool GDAPI godot_pool_string_array_empty(const godot_pool_string_array *p_self) { - const PoolVector<String> *self = (const PoolVector<String> *)p_self; +godot_bool GDAPI godot_packed_string_array_empty(const godot_packed_string_array *p_self) { + const Vector<String> *self = (const Vector<String> *)p_self; return self->empty(); } -void GDAPI godot_pool_string_array_destroy(godot_pool_string_array *p_self) { - ((PoolVector<String> *)p_self)->~PoolVector(); +void GDAPI godot_packed_string_array_destroy(godot_packed_string_array *p_self) { + ((Vector<String> *)p_self)->~Vector(); } // vector2 -void GDAPI godot_pool_vector2_array_new(godot_pool_vector2_array *r_dest) { - PoolVector<Vector2> *dest = (PoolVector<Vector2> *)r_dest; - memnew_placement(dest, PoolVector<Vector2>); +void GDAPI godot_packed_vector2_array_new(godot_packed_vector2_array *r_dest) { + Vector<Vector2> *dest = (Vector<Vector2> *)r_dest; + memnew_placement(dest, Vector<Vector2>); } -void GDAPI godot_pool_vector2_array_new_copy(godot_pool_vector2_array *r_dest, const godot_pool_vector2_array *p_src) { - PoolVector<Vector2> *dest = (PoolVector<Vector2> *)r_dest; - const PoolVector<Vector2> *src = (const PoolVector<Vector2> *)p_src; - memnew_placement(dest, PoolVector<Vector2>(*src)); +void GDAPI godot_packed_vector2_array_new_copy(godot_packed_vector2_array *r_dest, const godot_packed_vector2_array *p_src) { + Vector<Vector2> *dest = (Vector<Vector2> *)r_dest; + const Vector<Vector2> *src = (const Vector<Vector2> *)p_src; + memnew_placement(dest, Vector<Vector2>(*src)); } -void GDAPI godot_pool_vector2_array_new_with_array(godot_pool_vector2_array *r_dest, const godot_array *p_a) { - PoolVector<Vector2> *dest = (PoolVector<Vector2> *)r_dest; +void GDAPI godot_packed_vector2_array_new_with_array(godot_packed_vector2_array *r_dest, const godot_array *p_a) { + Vector<Vector2> *dest = (Vector<Vector2> *)r_dest; Array *a = (Array *)p_a; - memnew_placement(dest, PoolVector<Vector2>); + memnew_placement(dest, Vector<Vector2>); dest->resize(a->size()); for (int i = 0; i < a->size(); i++) { @@ -452,100 +412,90 @@ void GDAPI godot_pool_vector2_array_new_with_array(godot_pool_vector2_array *r_d } } -void GDAPI godot_pool_vector2_array_append(godot_pool_vector2_array *p_self, const godot_vector2 *p_data) { - PoolVector<Vector2> *self = (PoolVector<Vector2> *)p_self; +void GDAPI godot_packed_vector2_array_append(godot_packed_vector2_array *p_self, const godot_vector2 *p_data) { + Vector<Vector2> *self = (Vector<Vector2> *)p_self; Vector2 &s = *(Vector2 *)p_data; - self->append(s); + self->push_back(s); } -void GDAPI godot_pool_vector2_array_append_array(godot_pool_vector2_array *p_self, const godot_pool_vector2_array *p_array) { - PoolVector<Vector2> *self = (PoolVector<Vector2> *)p_self; - PoolVector<Vector2> *array = (PoolVector<Vector2> *)p_array; +void GDAPI godot_packed_vector2_array_append_array(godot_packed_vector2_array *p_self, const godot_packed_vector2_array *p_array) { + Vector<Vector2> *self = (Vector<Vector2> *)p_self; + Vector<Vector2> *array = (Vector<Vector2> *)p_array; self->append_array(*array); } -godot_error GDAPI godot_pool_vector2_array_insert(godot_pool_vector2_array *p_self, const godot_int p_idx, const godot_vector2 *p_data) { - PoolVector<Vector2> *self = (PoolVector<Vector2> *)p_self; +godot_error GDAPI godot_packed_vector2_array_insert(godot_packed_vector2_array *p_self, const godot_int p_idx, const godot_vector2 *p_data) { + Vector<Vector2> *self = (Vector<Vector2> *)p_self; Vector2 &s = *(Vector2 *)p_data; return (godot_error)self->insert(p_idx, s); } -void GDAPI godot_pool_vector2_array_invert(godot_pool_vector2_array *p_self) { - PoolVector<Vector2> *self = (PoolVector<Vector2> *)p_self; +void GDAPI godot_packed_vector2_array_invert(godot_packed_vector2_array *p_self) { + Vector<Vector2> *self = (Vector<Vector2> *)p_self; self->invert(); } -void GDAPI godot_pool_vector2_array_push_back(godot_pool_vector2_array *p_self, const godot_vector2 *p_data) { - PoolVector<Vector2> *self = (PoolVector<Vector2> *)p_self; +void GDAPI godot_packed_vector2_array_push_back(godot_packed_vector2_array *p_self, const godot_vector2 *p_data) { + Vector<Vector2> *self = (Vector<Vector2> *)p_self; Vector2 &s = *(Vector2 *)p_data; self->push_back(s); } -void GDAPI godot_pool_vector2_array_remove(godot_pool_vector2_array *p_self, const godot_int p_idx) { - PoolVector<Vector2> *self = (PoolVector<Vector2> *)p_self; +void GDAPI godot_packed_vector2_array_remove(godot_packed_vector2_array *p_self, const godot_int p_idx) { + Vector<Vector2> *self = (Vector<Vector2> *)p_self; self->remove(p_idx); } -void GDAPI godot_pool_vector2_array_resize(godot_pool_vector2_array *p_self, const godot_int p_size) { - PoolVector<Vector2> *self = (PoolVector<Vector2> *)p_self; +void GDAPI godot_packed_vector2_array_resize(godot_packed_vector2_array *p_self, const godot_int p_size) { + Vector<Vector2> *self = (Vector<Vector2> *)p_self; self->resize(p_size); } -godot_pool_vector2_array_read_access GDAPI *godot_pool_vector2_array_read(const godot_pool_vector2_array *p_self) { - const PoolVector<Vector2> *self = (const PoolVector<Vector2> *)p_self; - return (godot_pool_vector2_array_read_access *)memnew(PoolVector<Vector2>::Read(self->read())); -} - -godot_pool_vector2_array_write_access GDAPI *godot_pool_vector2_array_write(godot_pool_vector2_array *p_self) { - PoolVector<Vector2> *self = (PoolVector<Vector2> *)p_self; - return (godot_pool_vector2_array_write_access *)memnew(PoolVector<Vector2>::Write(self->write())); -} - -void GDAPI godot_pool_vector2_array_set(godot_pool_vector2_array *p_self, const godot_int p_idx, const godot_vector2 *p_data) { - PoolVector<Vector2> *self = (PoolVector<Vector2> *)p_self; +void GDAPI godot_packed_vector2_array_set(godot_packed_vector2_array *p_self, const godot_int p_idx, const godot_vector2 *p_data) { + Vector<Vector2> *self = (Vector<Vector2> *)p_self; Vector2 &s = *(Vector2 *)p_data; self->set(p_idx, s); } -godot_vector2 GDAPI godot_pool_vector2_array_get(const godot_pool_vector2_array *p_self, const godot_int p_idx) { - const PoolVector<Vector2> *self = (const PoolVector<Vector2> *)p_self; +godot_vector2 GDAPI godot_packed_vector2_array_get(const godot_packed_vector2_array *p_self, const godot_int p_idx) { + const Vector<Vector2> *self = (const Vector<Vector2> *)p_self; godot_vector2 v; Vector2 *s = (Vector2 *)&v; *s = self->get(p_idx); return v; } -godot_int GDAPI godot_pool_vector2_array_size(const godot_pool_vector2_array *p_self) { - const PoolVector<Vector2> *self = (const PoolVector<Vector2> *)p_self; +godot_int GDAPI godot_packed_vector2_array_size(const godot_packed_vector2_array *p_self) { + const Vector<Vector2> *self = (const Vector<Vector2> *)p_self; return self->size(); } -godot_bool GDAPI godot_pool_vector2_array_empty(const godot_pool_vector2_array *p_self) { - const PoolVector<Vector2> *self = (const PoolVector<Vector2> *)p_self; +godot_bool GDAPI godot_packed_vector2_array_empty(const godot_packed_vector2_array *p_self) { + const Vector<Vector2> *self = (const Vector<Vector2> *)p_self; return self->empty(); } -void GDAPI godot_pool_vector2_array_destroy(godot_pool_vector2_array *p_self) { - ((PoolVector<Vector2> *)p_self)->~PoolVector(); +void GDAPI godot_packed_vector2_array_destroy(godot_packed_vector2_array *p_self) { + ((Vector<Vector2> *)p_self)->~Vector(); } // vector3 -void GDAPI godot_pool_vector3_array_new(godot_pool_vector3_array *r_dest) { - PoolVector<Vector3> *dest = (PoolVector<Vector3> *)r_dest; - memnew_placement(dest, PoolVector<Vector3>); +void GDAPI godot_packed_vector3_array_new(godot_packed_vector3_array *r_dest) { + Vector<Vector3> *dest = (Vector<Vector3> *)r_dest; + memnew_placement(dest, Vector<Vector3>); } -void GDAPI godot_pool_vector3_array_new_copy(godot_pool_vector3_array *r_dest, const godot_pool_vector3_array *p_src) { - PoolVector<Vector3> *dest = (PoolVector<Vector3> *)r_dest; - const PoolVector<Vector3> *src = (const PoolVector<Vector3> *)p_src; - memnew_placement(dest, PoolVector<Vector3>(*src)); +void GDAPI godot_packed_vector3_array_new_copy(godot_packed_vector3_array *r_dest, const godot_packed_vector3_array *p_src) { + Vector<Vector3> *dest = (Vector<Vector3> *)r_dest; + const Vector<Vector3> *src = (const Vector<Vector3> *)p_src; + memnew_placement(dest, Vector<Vector3>(*src)); } -void GDAPI godot_pool_vector3_array_new_with_array(godot_pool_vector3_array *r_dest, const godot_array *p_a) { - PoolVector<Vector3> *dest = (PoolVector<Vector3> *)r_dest; +void GDAPI godot_packed_vector3_array_new_with_array(godot_packed_vector3_array *r_dest, const godot_array *p_a) { + Vector<Vector3> *dest = (Vector<Vector3> *)r_dest; Array *a = (Array *)p_a; - memnew_placement(dest, PoolVector<Vector3>); + memnew_placement(dest, Vector<Vector3>); dest->resize(a->size()); for (int i = 0; i < a->size(); i++) { @@ -553,100 +503,90 @@ void GDAPI godot_pool_vector3_array_new_with_array(godot_pool_vector3_array *r_d } } -void GDAPI godot_pool_vector3_array_append(godot_pool_vector3_array *p_self, const godot_vector3 *p_data) { - PoolVector<Vector3> *self = (PoolVector<Vector3> *)p_self; +void GDAPI godot_packed_vector3_array_append(godot_packed_vector3_array *p_self, const godot_vector3 *p_data) { + Vector<Vector3> *self = (Vector<Vector3> *)p_self; Vector3 &s = *(Vector3 *)p_data; - self->append(s); + self->push_back(s); } -void GDAPI godot_pool_vector3_array_append_array(godot_pool_vector3_array *p_self, const godot_pool_vector3_array *p_array) { - PoolVector<Vector3> *self = (PoolVector<Vector3> *)p_self; - PoolVector<Vector3> *array = (PoolVector<Vector3> *)p_array; +void GDAPI godot_packed_vector3_array_append_array(godot_packed_vector3_array *p_self, const godot_packed_vector3_array *p_array) { + Vector<Vector3> *self = (Vector<Vector3> *)p_self; + Vector<Vector3> *array = (Vector<Vector3> *)p_array; self->append_array(*array); } -godot_error GDAPI godot_pool_vector3_array_insert(godot_pool_vector3_array *p_self, const godot_int p_idx, const godot_vector3 *p_data) { - PoolVector<Vector3> *self = (PoolVector<Vector3> *)p_self; +godot_error GDAPI godot_packed_vector3_array_insert(godot_packed_vector3_array *p_self, const godot_int p_idx, const godot_vector3 *p_data) { + Vector<Vector3> *self = (Vector<Vector3> *)p_self; Vector3 &s = *(Vector3 *)p_data; return (godot_error)self->insert(p_idx, s); } -void GDAPI godot_pool_vector3_array_invert(godot_pool_vector3_array *p_self) { - PoolVector<Vector3> *self = (PoolVector<Vector3> *)p_self; +void GDAPI godot_packed_vector3_array_invert(godot_packed_vector3_array *p_self) { + Vector<Vector3> *self = (Vector<Vector3> *)p_self; self->invert(); } -void GDAPI godot_pool_vector3_array_push_back(godot_pool_vector3_array *p_self, const godot_vector3 *p_data) { - PoolVector<Vector3> *self = (PoolVector<Vector3> *)p_self; +void GDAPI godot_packed_vector3_array_push_back(godot_packed_vector3_array *p_self, const godot_vector3 *p_data) { + Vector<Vector3> *self = (Vector<Vector3> *)p_self; Vector3 &s = *(Vector3 *)p_data; self->push_back(s); } -void GDAPI godot_pool_vector3_array_remove(godot_pool_vector3_array *p_self, const godot_int p_idx) { - PoolVector<Vector3> *self = (PoolVector<Vector3> *)p_self; +void GDAPI godot_packed_vector3_array_remove(godot_packed_vector3_array *p_self, const godot_int p_idx) { + Vector<Vector3> *self = (Vector<Vector3> *)p_self; self->remove(p_idx); } -void GDAPI godot_pool_vector3_array_resize(godot_pool_vector3_array *p_self, const godot_int p_size) { - PoolVector<Vector3> *self = (PoolVector<Vector3> *)p_self; +void GDAPI godot_packed_vector3_array_resize(godot_packed_vector3_array *p_self, const godot_int p_size) { + Vector<Vector3> *self = (Vector<Vector3> *)p_self; self->resize(p_size); } -godot_pool_vector3_array_read_access GDAPI *godot_pool_vector3_array_read(const godot_pool_vector3_array *p_self) { - const PoolVector<Vector3> *self = (const PoolVector<Vector3> *)p_self; - return (godot_pool_vector3_array_read_access *)memnew(PoolVector<Vector3>::Read(self->read())); -} - -godot_pool_vector3_array_write_access GDAPI *godot_pool_vector3_array_write(godot_pool_vector3_array *p_self) { - PoolVector<Vector3> *self = (PoolVector<Vector3> *)p_self; - return (godot_pool_vector3_array_write_access *)memnew(PoolVector<Vector3>::Write(self->write())); -} - -void GDAPI godot_pool_vector3_array_set(godot_pool_vector3_array *p_self, const godot_int p_idx, const godot_vector3 *p_data) { - PoolVector<Vector3> *self = (PoolVector<Vector3> *)p_self; +void GDAPI godot_packed_vector3_array_set(godot_packed_vector3_array *p_self, const godot_int p_idx, const godot_vector3 *p_data) { + Vector<Vector3> *self = (Vector<Vector3> *)p_self; Vector3 &s = *(Vector3 *)p_data; self->set(p_idx, s); } -godot_vector3 GDAPI godot_pool_vector3_array_get(const godot_pool_vector3_array *p_self, const godot_int p_idx) { - const PoolVector<Vector3> *self = (const PoolVector<Vector3> *)p_self; +godot_vector3 GDAPI godot_packed_vector3_array_get(const godot_packed_vector3_array *p_self, const godot_int p_idx) { + const Vector<Vector3> *self = (const Vector<Vector3> *)p_self; godot_vector3 v; Vector3 *s = (Vector3 *)&v; *s = self->get(p_idx); return v; } -godot_int GDAPI godot_pool_vector3_array_size(const godot_pool_vector3_array *p_self) { - const PoolVector<Vector3> *self = (const PoolVector<Vector3> *)p_self; +godot_int GDAPI godot_packed_vector3_array_size(const godot_packed_vector3_array *p_self) { + const Vector<Vector3> *self = (const Vector<Vector3> *)p_self; return self->size(); } -godot_bool GDAPI godot_pool_vector3_array_empty(const godot_pool_vector3_array *p_self) { - const PoolVector<Vector3> *self = (const PoolVector<Vector3> *)p_self; +godot_bool GDAPI godot_packed_vector3_array_empty(const godot_packed_vector3_array *p_self) { + const Vector<Vector3> *self = (const Vector<Vector3> *)p_self; return self->empty(); } -void GDAPI godot_pool_vector3_array_destroy(godot_pool_vector3_array *p_self) { - ((PoolVector<Vector3> *)p_self)->~PoolVector(); +void GDAPI godot_packed_vector3_array_destroy(godot_packed_vector3_array *p_self) { + ((Vector<Vector3> *)p_self)->~Vector(); } // color -void GDAPI godot_pool_color_array_new(godot_pool_color_array *r_dest) { - PoolVector<Color> *dest = (PoolVector<Color> *)r_dest; - memnew_placement(dest, PoolVector<Color>); +void GDAPI godot_packed_color_array_new(godot_packed_color_array *r_dest) { + Vector<Color> *dest = (Vector<Color> *)r_dest; + memnew_placement(dest, Vector<Color>); } -void GDAPI godot_pool_color_array_new_copy(godot_pool_color_array *r_dest, const godot_pool_color_array *p_src) { - PoolVector<Color> *dest = (PoolVector<Color> *)r_dest; - const PoolVector<Color> *src = (const PoolVector<Color> *)p_src; - memnew_placement(dest, PoolVector<Color>(*src)); +void GDAPI godot_packed_color_array_new_copy(godot_packed_color_array *r_dest, const godot_packed_color_array *p_src) { + Vector<Color> *dest = (Vector<Color> *)r_dest; + const Vector<Color> *src = (const Vector<Color> *)p_src; + memnew_placement(dest, Vector<Color>(*src)); } -void GDAPI godot_pool_color_array_new_with_array(godot_pool_color_array *r_dest, const godot_array *p_a) { - PoolVector<Color> *dest = (PoolVector<Color> *)r_dest; +void GDAPI godot_packed_color_array_new_with_array(godot_packed_color_array *r_dest, const godot_array *p_a) { + Vector<Color> *dest = (Vector<Color> *)r_dest; Array *a = (Array *)p_a; - memnew_placement(dest, PoolVector<Color>); + memnew_placement(dest, Vector<Color>); dest->resize(a->size()); for (int i = 0; i < a->size(); i++) { @@ -654,327 +594,71 @@ void GDAPI godot_pool_color_array_new_with_array(godot_pool_color_array *r_dest, } } -void GDAPI godot_pool_color_array_append(godot_pool_color_array *p_self, const godot_color *p_data) { - PoolVector<Color> *self = (PoolVector<Color> *)p_self; +void GDAPI godot_packed_color_array_append(godot_packed_color_array *p_self, const godot_color *p_data) { + Vector<Color> *self = (Vector<Color> *)p_self; Color &s = *(Color *)p_data; - self->append(s); + self->push_back(s); } -void GDAPI godot_pool_color_array_append_array(godot_pool_color_array *p_self, const godot_pool_color_array *p_array) { - PoolVector<Color> *self = (PoolVector<Color> *)p_self; - PoolVector<Color> *array = (PoolVector<Color> *)p_array; +void GDAPI godot_packed_color_array_append_array(godot_packed_color_array *p_self, const godot_packed_color_array *p_array) { + Vector<Color> *self = (Vector<Color> *)p_self; + Vector<Color> *array = (Vector<Color> *)p_array; self->append_array(*array); } -godot_error GDAPI godot_pool_color_array_insert(godot_pool_color_array *p_self, const godot_int p_idx, const godot_color *p_data) { - PoolVector<Color> *self = (PoolVector<Color> *)p_self; +godot_error GDAPI godot_packed_color_array_insert(godot_packed_color_array *p_self, const godot_int p_idx, const godot_color *p_data) { + Vector<Color> *self = (Vector<Color> *)p_self; Color &s = *(Color *)p_data; return (godot_error)self->insert(p_idx, s); } -void GDAPI godot_pool_color_array_invert(godot_pool_color_array *p_self) { - PoolVector<Color> *self = (PoolVector<Color> *)p_self; +void GDAPI godot_packed_color_array_invert(godot_packed_color_array *p_self) { + Vector<Color> *self = (Vector<Color> *)p_self; self->invert(); } -void GDAPI godot_pool_color_array_push_back(godot_pool_color_array *p_self, const godot_color *p_data) { - PoolVector<Color> *self = (PoolVector<Color> *)p_self; +void GDAPI godot_packed_color_array_push_back(godot_packed_color_array *p_self, const godot_color *p_data) { + Vector<Color> *self = (Vector<Color> *)p_self; Color &s = *(Color *)p_data; self->push_back(s); } -void GDAPI godot_pool_color_array_remove(godot_pool_color_array *p_self, const godot_int p_idx) { - PoolVector<Color> *self = (PoolVector<Color> *)p_self; +void GDAPI godot_packed_color_array_remove(godot_packed_color_array *p_self, const godot_int p_idx) { + Vector<Color> *self = (Vector<Color> *)p_self; self->remove(p_idx); } -void GDAPI godot_pool_color_array_resize(godot_pool_color_array *p_self, const godot_int p_size) { - PoolVector<Color> *self = (PoolVector<Color> *)p_self; +void GDAPI godot_packed_color_array_resize(godot_packed_color_array *p_self, const godot_int p_size) { + Vector<Color> *self = (Vector<Color> *)p_self; self->resize(p_size); } -godot_pool_color_array_read_access GDAPI *godot_pool_color_array_read(const godot_pool_color_array *p_self) { - const PoolVector<Color> *self = (const PoolVector<Color> *)p_self; - return (godot_pool_color_array_read_access *)memnew(PoolVector<Color>::Read(self->read())); -} - -godot_pool_color_array_write_access GDAPI *godot_pool_color_array_write(godot_pool_color_array *p_self) { - PoolVector<Color> *self = (PoolVector<Color> *)p_self; - return (godot_pool_color_array_write_access *)memnew(PoolVector<Color>::Write(self->write())); -} - -void GDAPI godot_pool_color_array_set(godot_pool_color_array *p_self, const godot_int p_idx, const godot_color *p_data) { - PoolVector<Color> *self = (PoolVector<Color> *)p_self; +void GDAPI godot_packed_color_array_set(godot_packed_color_array *p_self, const godot_int p_idx, const godot_color *p_data) { + Vector<Color> *self = (Vector<Color> *)p_self; Color &s = *(Color *)p_data; self->set(p_idx, s); } -godot_color GDAPI godot_pool_color_array_get(const godot_pool_color_array *p_self, const godot_int p_idx) { - const PoolVector<Color> *self = (const PoolVector<Color> *)p_self; +godot_color GDAPI godot_packed_color_array_get(const godot_packed_color_array *p_self, const godot_int p_idx) { + const Vector<Color> *self = (const Vector<Color> *)p_self; godot_color v; Color *s = (Color *)&v; *s = self->get(p_idx); return v; } -godot_int GDAPI godot_pool_color_array_size(const godot_pool_color_array *p_self) { - const PoolVector<Color> *self = (const PoolVector<Color> *)p_self; +godot_int GDAPI godot_packed_color_array_size(const godot_packed_color_array *p_self) { + const Vector<Color> *self = (const Vector<Color> *)p_self; return self->size(); } -godot_bool GDAPI godot_pool_color_array_empty(const godot_pool_color_array *p_self) { - const PoolVector<Color> *self = (const PoolVector<Color> *)p_self; +godot_bool GDAPI godot_packed_color_array_empty(const godot_packed_color_array *p_self) { + const Vector<Color> *self = (const Vector<Color> *)p_self; return self->empty(); } -void GDAPI godot_pool_color_array_destroy(godot_pool_color_array *p_self) { - ((PoolVector<Color> *)p_self)->~PoolVector(); -} - -// -// read accessor functions -// - -godot_pool_byte_array_read_access GDAPI *godot_pool_byte_array_read_access_copy(const godot_pool_byte_array_read_access *p_other) { - PoolVector<uint8_t>::Read *other = (PoolVector<uint8_t>::Read *)p_other; - return (godot_pool_byte_array_read_access *)memnew(PoolVector<uint8_t>::Read(*other)); -} -const uint8_t GDAPI *godot_pool_byte_array_read_access_ptr(const godot_pool_byte_array_read_access *p_read) { - const PoolVector<uint8_t>::Read *read = (const PoolVector<uint8_t>::Read *)p_read; - return read->ptr(); -} -void GDAPI godot_pool_byte_array_read_access_operator_assign(godot_pool_byte_array_read_access *p_read, godot_pool_byte_array_read_access *p_other) { - PoolVector<uint8_t>::Read *read = (PoolVector<uint8_t>::Read *)p_read; - PoolVector<uint8_t>::Read *other = (PoolVector<uint8_t>::Read *)p_other; - read->operator=(*other); -} -void GDAPI godot_pool_byte_array_read_access_destroy(godot_pool_byte_array_read_access *p_read) { - memdelete((PoolVector<uint8_t>::Read *)p_read); -} - -godot_pool_int_array_read_access GDAPI *godot_pool_int_array_read_access_copy(const godot_pool_int_array_read_access *p_other) { - PoolVector<godot_int>::Read *other = (PoolVector<godot_int>::Read *)p_other; - return (godot_pool_int_array_read_access *)memnew(PoolVector<godot_int>::Read(*other)); -} -const godot_int GDAPI *godot_pool_int_array_read_access_ptr(const godot_pool_int_array_read_access *p_read) { - const PoolVector<godot_int>::Read *read = (const PoolVector<godot_int>::Read *)p_read; - return read->ptr(); -} -void GDAPI godot_pool_int_array_read_access_operator_assign(godot_pool_int_array_read_access *p_read, godot_pool_int_array_read_access *p_other) { - PoolVector<godot_int>::Read *read = (PoolVector<godot_int>::Read *)p_read; - PoolVector<godot_int>::Read *other = (PoolVector<godot_int>::Read *)p_other; - read->operator=(*other); -} -void GDAPI godot_pool_int_array_read_access_destroy(godot_pool_int_array_read_access *p_read) { - memdelete((PoolVector<godot_int>::Read *)p_read); -} - -godot_pool_real_array_read_access GDAPI *godot_pool_real_array_read_access_copy(const godot_pool_real_array_read_access *p_other) { - PoolVector<godot_real>::Read *other = (PoolVector<godot_real>::Read *)p_other; - return (godot_pool_real_array_read_access *)memnew(PoolVector<godot_real>::Read(*other)); -} -const godot_real GDAPI *godot_pool_real_array_read_access_ptr(const godot_pool_real_array_read_access *p_read) { - const PoolVector<godot_real>::Read *read = (const PoolVector<godot_real>::Read *)p_read; - return read->ptr(); -} -void GDAPI godot_pool_real_array_read_access_operator_assign(godot_pool_real_array_read_access *p_read, godot_pool_real_array_read_access *p_other) { - PoolVector<godot_real>::Read *read = (PoolVector<godot_real>::Read *)p_read; - PoolVector<godot_real>::Read *other = (PoolVector<godot_real>::Read *)p_other; - read->operator=(*other); -} -void GDAPI godot_pool_real_array_read_access_destroy(godot_pool_real_array_read_access *p_read) { - memdelete((PoolVector<godot_real>::Read *)p_read); -} - -godot_pool_string_array_read_access GDAPI *godot_pool_string_array_read_access_copy(const godot_pool_string_array_read_access *p_other) { - PoolVector<String>::Read *other = (PoolVector<String>::Read *)p_other; - return (godot_pool_string_array_read_access *)memnew(PoolVector<String>::Read(*other)); -} -const godot_string GDAPI *godot_pool_string_array_read_access_ptr(const godot_pool_string_array_read_access *p_read) { - const PoolVector<String>::Read *read = (const PoolVector<String>::Read *)p_read; - return (const godot_string *)read->ptr(); -} -void GDAPI godot_pool_string_array_read_access_operator_assign(godot_pool_string_array_read_access *p_read, godot_pool_string_array_read_access *p_other) { - PoolVector<String>::Read *read = (PoolVector<String>::Read *)p_read; - PoolVector<String>::Read *other = (PoolVector<String>::Read *)p_other; - read->operator=(*other); -} -void GDAPI godot_pool_string_array_read_access_destroy(godot_pool_string_array_read_access *p_read) { - memdelete((PoolVector<String>::Read *)p_read); -} - -godot_pool_vector2_array_read_access GDAPI *godot_pool_vector2_array_read_access_copy(const godot_pool_vector2_array_read_access *p_other) { - PoolVector<Vector2>::Read *other = (PoolVector<Vector2>::Read *)p_other; - return (godot_pool_vector2_array_read_access *)memnew(PoolVector<Vector2>::Read(*other)); -} -const godot_vector2 GDAPI *godot_pool_vector2_array_read_access_ptr(const godot_pool_vector2_array_read_access *p_read) { - const PoolVector<Vector2>::Read *read = (const PoolVector<Vector2>::Read *)p_read; - return (const godot_vector2 *)read->ptr(); -} -void GDAPI godot_pool_vector2_array_read_access_operator_assign(godot_pool_vector2_array_read_access *p_read, godot_pool_vector2_array_read_access *p_other) { - PoolVector<Vector2>::Read *read = (PoolVector<Vector2>::Read *)p_read; - PoolVector<Vector2>::Read *other = (PoolVector<Vector2>::Read *)p_other; - read->operator=(*other); -} -void GDAPI godot_pool_vector2_array_read_access_destroy(godot_pool_vector2_array_read_access *p_read) { - memdelete((PoolVector<Vector2>::Read *)p_read); -} - -godot_pool_vector3_array_read_access GDAPI *godot_pool_vector3_array_read_access_copy(const godot_pool_vector3_array_read_access *p_other) { - PoolVector<Vector3>::Read *other = (PoolVector<Vector3>::Read *)p_other; - return (godot_pool_vector3_array_read_access *)memnew(PoolVector<Vector3>::Read(*other)); -} -const godot_vector3 GDAPI *godot_pool_vector3_array_read_access_ptr(const godot_pool_vector3_array_read_access *p_read) { - const PoolVector<Vector3>::Read *read = (const PoolVector<Vector3>::Read *)p_read; - return (const godot_vector3 *)read->ptr(); -} -void GDAPI godot_pool_vector3_array_read_access_operator_assign(godot_pool_vector3_array_read_access *p_read, godot_pool_vector3_array_read_access *p_other) { - PoolVector<Vector3>::Read *read = (PoolVector<Vector3>::Read *)p_read; - PoolVector<Vector3>::Read *other = (PoolVector<Vector3>::Read *)p_other; - read->operator=(*other); -} -void GDAPI godot_pool_vector3_array_read_access_destroy(godot_pool_vector3_array_read_access *p_read) { - memdelete((PoolVector<Vector2>::Read *)p_read); -} - -godot_pool_color_array_read_access GDAPI *godot_pool_color_array_read_access_copy(const godot_pool_color_array_read_access *p_other) { - PoolVector<Color>::Read *other = (PoolVector<Color>::Read *)p_other; - return (godot_pool_color_array_read_access *)memnew(PoolVector<Color>::Read(*other)); -} -const godot_color GDAPI *godot_pool_color_array_read_access_ptr(const godot_pool_color_array_read_access *p_read) { - const PoolVector<Color>::Read *read = (const PoolVector<Color>::Read *)p_read; - return (const godot_color *)read->ptr(); -} -void GDAPI godot_pool_color_array_read_access_operator_assign(godot_pool_color_array_read_access *p_read, godot_pool_color_array_read_access *p_other) { - PoolVector<Color>::Read *read = (PoolVector<Color>::Read *)p_read; - PoolVector<Color>::Read *other = (PoolVector<Color>::Read *)p_other; - read->operator=(*other); -} -void GDAPI godot_pool_color_array_read_access_destroy(godot_pool_color_array_read_access *p_read) { - memdelete((PoolVector<Color>::Read *)p_read); -} - -// -// write accessor functions -// - -godot_pool_byte_array_write_access GDAPI *godot_pool_byte_array_write_access_copy(const godot_pool_byte_array_write_access *p_other) { - PoolVector<uint8_t>::Write *other = (PoolVector<uint8_t>::Write *)p_other; - return (godot_pool_byte_array_write_access *)memnew(PoolVector<uint8_t>::Write(*other)); -} -uint8_t GDAPI *godot_pool_byte_array_write_access_ptr(const godot_pool_byte_array_write_access *p_write) { - PoolVector<uint8_t>::Write *write = (PoolVector<uint8_t>::Write *)p_write; - return write->ptr(); -} -void GDAPI godot_pool_byte_array_write_access_operator_assign(godot_pool_byte_array_write_access *p_write, godot_pool_byte_array_write_access *p_other) { - PoolVector<uint8_t>::Write *write = (PoolVector<uint8_t>::Write *)p_write; - PoolVector<uint8_t>::Write *other = (PoolVector<uint8_t>::Write *)p_other; - write->operator=(*other); -} -void GDAPI godot_pool_byte_array_write_access_destroy(godot_pool_byte_array_write_access *p_write) { - memdelete((PoolVector<uint8_t>::Write *)p_write); -} - -godot_pool_int_array_write_access GDAPI *godot_pool_int_array_write_access_copy(const godot_pool_int_array_write_access *p_other) { - PoolVector<godot_int>::Write *other = (PoolVector<godot_int>::Write *)p_other; - return (godot_pool_int_array_write_access *)memnew(PoolVector<godot_int>::Write(*other)); -} -godot_int GDAPI *godot_pool_int_array_write_access_ptr(const godot_pool_int_array_write_access *p_write) { - PoolVector<godot_int>::Write *write = (PoolVector<godot_int>::Write *)p_write; - return write->ptr(); -} -void GDAPI godot_pool_int_array_write_access_operator_assign(godot_pool_int_array_write_access *p_write, godot_pool_int_array_write_access *p_other) { - PoolVector<godot_int>::Write *write = (PoolVector<godot_int>::Write *)p_write; - PoolVector<godot_int>::Write *other = (PoolVector<godot_int>::Write *)p_other; - write->operator=(*other); -} -void GDAPI godot_pool_int_array_write_access_destroy(godot_pool_int_array_write_access *p_write) { - memdelete((PoolVector<godot_int>::Write *)p_write); -} - -godot_pool_real_array_write_access GDAPI *godot_pool_real_array_write_access_copy(const godot_pool_real_array_write_access *p_other) { - PoolVector<godot_real>::Write *other = (PoolVector<godot_real>::Write *)p_other; - return (godot_pool_real_array_write_access *)memnew(PoolVector<godot_real>::Write(*other)); -} -godot_real GDAPI *godot_pool_real_array_write_access_ptr(const godot_pool_real_array_write_access *p_write) { - PoolVector<godot_real>::Write *write = (PoolVector<godot_real>::Write *)p_write; - return write->ptr(); -} -void GDAPI godot_pool_real_array_write_access_operator_assign(godot_pool_real_array_write_access *p_write, godot_pool_real_array_write_access *p_other) { - PoolVector<godot_real>::Write *write = (PoolVector<godot_real>::Write *)p_write; - PoolVector<godot_real>::Write *other = (PoolVector<godot_real>::Write *)p_other; - write->operator=(*other); -} -void GDAPI godot_pool_real_array_write_access_destroy(godot_pool_real_array_write_access *p_write) { - memdelete((PoolVector<godot_real>::Write *)p_write); -} - -godot_pool_string_array_write_access GDAPI *godot_pool_string_array_write_access_copy(const godot_pool_string_array_write_access *p_other) { - PoolVector<String>::Write *other = (PoolVector<String>::Write *)p_other; - return (godot_pool_string_array_write_access *)memnew(PoolVector<String>::Write(*other)); -} -godot_string GDAPI *godot_pool_string_array_write_access_ptr(const godot_pool_string_array_write_access *p_write) { - PoolVector<String>::Write *write = (PoolVector<String>::Write *)p_write; - return (godot_string *)write->ptr(); -} -void GDAPI godot_pool_string_array_write_access_operator_assign(godot_pool_string_array_write_access *p_write, godot_pool_string_array_write_access *p_other) { - PoolVector<String>::Write *write = (PoolVector<String>::Write *)p_write; - PoolVector<String>::Write *other = (PoolVector<String>::Write *)p_other; - write->operator=(*other); -} -void GDAPI godot_pool_string_array_write_access_destroy(godot_pool_string_array_write_access *p_write) { - memdelete((PoolVector<String>::Write *)p_write); -} - -godot_pool_vector2_array_write_access GDAPI *godot_pool_vector2_array_write_access_copy(const godot_pool_vector2_array_write_access *p_other) { - PoolVector<Vector2>::Write *other = (PoolVector<Vector2>::Write *)p_other; - return (godot_pool_vector2_array_write_access *)memnew(PoolVector<Vector2>::Write(*other)); -} -godot_vector2 GDAPI *godot_pool_vector2_array_write_access_ptr(const godot_pool_vector2_array_write_access *p_write) { - PoolVector<Vector2>::Write *write = (PoolVector<Vector2>::Write *)p_write; - return (godot_vector2 *)write->ptr(); -} -void GDAPI godot_pool_vector2_array_write_access_operator_assign(godot_pool_vector2_array_write_access *p_write, godot_pool_vector2_array_write_access *p_other) { - PoolVector<Vector2>::Write *write = (PoolVector<Vector2>::Write *)p_write; - PoolVector<Vector2>::Write *other = (PoolVector<Vector2>::Write *)p_other; - write->operator=(*other); -} -void GDAPI godot_pool_vector2_array_write_access_destroy(godot_pool_vector2_array_write_access *p_write) { - memdelete((PoolVector<Vector2>::Write *)p_write); -} - -godot_pool_vector3_array_write_access GDAPI *godot_pool_vector3_array_write_access_copy(const godot_pool_vector3_array_write_access *p_other) { - PoolVector<Vector3>::Write *other = (PoolVector<Vector3>::Write *)p_other; - return (godot_pool_vector3_array_write_access *)memnew(PoolVector<Vector3>::Write(*other)); -} -godot_vector3 GDAPI *godot_pool_vector3_array_write_access_ptr(const godot_pool_vector3_array_write_access *p_write) { - PoolVector<Vector3>::Write *write = (PoolVector<Vector3>::Write *)p_write; - return (godot_vector3 *)write->ptr(); -} -void GDAPI godot_pool_vector3_array_write_access_operator_assign(godot_pool_vector3_array_write_access *p_write, godot_pool_vector3_array_write_access *p_other) { - PoolVector<Vector3>::Write *write = (PoolVector<Vector3>::Write *)p_write; - PoolVector<Vector3>::Write *other = (PoolVector<Vector3>::Write *)p_other; - write->operator=(*other); -} -void GDAPI godot_pool_vector3_array_write_access_destroy(godot_pool_vector3_array_write_access *p_write) { - memdelete((PoolVector<Vector3>::Write *)p_write); -} - -godot_pool_color_array_write_access GDAPI *godot_pool_color_array_write_access_copy(const godot_pool_color_array_write_access *p_other) { - PoolVector<Color>::Write *other = (PoolVector<Color>::Write *)p_other; - return (godot_pool_color_array_write_access *)memnew(PoolVector<Color>::Write(*other)); -} -godot_color GDAPI *godot_pool_color_array_write_access_ptr(const godot_pool_color_array_write_access *p_write) { - PoolVector<Color>::Write *write = (PoolVector<Color>::Write *)p_write; - return (godot_color *)write->ptr(); -} -void GDAPI godot_pool_color_array_write_access_operator_assign(godot_pool_color_array_write_access *p_write, godot_pool_color_array_write_access *p_other) { - PoolVector<Color>::Write *write = (PoolVector<Color>::Write *)p_write; - PoolVector<Color>::Write *other = (PoolVector<Color>::Write *)p_other; - write->operator=(*other); -} -void GDAPI godot_pool_color_array_write_access_destroy(godot_pool_color_array_write_access *p_write) { - memdelete((PoolVector<Color>::Write *)p_write); +void GDAPI godot_packed_color_array_destroy(godot_packed_color_array *p_self) { + ((Vector<Color> *)p_self)->~Vector(); } #ifdef __cplusplus diff --git a/modules/gdnative/gdnative/string.cpp b/modules/gdnative/gdnative/string.cpp index 59901f6139..4cb55900b0 100644 --- a/modules/gdnative/gdnative/string.cpp +++ b/modules/gdnative/gdnative/string.cpp @@ -1030,14 +1030,14 @@ uint32_t GDAPI godot_string_hash_utf8_chars_with_len(const wchar_t *p_str, godot return String::hash(p_str, p_len); } -godot_pool_byte_array GDAPI godot_string_md5_buffer(const godot_string *p_self) { +godot_packed_byte_array GDAPI godot_string_md5_buffer(const godot_string *p_self) { const String *self = (const String *)p_self; Vector<uint8_t> tmp_result = self->md5_buffer(); - godot_pool_byte_array result; - memnew_placement(&result, PoolByteArray); - PoolByteArray *proxy = (PoolByteArray *)&result; - PoolByteArray::Write proxy_writer = proxy->write(); + godot_packed_byte_array result; + memnew_placement(&result, PackedByteArray); + PackedByteArray *proxy = (PackedByteArray *)&result; + uint8_t *proxy_writer = proxy->ptrw(); proxy->resize(tmp_result.size()); for (int i = 0; i < tmp_result.size(); i++) { @@ -1055,14 +1055,14 @@ godot_string GDAPI godot_string_md5_text(const godot_string *p_self) { return result; } -godot_pool_byte_array GDAPI godot_string_sha256_buffer(const godot_string *p_self) { +godot_packed_byte_array GDAPI godot_string_sha256_buffer(const godot_string *p_self) { const String *self = (const String *)p_self; Vector<uint8_t> tmp_result = self->sha256_buffer(); - godot_pool_byte_array result; - memnew_placement(&result, PoolByteArray); - PoolByteArray *proxy = (PoolByteArray *)&result; - PoolByteArray::Write proxy_writer = proxy->write(); + godot_packed_byte_array result; + memnew_placement(&result, PackedByteArray); + PackedByteArray *proxy = (PackedByteArray *)&result; + uint8_t *proxy_writer = proxy->ptrw(); proxy->resize(tmp_result.size()); for (int i = 0; i < tmp_result.size(); i++) { @@ -1343,15 +1343,15 @@ godot_string GDAPI godot_string_rstrip(const godot_string *p_self, const godot_s return result; } -godot_pool_string_array GDAPI godot_string_rsplit(const godot_string *p_self, const godot_string *p_divisor, +godot_packed_string_array GDAPI godot_string_rsplit(const godot_string *p_self, const godot_string *p_divisor, const godot_bool p_allow_empty, const godot_int p_maxsplit) { const String *self = (const String *)p_self; String *divisor = (String *)p_divisor; - godot_pool_string_array result; - memnew_placement(&result, PoolStringArray); - PoolStringArray *proxy = (PoolStringArray *)&result; - PoolStringArray::Write proxy_writer = proxy->write(); + godot_packed_string_array result; + memnew_placement(&result, PackedStringArray); + PackedStringArray *proxy = (PackedStringArray *)&result; + String *proxy_writer = proxy->ptrw(); Vector<String> tmp_result = self->rsplit(*divisor, p_allow_empty, p_maxsplit); proxy->resize(tmp_result.size()); diff --git a/modules/gdnative/gdnative/variant.cpp b/modules/gdnative/gdnative/variant.cpp index 33b378d9cc..176d5a0461 100644 --- a/modules/gdnative/gdnative/variant.cpp +++ b/modules/gdnative/gdnative/variant.cpp @@ -201,45 +201,45 @@ void GDAPI godot_variant_new_array(godot_variant *r_dest, const godot_array *p_a memnew_placement_custom(dest, Variant, Variant(*arr)); } -void GDAPI godot_variant_new_pool_byte_array(godot_variant *r_dest, const godot_pool_byte_array *p_pba) { +void GDAPI godot_variant_new_packed_byte_array(godot_variant *r_dest, const godot_packed_byte_array *p_pba) { Variant *dest = (Variant *)r_dest; - PoolByteArray *pba = (PoolByteArray *)p_pba; + PackedByteArray *pba = (PackedByteArray *)p_pba; memnew_placement_custom(dest, Variant, Variant(*pba)); } -void GDAPI godot_variant_new_pool_int_array(godot_variant *r_dest, const godot_pool_int_array *p_pia) { +void GDAPI godot_variant_new_packed_int_array(godot_variant *r_dest, const godot_packed_int_array *p_pia) { Variant *dest = (Variant *)r_dest; - PoolIntArray *pia = (PoolIntArray *)p_pia; + PackedIntArray *pia = (PackedIntArray *)p_pia; memnew_placement_custom(dest, Variant, Variant(*pia)); } -void GDAPI godot_variant_new_pool_real_array(godot_variant *r_dest, const godot_pool_real_array *p_pra) { +void GDAPI godot_variant_new_packed_real_array(godot_variant *r_dest, const godot_packed_real_array *p_pra) { Variant *dest = (Variant *)r_dest; - PoolRealArray *pra = (PoolRealArray *)p_pra; + PackedRealArray *pra = (PackedRealArray *)p_pra; memnew_placement_custom(dest, Variant, Variant(*pra)); } -void GDAPI godot_variant_new_pool_string_array(godot_variant *r_dest, const godot_pool_string_array *p_psa) { +void GDAPI godot_variant_new_packed_string_array(godot_variant *r_dest, const godot_packed_string_array *p_psa) { Variant *dest = (Variant *)r_dest; - PoolStringArray *psa = (PoolStringArray *)p_psa; + PackedStringArray *psa = (PackedStringArray *)p_psa; memnew_placement_custom(dest, Variant, Variant(*psa)); } -void GDAPI godot_variant_new_pool_vector2_array(godot_variant *r_dest, const godot_pool_vector2_array *p_pv2a) { +void GDAPI godot_variant_new_packed_vector2_array(godot_variant *r_dest, const godot_packed_vector2_array *p_pv2a) { Variant *dest = (Variant *)r_dest; - PoolVector2Array *pv2a = (PoolVector2Array *)p_pv2a; + PackedVector2Array *pv2a = (PackedVector2Array *)p_pv2a; memnew_placement_custom(dest, Variant, Variant(*pv2a)); } -void GDAPI godot_variant_new_pool_vector3_array(godot_variant *r_dest, const godot_pool_vector3_array *p_pv3a) { +void GDAPI godot_variant_new_packed_vector3_array(godot_variant *r_dest, const godot_packed_vector3_array *p_pv3a) { Variant *dest = (Variant *)r_dest; - PoolVector3Array *pv3a = (PoolVector3Array *)p_pv3a; + PackedVector3Array *pv3a = (PackedVector3Array *)p_pv3a; memnew_placement_custom(dest, Variant, Variant(*pv3a)); } -void GDAPI godot_variant_new_pool_color_array(godot_variant *r_dest, const godot_pool_color_array *p_pca) { +void GDAPI godot_variant_new_packed_color_array(godot_variant *r_dest, const godot_packed_color_array *p_pca) { Variant *dest = (Variant *)r_dest; - PoolColorArray *pca = (PoolColorArray *)p_pca; + PackedColorArray *pca = (PackedColorArray *)p_pca; memnew_placement_custom(dest, Variant, Variant(*pca)); } @@ -390,65 +390,65 @@ godot_array GDAPI godot_variant_as_array(const godot_variant *p_self) { return raw_dest; } -godot_pool_byte_array GDAPI godot_variant_as_pool_byte_array(const godot_variant *p_self) { - godot_pool_byte_array raw_dest; +godot_packed_byte_array GDAPI godot_variant_as_packed_byte_array(const godot_variant *p_self) { + godot_packed_byte_array raw_dest; const Variant *self = (const Variant *)p_self; - PoolByteArray *dest = (PoolByteArray *)&raw_dest; - memnew_placement(dest, PoolByteArray(self->operator PoolByteArray())); // operator = is overloaded by PoolByteArray + PackedByteArray *dest = (PackedByteArray *)&raw_dest; + memnew_placement(dest, PackedByteArray(self->operator PackedByteArray())); // operator = is overloaded by PackedByteArray *dest = *self; return raw_dest; } -godot_pool_int_array GDAPI godot_variant_as_pool_int_array(const godot_variant *p_self) { - godot_pool_int_array raw_dest; +godot_packed_int_array GDAPI godot_variant_as_packed_int_array(const godot_variant *p_self) { + godot_packed_int_array raw_dest; const Variant *self = (const Variant *)p_self; - PoolIntArray *dest = (PoolIntArray *)&raw_dest; - memnew_placement(dest, PoolIntArray(self->operator PoolIntArray())); // operator = is overloaded by PoolIntArray + PackedIntArray *dest = (PackedIntArray *)&raw_dest; + memnew_placement(dest, PackedIntArray(self->operator PackedIntArray())); // operator = is overloaded by PackedIntArray *dest = *self; return raw_dest; } -godot_pool_real_array GDAPI godot_variant_as_pool_real_array(const godot_variant *p_self) { - godot_pool_real_array raw_dest; +godot_packed_real_array GDAPI godot_variant_as_packed_real_array(const godot_variant *p_self) { + godot_packed_real_array raw_dest; const Variant *self = (const Variant *)p_self; - PoolRealArray *dest = (PoolRealArray *)&raw_dest; - memnew_placement(dest, PoolRealArray(self->operator PoolRealArray())); // operator = is overloaded by PoolRealArray + PackedRealArray *dest = (PackedRealArray *)&raw_dest; + memnew_placement(dest, PackedRealArray(self->operator PackedRealArray())); // operator = is overloaded by PackedRealArray *dest = *self; return raw_dest; } -godot_pool_string_array GDAPI godot_variant_as_pool_string_array(const godot_variant *p_self) { - godot_pool_string_array raw_dest; +godot_packed_string_array GDAPI godot_variant_as_packed_string_array(const godot_variant *p_self) { + godot_packed_string_array raw_dest; const Variant *self = (const Variant *)p_self; - PoolStringArray *dest = (PoolStringArray *)&raw_dest; - memnew_placement(dest, PoolStringArray(self->operator PoolStringArray())); // operator = is overloaded by PoolStringArray + PackedStringArray *dest = (PackedStringArray *)&raw_dest; + memnew_placement(dest, PackedStringArray(self->operator PackedStringArray())); // operator = is overloaded by PackedStringArray *dest = *self; return raw_dest; } -godot_pool_vector2_array GDAPI godot_variant_as_pool_vector2_array(const godot_variant *p_self) { - godot_pool_vector2_array raw_dest; +godot_packed_vector2_array GDAPI godot_variant_as_packed_vector2_array(const godot_variant *p_self) { + godot_packed_vector2_array raw_dest; const Variant *self = (const Variant *)p_self; - PoolVector2Array *dest = (PoolVector2Array *)&raw_dest; - memnew_placement(dest, PoolVector2Array(self->operator PoolVector2Array())); // operator = is overloaded by PoolVector2Array + PackedVector2Array *dest = (PackedVector2Array *)&raw_dest; + memnew_placement(dest, PackedVector2Array(self->operator PackedVector2Array())); // operator = is overloaded by PackedVector2Array *dest = *self; return raw_dest; } -godot_pool_vector3_array GDAPI godot_variant_as_pool_vector3_array(const godot_variant *p_self) { - godot_pool_vector3_array raw_dest; +godot_packed_vector3_array GDAPI godot_variant_as_packed_vector3_array(const godot_variant *p_self) { + godot_packed_vector3_array raw_dest; const Variant *self = (const Variant *)p_self; - PoolVector3Array *dest = (PoolVector3Array *)&raw_dest; - memnew_placement(dest, PoolVector3Array(self->operator PoolVector3Array())); // operator = is overloaded by PoolVector3Array + PackedVector3Array *dest = (PackedVector3Array *)&raw_dest; + memnew_placement(dest, PackedVector3Array(self->operator PackedVector3Array())); // operator = is overloaded by PackedVector3Array *dest = *self; return raw_dest; } -godot_pool_color_array GDAPI godot_variant_as_pool_color_array(const godot_variant *p_self) { - godot_pool_color_array raw_dest; +godot_packed_color_array GDAPI godot_variant_as_packed_color_array(const godot_variant *p_self) { + godot_packed_color_array raw_dest; const Variant *self = (const Variant *)p_self; - PoolColorArray *dest = (PoolColorArray *)&raw_dest; - memnew_placement(dest, PoolColorArray(self->operator PoolColorArray())); // operator = is overloaded by PoolColorArray + PackedColorArray *dest = (PackedColorArray *)&raw_dest; + memnew_placement(dest, PackedColorArray(self->operator PackedColorArray())); // operator = is overloaded by PackedColorArray *dest = *self; return raw_dest; } diff --git a/modules/gdnative/gdnative_api.json b/modules/gdnative/gdnative_api.json index 6004b07965..e1d6c0c867 100644 --- a/modules/gdnative/gdnative_api.json +++ b/modules/gdnative/gdnative_api.json @@ -93,52 +93,52 @@ ] }, { - "name": "godot_pool_byte_array_empty", + "name": "godot_packed_byte_array_empty", "return_type": "godot_bool", "arguments": [ - ["const godot_pool_byte_array *", "p_self"] + ["const godot_packed_byte_array *", "p_self"] ] }, { - "name": "godot_pool_int_array_empty", + "name": "godot_packed_int_array_empty", "return_type": "godot_bool", "arguments": [ - ["const godot_pool_int_array *", "p_self"] + ["const godot_packed_int_array *", "p_self"] ] }, { - "name": "godot_pool_real_array_empty", + "name": "godot_packed_real_array_empty", "return_type": "godot_bool", "arguments": [ - ["const godot_pool_real_array *", "p_self"] + ["const godot_packed_real_array *", "p_self"] ] }, { - "name": "godot_pool_string_array_empty", + "name": "godot_packed_string_array_empty", "return_type": "godot_bool", "arguments": [ - ["const godot_pool_string_array *", "p_self"] + ["const godot_packed_string_array *", "p_self"] ] }, { - "name": "godot_pool_vector2_array_empty", + "name": "godot_packed_vector2_array_empty", "return_type": "godot_bool", "arguments": [ - ["const godot_pool_vector2_array *", "p_self"] + ["const godot_packed_vector2_array *", "p_self"] ] }, { - "name": "godot_pool_vector3_array_empty", + "name": "godot_packed_vector3_array_empty", "return_type": "godot_bool", "arguments": [ - ["const godot_pool_vector3_array *", "p_self"] + ["const godot_packed_vector3_array *", "p_self"] ] }, { - "name": "godot_pool_color_array_empty", + "name": "godot_packed_color_array_empty", "return_type": "godot_bool", "arguments": [ - ["const godot_pool_color_array *", "p_self"] + ["const godot_packed_color_array *", "p_self"] ] }, { @@ -352,7 +352,7 @@ }, { "name": "godot_string_rsplit", - "return_type": "godot_pool_string_array", + "return_type": "godot_packed_string_array", "arguments": [ ["const godot_string *", "p_self"], ["const godot_string *", "p_divisor"], @@ -1657,1277 +1657,773 @@ ] }, { - "name": "godot_pool_byte_array_new", + "name": "godot_packed_byte_array_new", "return_type": "void", "arguments": [ - ["godot_pool_byte_array *", "r_dest"] + ["godot_packed_byte_array *", "r_dest"] ] }, { - "name": "godot_pool_byte_array_new_copy", + "name": "godot_packed_byte_array_new_copy", "return_type": "void", "arguments": [ - ["godot_pool_byte_array *", "r_dest"], - ["const godot_pool_byte_array *", "p_src"] + ["godot_packed_byte_array *", "r_dest"], + ["const godot_packed_byte_array *", "p_src"] ] }, { - "name": "godot_pool_byte_array_new_with_array", + "name": "godot_packed_byte_array_new_with_array", "return_type": "void", "arguments": [ - ["godot_pool_byte_array *", "r_dest"], + ["godot_packed_byte_array *", "r_dest"], ["const godot_array *", "p_a"] ] }, { - "name": "godot_pool_byte_array_append", + "name": "godot_packed_byte_array_append", "return_type": "void", "arguments": [ - ["godot_pool_byte_array *", "p_self"], + ["godot_packed_byte_array *", "p_self"], ["const uint8_t", "p_data"] ] }, { - "name": "godot_pool_byte_array_append_array", + "name": "godot_packed_byte_array_append_array", "return_type": "void", "arguments": [ - ["godot_pool_byte_array *", "p_self"], - ["const godot_pool_byte_array *", "p_array"] + ["godot_packed_byte_array *", "p_self"], + ["const godot_packed_byte_array *", "p_array"] ] }, { - "name": "godot_pool_byte_array_insert", + "name": "godot_packed_byte_array_insert", "return_type": "godot_error", "arguments": [ - ["godot_pool_byte_array *", "p_self"], + ["godot_packed_byte_array *", "p_self"], ["const godot_int", "p_idx"], ["const uint8_t", "p_data"] ] }, { - "name": "godot_pool_byte_array_invert", + "name": "godot_packed_byte_array_invert", "return_type": "void", "arguments": [ - ["godot_pool_byte_array *", "p_self"] + ["godot_packed_byte_array *", "p_self"] ] }, { - "name": "godot_pool_byte_array_push_back", + "name": "godot_packed_byte_array_push_back", "return_type": "void", "arguments": [ - ["godot_pool_byte_array *", "p_self"], + ["godot_packed_byte_array *", "p_self"], ["const uint8_t", "p_data"] ] }, { - "name": "godot_pool_byte_array_remove", + "name": "godot_packed_byte_array_remove", "return_type": "void", "arguments": [ - ["godot_pool_byte_array *", "p_self"], + ["godot_packed_byte_array *", "p_self"], ["const godot_int", "p_idx"] ] }, { - "name": "godot_pool_byte_array_resize", + "name": "godot_packed_byte_array_resize", "return_type": "void", "arguments": [ - ["godot_pool_byte_array *", "p_self"], + ["godot_packed_byte_array *", "p_self"], ["const godot_int", "p_size"] ] }, { - "name": "godot_pool_byte_array_read", - "return_type": "godot_pool_byte_array_read_access *", - "arguments": [ - ["const godot_pool_byte_array *", "p_self"] - ] - }, - { - "name": "godot_pool_byte_array_write", - "return_type": "godot_pool_byte_array_write_access *", - "arguments": [ - ["godot_pool_byte_array *", "p_self"] - ] - }, - { - "name": "godot_pool_byte_array_set", + "name": "godot_packed_byte_array_set", "return_type": "void", "arguments": [ - ["godot_pool_byte_array *", "p_self"], + ["godot_packed_byte_array *", "p_self"], ["const godot_int", "p_idx"], ["const uint8_t", "p_data"] ] }, { - "name": "godot_pool_byte_array_get", + "name": "godot_packed_byte_array_get", "return_type": "uint8_t", "arguments": [ - ["const godot_pool_byte_array *", "p_self"], + ["const godot_packed_byte_array *", "p_self"], ["const godot_int", "p_idx"] ] }, { - "name": "godot_pool_byte_array_size", + "name": "godot_packed_byte_array_size", "return_type": "godot_int", "arguments": [ - ["const godot_pool_byte_array *", "p_self"] + ["const godot_packed_byte_array *", "p_self"] ] }, { - "name": "godot_pool_byte_array_destroy", + "name": "godot_packed_byte_array_destroy", "return_type": "void", "arguments": [ - ["godot_pool_byte_array *", "p_self"] + ["godot_packed_byte_array *", "p_self"] ] }, { - "name": "godot_pool_int_array_new", + "name": "godot_packed_int_array_new", "return_type": "void", "arguments": [ - ["godot_pool_int_array *", "r_dest"] + ["godot_packed_int_array *", "r_dest"] ] }, { - "name": "godot_pool_int_array_new_copy", + "name": "godot_packed_int_array_new_copy", "return_type": "void", "arguments": [ - ["godot_pool_int_array *", "r_dest"], - ["const godot_pool_int_array *", "p_src"] + ["godot_packed_int_array *", "r_dest"], + ["const godot_packed_int_array *", "p_src"] ] }, { - "name": "godot_pool_int_array_new_with_array", + "name": "godot_packed_int_array_new_with_array", "return_type": "void", "arguments": [ - ["godot_pool_int_array *", "r_dest"], + ["godot_packed_int_array *", "r_dest"], ["const godot_array *", "p_a"] ] }, { - "name": "godot_pool_int_array_append", + "name": "godot_packed_int_array_append", "return_type": "void", "arguments": [ - ["godot_pool_int_array *", "p_self"], + ["godot_packed_int_array *", "p_self"], ["const godot_int", "p_data"] ] }, { - "name": "godot_pool_int_array_append_array", + "name": "godot_packed_int_array_append_array", "return_type": "void", "arguments": [ - ["godot_pool_int_array *", "p_self"], - ["const godot_pool_int_array *", "p_array"] + ["godot_packed_int_array *", "p_self"], + ["const godot_packed_int_array *", "p_array"] ] }, { - "name": "godot_pool_int_array_insert", + "name": "godot_packed_int_array_insert", "return_type": "godot_error", "arguments": [ - ["godot_pool_int_array *", "p_self"], + ["godot_packed_int_array *", "p_self"], ["const godot_int", "p_idx"], ["const godot_int", "p_data"] ] }, { - "name": "godot_pool_int_array_invert", + "name": "godot_packed_int_array_invert", "return_type": "void", "arguments": [ - ["godot_pool_int_array *", "p_self"] + ["godot_packed_int_array *", "p_self"] ] }, { - "name": "godot_pool_int_array_push_back", + "name": "godot_packed_int_array_push_back", "return_type": "void", "arguments": [ - ["godot_pool_int_array *", "p_self"], + ["godot_packed_int_array *", "p_self"], ["const godot_int", "p_data"] ] }, { - "name": "godot_pool_int_array_remove", + "name": "godot_packed_int_array_remove", "return_type": "void", "arguments": [ - ["godot_pool_int_array *", "p_self"], + ["godot_packed_int_array *", "p_self"], ["const godot_int", "p_idx"] ] }, { - "name": "godot_pool_int_array_resize", + "name": "godot_packed_int_array_resize", "return_type": "void", "arguments": [ - ["godot_pool_int_array *", "p_self"], + ["godot_packed_int_array *", "p_self"], ["const godot_int", "p_size"] ] }, { - "name": "godot_pool_int_array_read", - "return_type": "godot_pool_int_array_read_access *", - "arguments": [ - ["const godot_pool_int_array *", "p_self"] - ] - }, - { - "name": "godot_pool_int_array_write", - "return_type": "godot_pool_int_array_write_access *", - "arguments": [ - ["godot_pool_int_array *", "p_self"] - ] - }, - { - "name": "godot_pool_int_array_set", + "name": "godot_packed_int_array_set", "return_type": "void", "arguments": [ - ["godot_pool_int_array *", "p_self"], + ["godot_packed_int_array *", "p_self"], ["const godot_int", "p_idx"], ["const godot_int", "p_data"] ] }, { - "name": "godot_pool_int_array_get", + "name": "godot_packed_int_array_get", "return_type": "godot_int", "arguments": [ - ["const godot_pool_int_array *", "p_self"], + ["const godot_packed_int_array *", "p_self"], ["const godot_int", "p_idx"] ] }, { - "name": "godot_pool_int_array_size", + "name": "godot_packed_int_array_size", "return_type": "godot_int", "arguments": [ - ["const godot_pool_int_array *", "p_self"] + ["const godot_packed_int_array *", "p_self"] ] }, { - "name": "godot_pool_int_array_destroy", + "name": "godot_packed_int_array_destroy", "return_type": "void", "arguments": [ - ["godot_pool_int_array *", "p_self"] + ["godot_packed_int_array *", "p_self"] ] }, { - "name": "godot_pool_real_array_new", + "name": "godot_packed_real_array_new", "return_type": "void", "arguments": [ - ["godot_pool_real_array *", "r_dest"] + ["godot_packed_real_array *", "r_dest"] ] }, { - "name": "godot_pool_real_array_new_copy", + "name": "godot_packed_real_array_new_copy", "return_type": "void", "arguments": [ - ["godot_pool_real_array *", "r_dest"], - ["const godot_pool_real_array *", "p_src"] + ["godot_packed_real_array *", "r_dest"], + ["const godot_packed_real_array *", "p_src"] ] }, { - "name": "godot_pool_real_array_new_with_array", + "name": "godot_packed_real_array_new_with_array", "return_type": "void", "arguments": [ - ["godot_pool_real_array *", "r_dest"], + ["godot_packed_real_array *", "r_dest"], ["const godot_array *", "p_a"] ] }, { - "name": "godot_pool_real_array_append", + "name": "godot_packed_real_array_append", "return_type": "void", "arguments": [ - ["godot_pool_real_array *", "p_self"], + ["godot_packed_real_array *", "p_self"], ["const godot_real", "p_data"] ] }, { - "name": "godot_pool_real_array_append_array", + "name": "godot_packed_real_array_append_array", "return_type": "void", "arguments": [ - ["godot_pool_real_array *", "p_self"], - ["const godot_pool_real_array *", "p_array"] + ["godot_packed_real_array *", "p_self"], + ["const godot_packed_real_array *", "p_array"] ] }, { - "name": "godot_pool_real_array_insert", + "name": "godot_packed_real_array_insert", "return_type": "godot_error", "arguments": [ - ["godot_pool_real_array *", "p_self"], + ["godot_packed_real_array *", "p_self"], ["const godot_int", "p_idx"], ["const godot_real", "p_data"] ] }, { - "name": "godot_pool_real_array_invert", + "name": "godot_packed_real_array_invert", "return_type": "void", "arguments": [ - ["godot_pool_real_array *", "p_self"] + ["godot_packed_real_array *", "p_self"] ] }, { - "name": "godot_pool_real_array_push_back", + "name": "godot_packed_real_array_push_back", "return_type": "void", "arguments": [ - ["godot_pool_real_array *", "p_self"], + ["godot_packed_real_array *", "p_self"], ["const godot_real", "p_data"] ] }, { - "name": "godot_pool_real_array_remove", + "name": "godot_packed_real_array_remove", "return_type": "void", "arguments": [ - ["godot_pool_real_array *", "p_self"], + ["godot_packed_real_array *", "p_self"], ["const godot_int", "p_idx"] ] }, { - "name": "godot_pool_real_array_resize", + "name": "godot_packed_real_array_resize", "return_type": "void", "arguments": [ - ["godot_pool_real_array *", "p_self"], + ["godot_packed_real_array *", "p_self"], ["const godot_int", "p_size"] ] }, { - "name": "godot_pool_real_array_read", - "return_type": "godot_pool_real_array_read_access *", - "arguments": [ - ["const godot_pool_real_array *", "p_self"] - ] - }, - { - "name": "godot_pool_real_array_write", - "return_type": "godot_pool_real_array_write_access *", - "arguments": [ - ["godot_pool_real_array *", "p_self"] - ] - }, - { - "name": "godot_pool_real_array_set", + "name": "godot_packed_real_array_set", "return_type": "void", "arguments": [ - ["godot_pool_real_array *", "p_self"], + ["godot_packed_real_array *", "p_self"], ["const godot_int", "p_idx"], ["const godot_real", "p_data"] ] }, { - "name": "godot_pool_real_array_get", + "name": "godot_packed_real_array_get", "return_type": "godot_real", "arguments": [ - ["const godot_pool_real_array *", "p_self"], + ["const godot_packed_real_array *", "p_self"], ["const godot_int", "p_idx"] ] }, { - "name": "godot_pool_real_array_size", + "name": "godot_packed_real_array_size", "return_type": "godot_int", "arguments": [ - ["const godot_pool_real_array *", "p_self"] + ["const godot_packed_real_array *", "p_self"] ] }, { - "name": "godot_pool_real_array_destroy", + "name": "godot_packed_real_array_destroy", "return_type": "void", "arguments": [ - ["godot_pool_real_array *", "p_self"] + ["godot_packed_real_array *", "p_self"] ] }, { - "name": "godot_pool_string_array_new", + "name": "godot_packed_string_array_new", "return_type": "void", "arguments": [ - ["godot_pool_string_array *", "r_dest"] + ["godot_packed_string_array *", "r_dest"] ] }, { - "name": "godot_pool_string_array_new_copy", + "name": "godot_packed_string_array_new_copy", "return_type": "void", "arguments": [ - ["godot_pool_string_array *", "r_dest"], - ["const godot_pool_string_array *", "p_src"] + ["godot_packed_string_array *", "r_dest"], + ["const godot_packed_string_array *", "p_src"] ] }, { - "name": "godot_pool_string_array_new_with_array", + "name": "godot_packed_string_array_new_with_array", "return_type": "void", "arguments": [ - ["godot_pool_string_array *", "r_dest"], + ["godot_packed_string_array *", "r_dest"], ["const godot_array *", "p_a"] ] }, { - "name": "godot_pool_string_array_append", + "name": "godot_packed_string_array_append", "return_type": "void", "arguments": [ - ["godot_pool_string_array *", "p_self"], + ["godot_packed_string_array *", "p_self"], ["const godot_string *", "p_data"] ] }, { - "name": "godot_pool_string_array_append_array", + "name": "godot_packed_string_array_append_array", "return_type": "void", "arguments": [ - ["godot_pool_string_array *", "p_self"], - ["const godot_pool_string_array *", "p_array"] + ["godot_packed_string_array *", "p_self"], + ["const godot_packed_string_array *", "p_array"] ] }, { - "name": "godot_pool_string_array_insert", + "name": "godot_packed_string_array_insert", "return_type": "godot_error", "arguments": [ - ["godot_pool_string_array *", "p_self"], + ["godot_packed_string_array *", "p_self"], ["const godot_int", "p_idx"], ["const godot_string *", "p_data"] ] }, { - "name": "godot_pool_string_array_invert", + "name": "godot_packed_string_array_invert", "return_type": "void", "arguments": [ - ["godot_pool_string_array *", "p_self"] + ["godot_packed_string_array *", "p_self"] ] }, { - "name": "godot_pool_string_array_push_back", + "name": "godot_packed_string_array_push_back", "return_type": "void", "arguments": [ - ["godot_pool_string_array *", "p_self"], + ["godot_packed_string_array *", "p_self"], ["const godot_string *", "p_data"] ] }, { - "name": "godot_pool_string_array_remove", + "name": "godot_packed_string_array_remove", "return_type": "void", "arguments": [ - ["godot_pool_string_array *", "p_self"], + ["godot_packed_string_array *", "p_self"], ["const godot_int", "p_idx"] ] }, { - "name": "godot_pool_string_array_resize", + "name": "godot_packed_string_array_resize", "return_type": "void", "arguments": [ - ["godot_pool_string_array *", "p_self"], + ["godot_packed_string_array *", "p_self"], ["const godot_int", "p_size"] ] }, { - "name": "godot_pool_string_array_read", - "return_type": "godot_pool_string_array_read_access *", - "arguments": [ - ["const godot_pool_string_array *", "p_self"] - ] - }, - { - "name": "godot_pool_string_array_write", - "return_type": "godot_pool_string_array_write_access *", - "arguments": [ - ["godot_pool_string_array *", "p_self"] - ] - }, - { - "name": "godot_pool_string_array_set", + "name": "godot_packed_string_array_set", "return_type": "void", "arguments": [ - ["godot_pool_string_array *", "p_self"], + ["godot_packed_string_array *", "p_self"], ["const godot_int", "p_idx"], ["const godot_string *", "p_data"] ] }, { - "name": "godot_pool_string_array_get", + "name": "godot_packed_string_array_get", "return_type": "godot_string", "arguments": [ - ["const godot_pool_string_array *", "p_self"], + ["const godot_packed_string_array *", "p_self"], ["const godot_int", "p_idx"] ] }, { - "name": "godot_pool_string_array_size", + "name": "godot_packed_string_array_size", "return_type": "godot_int", "arguments": [ - ["const godot_pool_string_array *", "p_self"] + ["const godot_packed_string_array *", "p_self"] ] }, { - "name": "godot_pool_string_array_destroy", + "name": "godot_packed_string_array_destroy", "return_type": "void", "arguments": [ - ["godot_pool_string_array *", "p_self"] + ["godot_packed_string_array *", "p_self"] ] }, { - "name": "godot_pool_vector2_array_new", + "name": "godot_packed_vector2_array_new", "return_type": "void", "arguments": [ - ["godot_pool_vector2_array *", "r_dest"] + ["godot_packed_vector2_array *", "r_dest"] ] }, { - "name": "godot_pool_vector2_array_new_copy", + "name": "godot_packed_vector2_array_new_copy", "return_type": "void", "arguments": [ - ["godot_pool_vector2_array *", "r_dest"], - ["const godot_pool_vector2_array *", "p_src"] + ["godot_packed_vector2_array *", "r_dest"], + ["const godot_packed_vector2_array *", "p_src"] ] }, { - "name": "godot_pool_vector2_array_new_with_array", + "name": "godot_packed_vector2_array_new_with_array", "return_type": "void", "arguments": [ - ["godot_pool_vector2_array *", "r_dest"], + ["godot_packed_vector2_array *", "r_dest"], ["const godot_array *", "p_a"] ] }, { - "name": "godot_pool_vector2_array_append", + "name": "godot_packed_vector2_array_append", "return_type": "void", "arguments": [ - ["godot_pool_vector2_array *", "p_self"], + ["godot_packed_vector2_array *", "p_self"], ["const godot_vector2 *", "p_data"] ] }, { - "name": "godot_pool_vector2_array_append_array", + "name": "godot_packed_vector2_array_append_array", "return_type": "void", "arguments": [ - ["godot_pool_vector2_array *", "p_self"], - ["const godot_pool_vector2_array *", "p_array"] + ["godot_packed_vector2_array *", "p_self"], + ["const godot_packed_vector2_array *", "p_array"] ] }, { - "name": "godot_pool_vector2_array_insert", + "name": "godot_packed_vector2_array_insert", "return_type": "godot_error", "arguments": [ - ["godot_pool_vector2_array *", "p_self"], + ["godot_packed_vector2_array *", "p_self"], ["const godot_int", "p_idx"], ["const godot_vector2 *", "p_data"] ] }, { - "name": "godot_pool_vector2_array_invert", + "name": "godot_packed_vector2_array_invert", "return_type": "void", "arguments": [ - ["godot_pool_vector2_array *", "p_self"] + ["godot_packed_vector2_array *", "p_self"] ] }, { - "name": "godot_pool_vector2_array_push_back", + "name": "godot_packed_vector2_array_push_back", "return_type": "void", "arguments": [ - ["godot_pool_vector2_array *", "p_self"], + ["godot_packed_vector2_array *", "p_self"], ["const godot_vector2 *", "p_data"] ] }, { - "name": "godot_pool_vector2_array_remove", + "name": "godot_packed_vector2_array_remove", "return_type": "void", "arguments": [ - ["godot_pool_vector2_array *", "p_self"], + ["godot_packed_vector2_array *", "p_self"], ["const godot_int", "p_idx"] ] }, { - "name": "godot_pool_vector2_array_resize", + "name": "godot_packed_vector2_array_resize", "return_type": "void", "arguments": [ - ["godot_pool_vector2_array *", "p_self"], + ["godot_packed_vector2_array *", "p_self"], ["const godot_int", "p_size"] ] }, { - "name": "godot_pool_vector2_array_read", - "return_type": "godot_pool_vector2_array_read_access *", - "arguments": [ - ["const godot_pool_vector2_array *", "p_self"] - ] - }, - { - "name": "godot_pool_vector2_array_write", - "return_type": "godot_pool_vector2_array_write_access *", - "arguments": [ - ["godot_pool_vector2_array *", "p_self"] - ] - }, - { - "name": "godot_pool_vector2_array_set", + "name": "godot_packed_vector2_array_set", "return_type": "void", "arguments": [ - ["godot_pool_vector2_array *", "p_self"], + ["godot_packed_vector2_array *", "p_self"], ["const godot_int", "p_idx"], ["const godot_vector2 *", "p_data"] ] }, { - "name": "godot_pool_vector2_array_get", + "name": "godot_packed_vector2_array_get", "return_type": "godot_vector2", "arguments": [ - ["const godot_pool_vector2_array *", "p_self"], + ["const godot_packed_vector2_array *", "p_self"], ["const godot_int", "p_idx"] ] }, { - "name": "godot_pool_vector2_array_size", + "name": "godot_packed_vector2_array_size", "return_type": "godot_int", "arguments": [ - ["const godot_pool_vector2_array *", "p_self"] + ["const godot_packed_vector2_array *", "p_self"] ] }, { - "name": "godot_pool_vector2_array_destroy", + "name": "godot_packed_vector2_array_destroy", "return_type": "void", "arguments": [ - ["godot_pool_vector2_array *", "p_self"] + ["godot_packed_vector2_array *", "p_self"] ] }, { - "name": "godot_pool_vector3_array_new", + "name": "godot_packed_vector3_array_new", "return_type": "void", "arguments": [ - ["godot_pool_vector3_array *", "r_dest"] + ["godot_packed_vector3_array *", "r_dest"] ] }, { - "name": "godot_pool_vector3_array_new_copy", + "name": "godot_packed_vector3_array_new_copy", "return_type": "void", "arguments": [ - ["godot_pool_vector3_array *", "r_dest"], - ["const godot_pool_vector3_array *", "p_src"] + ["godot_packed_vector3_array *", "r_dest"], + ["const godot_packed_vector3_array *", "p_src"] ] }, { - "name": "godot_pool_vector3_array_new_with_array", + "name": "godot_packed_vector3_array_new_with_array", "return_type": "void", "arguments": [ - ["godot_pool_vector3_array *", "r_dest"], + ["godot_packed_vector3_array *", "r_dest"], ["const godot_array *", "p_a"] ] }, { - "name": "godot_pool_vector3_array_append", + "name": "godot_packed_vector3_array_append", "return_type": "void", "arguments": [ - ["godot_pool_vector3_array *", "p_self"], + ["godot_packed_vector3_array *", "p_self"], ["const godot_vector3 *", "p_data"] ] }, { - "name": "godot_pool_vector3_array_append_array", + "name": "godot_packed_vector3_array_append_array", "return_type": "void", "arguments": [ - ["godot_pool_vector3_array *", "p_self"], - ["const godot_pool_vector3_array *", "p_array"] + ["godot_packed_vector3_array *", "p_self"], + ["const godot_packed_vector3_array *", "p_array"] ] }, { - "name": "godot_pool_vector3_array_insert", + "name": "godot_packed_vector3_array_insert", "return_type": "godot_error", "arguments": [ - ["godot_pool_vector3_array *", "p_self"], + ["godot_packed_vector3_array *", "p_self"], ["const godot_int", "p_idx"], ["const godot_vector3 *", "p_data"] ] }, { - "name": "godot_pool_vector3_array_invert", + "name": "godot_packed_vector3_array_invert", "return_type": "void", "arguments": [ - ["godot_pool_vector3_array *", "p_self"] + ["godot_packed_vector3_array *", "p_self"] ] }, { - "name": "godot_pool_vector3_array_push_back", + "name": "godot_packed_vector3_array_push_back", "return_type": "void", "arguments": [ - ["godot_pool_vector3_array *", "p_self"], + ["godot_packed_vector3_array *", "p_self"], ["const godot_vector3 *", "p_data"] ] }, { - "name": "godot_pool_vector3_array_remove", + "name": "godot_packed_vector3_array_remove", "return_type": "void", "arguments": [ - ["godot_pool_vector3_array *", "p_self"], + ["godot_packed_vector3_array *", "p_self"], ["const godot_int", "p_idx"] ] }, { - "name": "godot_pool_vector3_array_resize", + "name": "godot_packed_vector3_array_resize", "return_type": "void", "arguments": [ - ["godot_pool_vector3_array *", "p_self"], + ["godot_packed_vector3_array *", "p_self"], ["const godot_int", "p_size"] ] }, { - "name": "godot_pool_vector3_array_read", - "return_type": "godot_pool_vector3_array_read_access *", - "arguments": [ - ["const godot_pool_vector3_array *", "p_self"] - ] - }, - { - "name": "godot_pool_vector3_array_write", - "return_type": "godot_pool_vector3_array_write_access *", - "arguments": [ - ["godot_pool_vector3_array *", "p_self"] - ] - }, - { - "name": "godot_pool_vector3_array_set", + "name": "godot_packed_vector3_array_set", "return_type": "void", "arguments": [ - ["godot_pool_vector3_array *", "p_self"], + ["godot_packed_vector3_array *", "p_self"], ["const godot_int", "p_idx"], ["const godot_vector3 *", "p_data"] ] }, { - "name": "godot_pool_vector3_array_get", + "name": "godot_packed_vector3_array_get", "return_type": "godot_vector3", "arguments": [ - ["const godot_pool_vector3_array *", "p_self"], + ["const godot_packed_vector3_array *", "p_self"], ["const godot_int", "p_idx"] ] }, { - "name": "godot_pool_vector3_array_size", + "name": "godot_packed_vector3_array_size", "return_type": "godot_int", "arguments": [ - ["const godot_pool_vector3_array *", "p_self"] + ["const godot_packed_vector3_array *", "p_self"] ] }, { - "name": "godot_pool_vector3_array_destroy", + "name": "godot_packed_vector3_array_destroy", "return_type": "void", "arguments": [ - ["godot_pool_vector3_array *", "p_self"] + ["godot_packed_vector3_array *", "p_self"] ] }, { - "name": "godot_pool_color_array_new", + "name": "godot_packed_color_array_new", "return_type": "void", "arguments": [ - ["godot_pool_color_array *", "r_dest"] + ["godot_packed_color_array *", "r_dest"] ] }, { - "name": "godot_pool_color_array_new_copy", + "name": "godot_packed_color_array_new_copy", "return_type": "void", "arguments": [ - ["godot_pool_color_array *", "r_dest"], - ["const godot_pool_color_array *", "p_src"] + ["godot_packed_color_array *", "r_dest"], + ["const godot_packed_color_array *", "p_src"] ] }, { - "name": "godot_pool_color_array_new_with_array", + "name": "godot_packed_color_array_new_with_array", "return_type": "void", "arguments": [ - ["godot_pool_color_array *", "r_dest"], + ["godot_packed_color_array *", "r_dest"], ["const godot_array *", "p_a"] ] }, { - "name": "godot_pool_color_array_append", + "name": "godot_packed_color_array_append", "return_type": "void", "arguments": [ - ["godot_pool_color_array *", "p_self"], + ["godot_packed_color_array *", "p_self"], ["const godot_color *", "p_data"] ] }, { - "name": "godot_pool_color_array_append_array", + "name": "godot_packed_color_array_append_array", "return_type": "void", "arguments": [ - ["godot_pool_color_array *", "p_self"], - ["const godot_pool_color_array *", "p_array"] + ["godot_packed_color_array *", "p_self"], + ["const godot_packed_color_array *", "p_array"] ] }, { - "name": "godot_pool_color_array_insert", + "name": "godot_packed_color_array_insert", "return_type": "godot_error", "arguments": [ - ["godot_pool_color_array *", "p_self"], + ["godot_packed_color_array *", "p_self"], ["const godot_int", "p_idx"], ["const godot_color *", "p_data"] ] }, { - "name": "godot_pool_color_array_invert", + "name": "godot_packed_color_array_invert", "return_type": "void", "arguments": [ - ["godot_pool_color_array *", "p_self"] + ["godot_packed_color_array *", "p_self"] ] }, { - "name": "godot_pool_color_array_push_back", + "name": "godot_packed_color_array_push_back", "return_type": "void", "arguments": [ - ["godot_pool_color_array *", "p_self"], + ["godot_packed_color_array *", "p_self"], ["const godot_color *", "p_data"] ] }, { - "name": "godot_pool_color_array_remove", + "name": "godot_packed_color_array_remove", "return_type": "void", "arguments": [ - ["godot_pool_color_array *", "p_self"], + ["godot_packed_color_array *", "p_self"], ["const godot_int", "p_idx"] ] }, { - "name": "godot_pool_color_array_resize", + "name": "godot_packed_color_array_resize", "return_type": "void", "arguments": [ - ["godot_pool_color_array *", "p_self"], + ["godot_packed_color_array *", "p_self"], ["const godot_int", "p_size"] ] }, { - "name": "godot_pool_color_array_read", - "return_type": "godot_pool_color_array_read_access *", - "arguments": [ - ["const godot_pool_color_array *", "p_self"] - ] - }, - { - "name": "godot_pool_color_array_write", - "return_type": "godot_pool_color_array_write_access *", - "arguments": [ - ["godot_pool_color_array *", "p_self"] - ] - }, - { - "name": "godot_pool_color_array_set", + "name": "godot_packed_color_array_set", "return_type": "void", "arguments": [ - ["godot_pool_color_array *", "p_self"], + ["godot_packed_color_array *", "p_self"], ["const godot_int", "p_idx"], ["const godot_color *", "p_data"] ] }, { - "name": "godot_pool_color_array_get", + "name": "godot_packed_color_array_get", "return_type": "godot_color", "arguments": [ - ["const godot_pool_color_array *", "p_self"], + ["const godot_packed_color_array *", "p_self"], ["const godot_int", "p_idx"] ] }, { - "name": "godot_pool_color_array_size", + "name": "godot_packed_color_array_size", "return_type": "godot_int", "arguments": [ - ["const godot_pool_color_array *", "p_self"] - ] - }, - { - "name": "godot_pool_color_array_destroy", - "return_type": "void", - "arguments": [ - ["godot_pool_color_array *", "p_self"] - ] - }, - { - "name": "godot_pool_byte_array_read_access_copy", - "return_type": "godot_pool_byte_array_read_access *", - "arguments": [ - ["const godot_pool_byte_array_read_access *", "p_read"] - ] - }, - { - "name": "godot_pool_byte_array_read_access_ptr", - "return_type": "const uint8_t *", - "arguments": [ - ["const godot_pool_byte_array_read_access *", "p_read"] - ] - }, - { - "name": "godot_pool_byte_array_read_access_operator_assign", - "return_type": "void", - "arguments": [ - ["godot_pool_byte_array_read_access *", "p_read"], - ["godot_pool_byte_array_read_access *", "p_other"] - ] - }, - { - "name": "godot_pool_byte_array_read_access_destroy", - "return_type": "void", - "arguments": [ - ["godot_pool_byte_array_read_access *", "p_read"] - ] - }, - { - "name": "godot_pool_int_array_read_access_copy", - "return_type": "godot_pool_int_array_read_access *", - "arguments": [ - ["const godot_pool_int_array_read_access *", "p_read"] - ] - }, - { - "name": "godot_pool_int_array_read_access_ptr", - "return_type": "const godot_int *", - "arguments": [ - ["const godot_pool_int_array_read_access *", "p_read"] - ] - }, - { - "name": "godot_pool_int_array_read_access_operator_assign", - "return_type": "void", - "arguments": [ - ["godot_pool_int_array_read_access *", "p_read"], - ["godot_pool_int_array_read_access *", "p_other"] - ] - }, - { - "name": "godot_pool_int_array_read_access_destroy", - "return_type": "void", - "arguments": [ - ["godot_pool_int_array_read_access *", "p_read"] - ] - }, - { - "name": "godot_pool_real_array_read_access_copy", - "return_type": "godot_pool_real_array_read_access *", - "arguments": [ - ["const godot_pool_real_array_read_access *", "p_read"] - ] - }, - { - "name": "godot_pool_real_array_read_access_ptr", - "return_type": "const godot_real *", - "arguments": [ - ["const godot_pool_real_array_read_access *", "p_read"] - ] - }, - { - "name": "godot_pool_real_array_read_access_operator_assign", - "return_type": "void", - "arguments": [ - ["godot_pool_real_array_read_access *", "p_read"], - ["godot_pool_real_array_read_access *", "p_other"] - ] - }, - { - "name": "godot_pool_real_array_read_access_destroy", - "return_type": "void", - "arguments": [ - ["godot_pool_real_array_read_access *", "p_read"] - ] - }, - { - "name": "godot_pool_string_array_read_access_copy", - "return_type": "godot_pool_string_array_read_access *", - "arguments": [ - ["const godot_pool_string_array_read_access *", "p_read"] - ] - }, - { - "name": "godot_pool_string_array_read_access_ptr", - "return_type": "const godot_string *", - "arguments": [ - ["const godot_pool_string_array_read_access *", "p_read"] - ] - }, - { - "name": "godot_pool_string_array_read_access_operator_assign", - "return_type": "void", - "arguments": [ - ["godot_pool_string_array_read_access *", "p_read"], - ["godot_pool_string_array_read_access *", "p_other"] - ] - }, - { - "name": "godot_pool_string_array_read_access_destroy", - "return_type": "void", - "arguments": [ - ["godot_pool_string_array_read_access *", "p_read"] - ] - }, - { - "name": "godot_pool_vector2_array_read_access_copy", - "return_type": "godot_pool_vector2_array_read_access *", - "arguments": [ - ["const godot_pool_vector2_array_read_access *", "p_read"] - ] - }, - { - "name": "godot_pool_vector2_array_read_access_ptr", - "return_type": "const godot_vector2 *", - "arguments": [ - ["const godot_pool_vector2_array_read_access *", "p_read"] - ] - }, - { - "name": "godot_pool_vector2_array_read_access_operator_assign", - "return_type": "void", - "arguments": [ - ["godot_pool_vector2_array_read_access *", "p_read"], - ["godot_pool_vector2_array_read_access *", "p_other"] - ] - }, - { - "name": "godot_pool_vector2_array_read_access_destroy", - "return_type": "void", - "arguments": [ - ["godot_pool_vector2_array_read_access *", "p_read"] - ] - }, - { - "name": "godot_pool_vector3_array_read_access_copy", - "return_type": "godot_pool_vector3_array_read_access *", - "arguments": [ - ["const godot_pool_vector3_array_read_access *", "p_read"] - ] - }, - { - "name": "godot_pool_vector3_array_read_access_ptr", - "return_type": "const godot_vector3 *", - "arguments": [ - ["const godot_pool_vector3_array_read_access *", "p_read"] - ] - }, - { - "name": "godot_pool_vector3_array_read_access_operator_assign", - "return_type": "void", - "arguments": [ - ["godot_pool_vector3_array_read_access *", "p_read"], - ["godot_pool_vector3_array_read_access *", "p_other"] - ] - }, - { - "name": "godot_pool_vector3_array_read_access_destroy", - "return_type": "void", - "arguments": [ - ["godot_pool_vector3_array_read_access *", "p_read"] - ] - }, - { - "name": "godot_pool_color_array_read_access_copy", - "return_type": "godot_pool_color_array_read_access *", - "arguments": [ - ["const godot_pool_color_array_read_access *", "p_read"] - ] - }, - { - "name": "godot_pool_color_array_read_access_ptr", - "return_type": "const godot_color *", - "arguments": [ - ["const godot_pool_color_array_read_access *", "p_read"] - ] - }, - { - "name": "godot_pool_color_array_read_access_operator_assign", - "return_type": "void", - "arguments": [ - ["godot_pool_color_array_read_access *", "p_read"], - ["godot_pool_color_array_read_access *", "p_other"] - ] - }, - { - "name": "godot_pool_color_array_read_access_destroy", - "return_type": "void", - "arguments": [ - ["godot_pool_color_array_read_access *", "p_read"] - ] - }, - { - "name": "godot_pool_byte_array_write_access_copy", - "return_type": "godot_pool_byte_array_write_access *", - "arguments": [ - ["const godot_pool_byte_array_write_access *", "p_write"] - ] - }, - { - "name": "godot_pool_byte_array_write_access_ptr", - "return_type": "uint8_t *", - "arguments": [ - ["const godot_pool_byte_array_write_access *", "p_write"] - ] - }, - { - "name": "godot_pool_byte_array_write_access_operator_assign", - "return_type": "void", - "arguments": [ - ["godot_pool_byte_array_write_access *", "p_write"], - ["godot_pool_byte_array_write_access *", "p_other"] - ] - }, - { - "name": "godot_pool_byte_array_write_access_destroy", - "return_type": "void", - "arguments": [ - ["godot_pool_byte_array_write_access *", "p_write"] - ] - }, - { - "name": "godot_pool_int_array_write_access_copy", - "return_type": "godot_pool_int_array_write_access *", - "arguments": [ - ["const godot_pool_int_array_write_access *", "p_write"] - ] - }, - { - "name": "godot_pool_int_array_write_access_ptr", - "return_type": "godot_int *", - "arguments": [ - ["const godot_pool_int_array_write_access *", "p_write"] - ] - }, - { - "name": "godot_pool_int_array_write_access_operator_assign", - "return_type": "void", - "arguments": [ - ["godot_pool_int_array_write_access *", "p_write"], - ["godot_pool_int_array_write_access *", "p_other"] - ] - }, - { - "name": "godot_pool_int_array_write_access_destroy", - "return_type": "void", - "arguments": [ - ["godot_pool_int_array_write_access *", "p_write"] - ] - }, - { - "name": "godot_pool_real_array_write_access_copy", - "return_type": "godot_pool_real_array_write_access *", - "arguments": [ - ["const godot_pool_real_array_write_access *", "p_write"] - ] - }, - { - "name": "godot_pool_real_array_write_access_ptr", - "return_type": "godot_real *", - "arguments": [ - ["const godot_pool_real_array_write_access *", "p_write"] - ] - }, - { - "name": "godot_pool_real_array_write_access_operator_assign", - "return_type": "void", - "arguments": [ - ["godot_pool_real_array_write_access *", "p_write"], - ["godot_pool_real_array_write_access *", "p_other"] - ] - }, - { - "name": "godot_pool_real_array_write_access_destroy", - "return_type": "void", - "arguments": [ - ["godot_pool_real_array_write_access *", "p_write"] - ] - }, - { - "name": "godot_pool_string_array_write_access_copy", - "return_type": "godot_pool_string_array_write_access *", - "arguments": [ - ["const godot_pool_string_array_write_access *", "p_write"] - ] - }, - { - "name": "godot_pool_string_array_write_access_ptr", - "return_type": "godot_string *", - "arguments": [ - ["const godot_pool_string_array_write_access *", "p_write"] - ] - }, - { - "name": "godot_pool_string_array_write_access_operator_assign", - "return_type": "void", - "arguments": [ - ["godot_pool_string_array_write_access *", "p_write"], - ["godot_pool_string_array_write_access *", "p_other"] - ] - }, - { - "name": "godot_pool_string_array_write_access_destroy", - "return_type": "void", - "arguments": [ - ["godot_pool_string_array_write_access *", "p_write"] - ] - }, - { - "name": "godot_pool_vector2_array_write_access_copy", - "return_type": "godot_pool_vector2_array_write_access *", - "arguments": [ - ["const godot_pool_vector2_array_write_access *", "p_write"] - ] - }, - { - "name": "godot_pool_vector2_array_write_access_ptr", - "return_type": "godot_vector2 *", - "arguments": [ - ["const godot_pool_vector2_array_write_access *", "p_write"] - ] - }, - { - "name": "godot_pool_vector2_array_write_access_operator_assign", - "return_type": "void", - "arguments": [ - ["godot_pool_vector2_array_write_access *", "p_write"], - ["godot_pool_vector2_array_write_access *", "p_other"] - ] - }, - { - "name": "godot_pool_vector2_array_write_access_destroy", - "return_type": "void", - "arguments": [ - ["godot_pool_vector2_array_write_access *", "p_write"] - ] - }, - { - "name": "godot_pool_vector3_array_write_access_copy", - "return_type": "godot_pool_vector3_array_write_access *", - "arguments": [ - ["const godot_pool_vector3_array_write_access *", "p_write"] - ] - }, - { - "name": "godot_pool_vector3_array_write_access_ptr", - "return_type": "godot_vector3 *", - "arguments": [ - ["const godot_pool_vector3_array_write_access *", "p_write"] - ] - }, - { - "name": "godot_pool_vector3_array_write_access_operator_assign", - "return_type": "void", - "arguments": [ - ["godot_pool_vector3_array_write_access *", "p_write"], - ["godot_pool_vector3_array_write_access *", "p_other"] - ] - }, - { - "name": "godot_pool_vector3_array_write_access_destroy", - "return_type": "void", - "arguments": [ - ["godot_pool_vector3_array_write_access *", "p_write"] - ] - }, - { - "name": "godot_pool_color_array_write_access_copy", - "return_type": "godot_pool_color_array_write_access *", - "arguments": [ - ["const godot_pool_color_array_write_access *", "p_write"] - ] - }, - { - "name": "godot_pool_color_array_write_access_ptr", - "return_type": "godot_color *", - "arguments": [ - ["const godot_pool_color_array_write_access *", "p_write"] - ] - }, - { - "name": "godot_pool_color_array_write_access_operator_assign", - "return_type": "void", - "arguments": [ - ["godot_pool_color_array_write_access *", "p_write"], - ["godot_pool_color_array_write_access *", "p_other"] + ["const godot_packed_color_array *", "p_self"] ] }, { - "name": "godot_pool_color_array_write_access_destroy", + "name": "godot_packed_color_array_destroy", "return_type": "void", "arguments": [ - ["godot_pool_color_array_write_access *", "p_write"] + ["godot_packed_color_array *", "p_self"] ] }, { @@ -2946,59 +2442,59 @@ ] }, { - "name": "godot_array_new_pool_color_array", + "name": "godot_array_new_packed_color_array", "return_type": "void", "arguments": [ ["godot_array *", "r_dest"], - ["const godot_pool_color_array *", "p_pca"] + ["const godot_packed_color_array *", "p_pca"] ] }, { - "name": "godot_array_new_pool_vector3_array", + "name": "godot_array_new_packed_vector3_array", "return_type": "void", "arguments": [ ["godot_array *", "r_dest"], - ["const godot_pool_vector3_array *", "p_pv3a"] + ["const godot_packed_vector3_array *", "p_pv3a"] ] }, { - "name": "godot_array_new_pool_vector2_array", + "name": "godot_array_new_packed_vector2_array", "return_type": "void", "arguments": [ ["godot_array *", "r_dest"], - ["const godot_pool_vector2_array *", "p_pv2a"] + ["const godot_packed_vector2_array *", "p_pv2a"] ] }, { - "name": "godot_array_new_pool_string_array", + "name": "godot_array_new_packed_string_array", "return_type": "void", "arguments": [ ["godot_array *", "r_dest"], - ["const godot_pool_string_array *", "p_psa"] + ["const godot_packed_string_array *", "p_psa"] ] }, { - "name": "godot_array_new_pool_real_array", + "name": "godot_array_new_packed_real_array", "return_type": "void", "arguments": [ ["godot_array *", "r_dest"], - ["const godot_pool_real_array *", "p_pra"] + ["const godot_packed_real_array *", "p_pra"] ] }, { - "name": "godot_array_new_pool_int_array", + "name": "godot_array_new_packed_int_array", "return_type": "void", "arguments": [ ["godot_array *", "r_dest"], - ["const godot_pool_int_array *", "p_pia"] + ["const godot_packed_int_array *", "p_pia"] ] }, { - "name": "godot_array_new_pool_byte_array", + "name": "godot_array_new_packed_byte_array", "return_type": "void", "arguments": [ ["godot_array *", "r_dest"], - ["const godot_pool_byte_array *", "p_pba"] + ["const godot_packed_byte_array *", "p_pba"] ] }, { @@ -4555,59 +4051,59 @@ ] }, { - "name": "godot_variant_new_pool_byte_array", + "name": "godot_variant_new_packed_byte_array", "return_type": "void", "arguments": [ ["godot_variant *", "r_dest"], - ["const godot_pool_byte_array *", "p_pba"] + ["const godot_packed_byte_array *", "p_pba"] ] }, { - "name": "godot_variant_new_pool_int_array", + "name": "godot_variant_new_packed_int_array", "return_type": "void", "arguments": [ ["godot_variant *", "r_dest"], - ["const godot_pool_int_array *", "p_pia"] + ["const godot_packed_int_array *", "p_pia"] ] }, { - "name": "godot_variant_new_pool_real_array", + "name": "godot_variant_new_packed_real_array", "return_type": "void", "arguments": [ ["godot_variant *", "r_dest"], - ["const godot_pool_real_array *", "p_pra"] + ["const godot_packed_real_array *", "p_pra"] ] }, { - "name": "godot_variant_new_pool_string_array", + "name": "godot_variant_new_packed_string_array", "return_type": "void", "arguments": [ ["godot_variant *", "r_dest"], - ["const godot_pool_string_array *", "p_psa"] + ["const godot_packed_string_array *", "p_psa"] ] }, { - "name": "godot_variant_new_pool_vector2_array", + "name": "godot_variant_new_packed_vector2_array", "return_type": "void", "arguments": [ ["godot_variant *", "r_dest"], - ["const godot_pool_vector2_array *", "p_pv2a"] + ["const godot_packed_vector2_array *", "p_pv2a"] ] }, { - "name": "godot_variant_new_pool_vector3_array", + "name": "godot_variant_new_packed_vector3_array", "return_type": "void", "arguments": [ ["godot_variant *", "r_dest"], - ["const godot_pool_vector3_array *", "p_pv3a"] + ["const godot_packed_vector3_array *", "p_pv3a"] ] }, { - "name": "godot_variant_new_pool_color_array", + "name": "godot_variant_new_packed_color_array", "return_type": "void", "arguments": [ ["godot_variant *", "r_dest"], - ["const godot_pool_color_array *", "p_pca"] + ["const godot_packed_color_array *", "p_pca"] ] }, { @@ -4751,50 +4247,50 @@ ] }, { - "name": "godot_variant_as_pool_byte_array", - "return_type": "godot_pool_byte_array", + "name": "godot_variant_as_packed_byte_array", + "return_type": "godot_packed_byte_array", "arguments": [ ["const godot_variant *", "p_self"] ] }, { - "name": "godot_variant_as_pool_int_array", - "return_type": "godot_pool_int_array", + "name": "godot_variant_as_packed_int_array", + "return_type": "godot_packed_int_array", "arguments": [ ["const godot_variant *", "p_self"] ] }, { - "name": "godot_variant_as_pool_real_array", - "return_type": "godot_pool_real_array", + "name": "godot_variant_as_packed_real_array", + "return_type": "godot_packed_real_array", "arguments": [ ["const godot_variant *", "p_self"] ] }, { - "name": "godot_variant_as_pool_string_array", - "return_type": "godot_pool_string_array", + "name": "godot_variant_as_packed_string_array", + "return_type": "godot_packed_string_array", "arguments": [ ["const godot_variant *", "p_self"] ] }, { - "name": "godot_variant_as_pool_vector2_array", - "return_type": "godot_pool_vector2_array", + "name": "godot_variant_as_packed_vector2_array", + "return_type": "godot_packed_vector2_array", "arguments": [ ["const godot_variant *", "p_self"] ] }, { - "name": "godot_variant_as_pool_vector3_array", - "return_type": "godot_pool_vector3_array", + "name": "godot_variant_as_packed_vector3_array", + "return_type": "godot_packed_vector3_array", "arguments": [ ["const godot_variant *", "p_self"] ] }, { - "name": "godot_variant_as_pool_color_array", - "return_type": "godot_pool_color_array", + "name": "godot_variant_as_packed_color_array", + "return_type": "godot_packed_color_array", "arguments": [ ["const godot_variant *", "p_self"] ] @@ -5782,7 +5278,7 @@ }, { "name": "godot_string_md5_buffer", - "return_type": "godot_pool_byte_array", + "return_type": "godot_packed_byte_array", "arguments": [ ["const godot_string *", "p_self"] ] @@ -5796,7 +5292,7 @@ }, { "name": "godot_string_sha256_buffer", - "return_type": "godot_pool_byte_array", + "return_type": "godot_packed_byte_array", "arguments": [ ["const godot_string *", "p_self"] ] diff --git a/modules/gdnative/gdnative_library_editor_plugin.cpp b/modules/gdnative/gdnative_library_editor_plugin.cpp index 5ffab0f80e..a30b438e6f 100644 --- a/modules/gdnative/gdnative_library_editor_plugin.cpp +++ b/modules/gdnative/gdnative_library_editor_plugin.cpp @@ -168,7 +168,7 @@ void GDNativeLibraryEditor::_on_library_selected(const String &file) { _set_target_value(file_dialog->get_meta("section"), file_dialog->get_meta("target"), file); } -void GDNativeLibraryEditor::_on_dependencies_selected(const PoolStringArray &files) { +void GDNativeLibraryEditor::_on_dependencies_selected(const PackedStringArray &files) { _set_target_value(file_dialog->get_meta("section"), file_dialog->get_meta("target"), files); } diff --git a/modules/gdnative/gdnative_library_editor_plugin.h b/modules/gdnative/gdnative_library_editor_plugin.h index 7b59aaac38..b1274d08b3 100644 --- a/modules/gdnative/gdnative_library_editor_plugin.h +++ b/modules/gdnative/gdnative_library_editor_plugin.h @@ -77,7 +77,7 @@ protected: void _update_tree(); void _on_item_button(Object *item, int column, int id); void _on_library_selected(const String &file); - void _on_dependencies_selected(const PoolStringArray &files); + void _on_dependencies_selected(const PackedStringArray &files); void _on_filter_selected(int id); void _on_item_collapsed(Object *p_item); void _on_item_activated(); diff --git a/modules/gdnative/include/gdnative/array.h b/modules/gdnative/include/gdnative/array.h index 36b5c77875..e3114e9348 100644 --- a/modules/gdnative/include/gdnative/array.h +++ b/modules/gdnative/include/gdnative/array.h @@ -62,13 +62,13 @@ extern "C" { void GDAPI godot_array_new(godot_array *r_dest); void GDAPI godot_array_new_copy(godot_array *r_dest, const godot_array *p_src); -void GDAPI godot_array_new_pool_color_array(godot_array *r_dest, const godot_pool_color_array *p_pca); -void GDAPI godot_array_new_pool_vector3_array(godot_array *r_dest, const godot_pool_vector3_array *p_pv3a); -void GDAPI godot_array_new_pool_vector2_array(godot_array *r_dest, const godot_pool_vector2_array *p_pv2a); -void GDAPI godot_array_new_pool_string_array(godot_array *r_dest, const godot_pool_string_array *p_psa); -void GDAPI godot_array_new_pool_real_array(godot_array *r_dest, const godot_pool_real_array *p_pra); -void GDAPI godot_array_new_pool_int_array(godot_array *r_dest, const godot_pool_int_array *p_pia); -void GDAPI godot_array_new_pool_byte_array(godot_array *r_dest, const godot_pool_byte_array *p_pba); +void GDAPI godot_array_new_packed_color_array(godot_array *r_dest, const godot_packed_color_array *p_pca); +void GDAPI godot_array_new_packed_vector3_array(godot_array *r_dest, const godot_packed_vector3_array *p_pv3a); +void GDAPI godot_array_new_packed_vector2_array(godot_array *r_dest, const godot_packed_vector2_array *p_pv2a); +void GDAPI godot_array_new_packed_string_array(godot_array *r_dest, const godot_packed_string_array *p_psa); +void GDAPI godot_array_new_packed_real_array(godot_array *r_dest, const godot_packed_real_array *p_pra); +void GDAPI godot_array_new_packed_int_array(godot_array *r_dest, const godot_packed_int_array *p_pia); +void GDAPI godot_array_new_packed_byte_array(godot_array *r_dest, const godot_packed_byte_array *p_pba); void GDAPI godot_array_set(godot_array *p_self, const godot_int p_idx, const godot_variant *p_value); diff --git a/modules/gdnative/include/gdnative/pool_arrays.h b/modules/gdnative/include/gdnative/pool_arrays.h index 7d51b3cd5c..315fb7ada2 100644 --- a/modules/gdnative/include/gdnative/pool_arrays.h +++ b/modules/gdnative/include/gdnative/pool_arrays.h @@ -37,113 +37,81 @@ extern "C" { #include <stdint.h> -/////// Read Access +/////// PackedByteArray -#define GODOT_POOL_ARRAY_READ_ACCESS_SIZE 1 +#define GODOT_PACKED_BYTE_ARRAY_SIZE sizeof(void *) +#ifndef GODOT_CORE_API_GODOT_PACKED_BYTE_ARRAY_TYPE_DEFINED +#define GODOT_CORE_API_GODOT_PACKED_BYTE_ARRAY_TYPE_DEFINED typedef struct { - uint8_t _dont_touch_that[GODOT_POOL_ARRAY_READ_ACCESS_SIZE]; -} godot_pool_array_read_access; - -typedef godot_pool_array_read_access godot_pool_byte_array_read_access; -typedef godot_pool_array_read_access godot_pool_int_array_read_access; -typedef godot_pool_array_read_access godot_pool_real_array_read_access; -typedef godot_pool_array_read_access godot_pool_string_array_read_access; -typedef godot_pool_array_read_access godot_pool_vector2_array_read_access; -typedef godot_pool_array_read_access godot_pool_vector3_array_read_access; -typedef godot_pool_array_read_access godot_pool_color_array_read_access; - -/////// Write Access - -#define GODOT_POOL_ARRAY_WRITE_ACCESS_SIZE 1 - -typedef struct { - uint8_t _dont_touch_that[GODOT_POOL_ARRAY_WRITE_ACCESS_SIZE]; -} godot_pool_array_write_access; - -typedef godot_pool_array_write_access godot_pool_byte_array_write_access; -typedef godot_pool_array_write_access godot_pool_int_array_write_access; -typedef godot_pool_array_write_access godot_pool_real_array_write_access; -typedef godot_pool_array_write_access godot_pool_string_array_write_access; -typedef godot_pool_array_write_access godot_pool_vector2_array_write_access; -typedef godot_pool_array_write_access godot_pool_vector3_array_write_access; -typedef godot_pool_array_write_access godot_pool_color_array_write_access; - -/////// PoolByteArray - -#define GODOT_POOL_BYTE_ARRAY_SIZE sizeof(void *) - -#ifndef GODOT_CORE_API_GODOT_POOL_BYTE_ARRAY_TYPE_DEFINED -#define GODOT_CORE_API_GODOT_POOL_BYTE_ARRAY_TYPE_DEFINED -typedef struct { - uint8_t _dont_touch_that[GODOT_POOL_BYTE_ARRAY_SIZE]; -} godot_pool_byte_array; + uint8_t _dont_touch_that[GODOT_PACKED_BYTE_ARRAY_SIZE]; +} godot_packed_byte_array; #endif -/////// PoolIntArray +/////// PackedIntArray -#define GODOT_POOL_INT_ARRAY_SIZE sizeof(void *) +#define GODOT_PACKED_INT_ARRAY_SIZE sizeof(void *) -#ifndef GODOT_CORE_API_GODOT_POOL_INT_ARRAY_TYPE_DEFINED -#define GODOT_CORE_API_GODOT_POOL_INT_ARRAY_TYPE_DEFINED +#ifndef GODOT_CORE_API_GODOT_PACKED_INT_ARRAY_TYPE_DEFINED +#define GODOT_CORE_API_GODOT_PACKED_INT_ARRAY_TYPE_DEFINED typedef struct { - uint8_t _dont_touch_that[GODOT_POOL_INT_ARRAY_SIZE]; -} godot_pool_int_array; + uint8_t _dont_touch_that[GODOT_PACKED_INT_ARRAY_SIZE]; +} godot_packed_int_array; #endif -/////// PoolRealArray +/////// PackedRealArray -#define GODOT_POOL_REAL_ARRAY_SIZE sizeof(void *) +#define GODOT_PACKED_REAL_ARRAY_SIZE sizeof(void *) -#ifndef GODOT_CORE_API_GODOT_POOL_REAL_ARRAY_TYPE_DEFINED -#define GODOT_CORE_API_GODOT_POOL_REAL_ARRAY_TYPE_DEFINED +#ifndef GODOT_CORE_API_GODOT_PACKED_REAL_ARRAY_TYPE_DEFINED +#define GODOT_CORE_API_GODOT_PACKED_REAL_ARRAY_TYPE_DEFINED typedef struct { - uint8_t _dont_touch_that[GODOT_POOL_REAL_ARRAY_SIZE]; -} godot_pool_real_array; + uint8_t _dont_touch_that[GODOT_PACKED_REAL_ARRAY_SIZE]; +} godot_packed_real_array; #endif -/////// PoolStringArray +/////// PackedStringArray -#define GODOT_POOL_STRING_ARRAY_SIZE sizeof(void *) +#define GODOT_PACKED_STRING_ARRAY_SIZE sizeof(void *) -#ifndef GODOT_CORE_API_GODOT_POOL_STRING_ARRAY_TYPE_DEFINED -#define GODOT_CORE_API_GODOT_POOL_STRING_ARRAY_TYPE_DEFINED +#ifndef GODOT_CORE_API_GODOT_PACKED_STRING_ARRAY_TYPE_DEFINED +#define GODOT_CORE_API_GODOT_PACKED_STRING_ARRAY_TYPE_DEFINED typedef struct { - uint8_t _dont_touch_that[GODOT_POOL_STRING_ARRAY_SIZE]; -} godot_pool_string_array; + uint8_t _dont_touch_that[GODOT_PACKED_STRING_ARRAY_SIZE]; +} godot_packed_string_array; #endif -/////// PoolVector2Array +/////// PackedVector2Array -#define GODOT_POOL_VECTOR2_ARRAY_SIZE sizeof(void *) +#define GODOT_PACKED_VECTOR2_ARRAY_SIZE sizeof(void *) -#ifndef GODOT_CORE_API_GODOT_POOL_VECTOR2_ARRAY_TYPE_DEFINED -#define GODOT_CORE_API_GODOT_POOL_VECTOR2_ARRAY_TYPE_DEFINED +#ifndef GODOT_CORE_API_GODOT_PACKED_VECTOR2_ARRAY_TYPE_DEFINED +#define GODOT_CORE_API_GODOT_PACKED_VECTOR2_ARRAY_TYPE_DEFINED typedef struct { - uint8_t _dont_touch_that[GODOT_POOL_VECTOR2_ARRAY_SIZE]; -} godot_pool_vector2_array; + uint8_t _dont_touch_that[GODOT_PACKED_VECTOR2_ARRAY_SIZE]; +} godot_packed_vector2_array; #endif -/////// PoolVector3Array +/////// PackedVector3Array -#define GODOT_POOL_VECTOR3_ARRAY_SIZE sizeof(void *) +#define GODOT_PACKED_VECTOR3_ARRAY_SIZE sizeof(void *) -#ifndef GODOT_CORE_API_GODOT_POOL_VECTOR3_ARRAY_TYPE_DEFINED -#define GODOT_CORE_API_GODOT_POOL_VECTOR3_ARRAY_TYPE_DEFINED +#ifndef GODOT_CORE_API_GODOT_PACKED_VECTOR3_ARRAY_TYPE_DEFINED +#define GODOT_CORE_API_GODOT_PACKED_VECTOR3_ARRAY_TYPE_DEFINED typedef struct { - uint8_t _dont_touch_that[GODOT_POOL_VECTOR3_ARRAY_SIZE]; -} godot_pool_vector3_array; + uint8_t _dont_touch_that[GODOT_PACKED_VECTOR3_ARRAY_SIZE]; +} godot_packed_vector3_array; #endif -/////// PoolColorArray +/////// PackedColorArray -#define GODOT_POOL_COLOR_ARRAY_SIZE sizeof(void *) +#define GODOT_PACKED_COLOR_ARRAY_SIZE sizeof(void *) -#ifndef GODOT_CORE_API_GODOT_POOL_COLOR_ARRAY_TYPE_DEFINED -#define GODOT_CORE_API_GODOT_POOL_COLOR_ARRAY_TYPE_DEFINED +#ifndef GODOT_CORE_API_GODOT_PACKED_COLOR_ARRAY_TYPE_DEFINED +#define GODOT_CORE_API_GODOT_PACKED_COLOR_ARRAY_TYPE_DEFINED typedef struct { - uint8_t _dont_touch_that[GODOT_POOL_COLOR_ARRAY_SIZE]; -} godot_pool_color_array; + uint8_t _dont_touch_that[GODOT_PACKED_COLOR_ARRAY_SIZE]; +} godot_packed_color_array; #endif // reduce extern "C" nesting for VS2013 @@ -164,312 +132,206 @@ extern "C" { // byte -void GDAPI godot_pool_byte_array_new(godot_pool_byte_array *r_dest); -void GDAPI godot_pool_byte_array_new_copy(godot_pool_byte_array *r_dest, const godot_pool_byte_array *p_src); -void GDAPI godot_pool_byte_array_new_with_array(godot_pool_byte_array *r_dest, const godot_array *p_a); +void GDAPI godot_packed_byte_array_new(godot_packed_byte_array *r_dest); +void GDAPI godot_packed_byte_array_new_copy(godot_packed_byte_array *r_dest, const godot_packed_byte_array *p_src); +void GDAPI godot_packed_byte_array_new_with_array(godot_packed_byte_array *r_dest, const godot_array *p_a); -void GDAPI godot_pool_byte_array_append(godot_pool_byte_array *p_self, const uint8_t p_data); +void GDAPI godot_packed_byte_array_append(godot_packed_byte_array *p_self, const uint8_t p_data); -void GDAPI godot_pool_byte_array_append_array(godot_pool_byte_array *p_self, const godot_pool_byte_array *p_array); +void GDAPI godot_packed_byte_array_append_array(godot_packed_byte_array *p_self, const godot_packed_byte_array *p_array); -godot_error GDAPI godot_pool_byte_array_insert(godot_pool_byte_array *p_self, const godot_int p_idx, const uint8_t p_data); +godot_error GDAPI godot_packed_byte_array_insert(godot_packed_byte_array *p_self, const godot_int p_idx, const uint8_t p_data); -void GDAPI godot_pool_byte_array_invert(godot_pool_byte_array *p_self); +void GDAPI godot_packed_byte_array_invert(godot_packed_byte_array *p_self); -void GDAPI godot_pool_byte_array_push_back(godot_pool_byte_array *p_self, const uint8_t p_data); +void GDAPI godot_packed_byte_array_push_back(godot_packed_byte_array *p_self, const uint8_t p_data); -void GDAPI godot_pool_byte_array_remove(godot_pool_byte_array *p_self, const godot_int p_idx); +void GDAPI godot_packed_byte_array_remove(godot_packed_byte_array *p_self, const godot_int p_idx); -void GDAPI godot_pool_byte_array_resize(godot_pool_byte_array *p_self, const godot_int p_size); +void GDAPI godot_packed_byte_array_resize(godot_packed_byte_array *p_self, const godot_int p_size); -godot_pool_byte_array_read_access GDAPI *godot_pool_byte_array_read(const godot_pool_byte_array *p_self); +void GDAPI godot_packed_byte_array_set(godot_packed_byte_array *p_self, const godot_int p_idx, const uint8_t p_data); +uint8_t GDAPI godot_packed_byte_array_get(const godot_packed_byte_array *p_self, const godot_int p_idx); -godot_pool_byte_array_write_access GDAPI *godot_pool_byte_array_write(godot_pool_byte_array *p_self); +godot_int GDAPI godot_packed_byte_array_size(const godot_packed_byte_array *p_self); -void GDAPI godot_pool_byte_array_set(godot_pool_byte_array *p_self, const godot_int p_idx, const uint8_t p_data); -uint8_t GDAPI godot_pool_byte_array_get(const godot_pool_byte_array *p_self, const godot_int p_idx); +godot_bool GDAPI godot_packed_byte_array_empty(const godot_packed_byte_array *p_self); -godot_int GDAPI godot_pool_byte_array_size(const godot_pool_byte_array *p_self); - -godot_bool GDAPI godot_pool_byte_array_empty(const godot_pool_byte_array *p_self); - -void GDAPI godot_pool_byte_array_destroy(godot_pool_byte_array *p_self); +void GDAPI godot_packed_byte_array_destroy(godot_packed_byte_array *p_self); // int -void GDAPI godot_pool_int_array_new(godot_pool_int_array *r_dest); -void GDAPI godot_pool_int_array_new_copy(godot_pool_int_array *r_dest, const godot_pool_int_array *p_src); -void GDAPI godot_pool_int_array_new_with_array(godot_pool_int_array *r_dest, const godot_array *p_a); - -void GDAPI godot_pool_int_array_append(godot_pool_int_array *p_self, const godot_int p_data); +void GDAPI godot_packed_int_array_new(godot_packed_int_array *r_dest); +void GDAPI godot_packed_int_array_new_copy(godot_packed_int_array *r_dest, const godot_packed_int_array *p_src); +void GDAPI godot_packed_int_array_new_with_array(godot_packed_int_array *r_dest, const godot_array *p_a); -void GDAPI godot_pool_int_array_append_array(godot_pool_int_array *p_self, const godot_pool_int_array *p_array); +void GDAPI godot_packed_int_array_append(godot_packed_int_array *p_self, const godot_int p_data); -godot_error GDAPI godot_pool_int_array_insert(godot_pool_int_array *p_self, const godot_int p_idx, const godot_int p_data); +void GDAPI godot_packed_int_array_append_array(godot_packed_int_array *p_self, const godot_packed_int_array *p_array); -void GDAPI godot_pool_int_array_invert(godot_pool_int_array *p_self); +godot_error GDAPI godot_packed_int_array_insert(godot_packed_int_array *p_self, const godot_int p_idx, const godot_int p_data); -void GDAPI godot_pool_int_array_push_back(godot_pool_int_array *p_self, const godot_int p_data); +void GDAPI godot_packed_int_array_invert(godot_packed_int_array *p_self); -void GDAPI godot_pool_int_array_remove(godot_pool_int_array *p_self, const godot_int p_idx); +void GDAPI godot_packed_int_array_push_back(godot_packed_int_array *p_self, const godot_int p_data); -void GDAPI godot_pool_int_array_resize(godot_pool_int_array *p_self, const godot_int p_size); +void GDAPI godot_packed_int_array_remove(godot_packed_int_array *p_self, const godot_int p_idx); -godot_pool_int_array_read_access GDAPI *godot_pool_int_array_read(const godot_pool_int_array *p_self); +void GDAPI godot_packed_int_array_resize(godot_packed_int_array *p_self, const godot_int p_size); -godot_pool_int_array_write_access GDAPI *godot_pool_int_array_write(godot_pool_int_array *p_self); +void GDAPI godot_packed_int_array_set(godot_packed_int_array *p_self, const godot_int p_idx, const godot_int p_data); +godot_int GDAPI godot_packed_int_array_get(const godot_packed_int_array *p_self, const godot_int p_idx); -void GDAPI godot_pool_int_array_set(godot_pool_int_array *p_self, const godot_int p_idx, const godot_int p_data); -godot_int GDAPI godot_pool_int_array_get(const godot_pool_int_array *p_self, const godot_int p_idx); +godot_int GDAPI godot_packed_int_array_size(const godot_packed_int_array *p_self); -godot_int GDAPI godot_pool_int_array_size(const godot_pool_int_array *p_self); +godot_bool GDAPI godot_packed_int_array_empty(const godot_packed_int_array *p_self); -godot_bool GDAPI godot_pool_int_array_empty(const godot_pool_int_array *p_self); - -void GDAPI godot_pool_int_array_destroy(godot_pool_int_array *p_self); +void GDAPI godot_packed_int_array_destroy(godot_packed_int_array *p_self); // real -void GDAPI godot_pool_real_array_new(godot_pool_real_array *r_dest); -void GDAPI godot_pool_real_array_new_copy(godot_pool_real_array *r_dest, const godot_pool_real_array *p_src); -void GDAPI godot_pool_real_array_new_with_array(godot_pool_real_array *r_dest, const godot_array *p_a); - -void GDAPI godot_pool_real_array_append(godot_pool_real_array *p_self, const godot_real p_data); +void GDAPI godot_packed_real_array_new(godot_packed_real_array *r_dest); +void GDAPI godot_packed_real_array_new_copy(godot_packed_real_array *r_dest, const godot_packed_real_array *p_src); +void GDAPI godot_packed_real_array_new_with_array(godot_packed_real_array *r_dest, const godot_array *p_a); -void GDAPI godot_pool_real_array_append_array(godot_pool_real_array *p_self, const godot_pool_real_array *p_array); +void GDAPI godot_packed_real_array_append(godot_packed_real_array *p_self, const godot_real p_data); -godot_error GDAPI godot_pool_real_array_insert(godot_pool_real_array *p_self, const godot_int p_idx, const godot_real p_data); +void GDAPI godot_packed_real_array_append_array(godot_packed_real_array *p_self, const godot_packed_real_array *p_array); -void GDAPI godot_pool_real_array_invert(godot_pool_real_array *p_self); +godot_error GDAPI godot_packed_real_array_insert(godot_packed_real_array *p_self, const godot_int p_idx, const godot_real p_data); -void GDAPI godot_pool_real_array_push_back(godot_pool_real_array *p_self, const godot_real p_data); +void GDAPI godot_packed_real_array_invert(godot_packed_real_array *p_self); -void GDAPI godot_pool_real_array_remove(godot_pool_real_array *p_self, const godot_int p_idx); +void GDAPI godot_packed_real_array_push_back(godot_packed_real_array *p_self, const godot_real p_data); -void GDAPI godot_pool_real_array_resize(godot_pool_real_array *p_self, const godot_int p_size); +void GDAPI godot_packed_real_array_remove(godot_packed_real_array *p_self, const godot_int p_idx); -godot_pool_real_array_read_access GDAPI *godot_pool_real_array_read(const godot_pool_real_array *p_self); +void GDAPI godot_packed_real_array_resize(godot_packed_real_array *p_self, const godot_int p_size); -godot_pool_real_array_write_access GDAPI *godot_pool_real_array_write(godot_pool_real_array *p_self); +void GDAPI godot_packed_real_array_set(godot_packed_real_array *p_self, const godot_int p_idx, const godot_real p_data); +godot_real GDAPI godot_packed_real_array_get(const godot_packed_real_array *p_self, const godot_int p_idx); -void GDAPI godot_pool_real_array_set(godot_pool_real_array *p_self, const godot_int p_idx, const godot_real p_data); -godot_real GDAPI godot_pool_real_array_get(const godot_pool_real_array *p_self, const godot_int p_idx); +godot_int GDAPI godot_packed_real_array_size(const godot_packed_real_array *p_self); -godot_int GDAPI godot_pool_real_array_size(const godot_pool_real_array *p_self); +godot_bool GDAPI godot_packed_real_array_empty(const godot_packed_real_array *p_self); -godot_bool GDAPI godot_pool_real_array_empty(const godot_pool_real_array *p_self); - -void GDAPI godot_pool_real_array_destroy(godot_pool_real_array *p_self); +void GDAPI godot_packed_real_array_destroy(godot_packed_real_array *p_self); // string -void GDAPI godot_pool_string_array_new(godot_pool_string_array *r_dest); -void GDAPI godot_pool_string_array_new_copy(godot_pool_string_array *r_dest, const godot_pool_string_array *p_src); -void GDAPI godot_pool_string_array_new_with_array(godot_pool_string_array *r_dest, const godot_array *p_a); - -void GDAPI godot_pool_string_array_append(godot_pool_string_array *p_self, const godot_string *p_data); - -void GDAPI godot_pool_string_array_append_array(godot_pool_string_array *p_self, const godot_pool_string_array *p_array); +void GDAPI godot_packed_string_array_new(godot_packed_string_array *r_dest); +void GDAPI godot_packed_string_array_new_copy(godot_packed_string_array *r_dest, const godot_packed_string_array *p_src); +void GDAPI godot_packed_string_array_new_with_array(godot_packed_string_array *r_dest, const godot_array *p_a); -godot_error GDAPI godot_pool_string_array_insert(godot_pool_string_array *p_self, const godot_int p_idx, const godot_string *p_data); +void GDAPI godot_packed_string_array_append(godot_packed_string_array *p_self, const godot_string *p_data); -void GDAPI godot_pool_string_array_invert(godot_pool_string_array *p_self); +void GDAPI godot_packed_string_array_append_array(godot_packed_string_array *p_self, const godot_packed_string_array *p_array); -void GDAPI godot_pool_string_array_push_back(godot_pool_string_array *p_self, const godot_string *p_data); +godot_error GDAPI godot_packed_string_array_insert(godot_packed_string_array *p_self, const godot_int p_idx, const godot_string *p_data); -void GDAPI godot_pool_string_array_remove(godot_pool_string_array *p_self, const godot_int p_idx); +void GDAPI godot_packed_string_array_invert(godot_packed_string_array *p_self); -void GDAPI godot_pool_string_array_resize(godot_pool_string_array *p_self, const godot_int p_size); +void GDAPI godot_packed_string_array_push_back(godot_packed_string_array *p_self, const godot_string *p_data); -godot_pool_string_array_read_access GDAPI *godot_pool_string_array_read(const godot_pool_string_array *p_self); +void GDAPI godot_packed_string_array_remove(godot_packed_string_array *p_self, const godot_int p_idx); -godot_pool_string_array_write_access GDAPI *godot_pool_string_array_write(godot_pool_string_array *p_self); +void GDAPI godot_packed_string_array_resize(godot_packed_string_array *p_self, const godot_int p_size); -void GDAPI godot_pool_string_array_set(godot_pool_string_array *p_self, const godot_int p_idx, const godot_string *p_data); -godot_string GDAPI godot_pool_string_array_get(const godot_pool_string_array *p_self, const godot_int p_idx); +void GDAPI godot_packed_string_array_set(godot_packed_string_array *p_self, const godot_int p_idx, const godot_string *p_data); +godot_string GDAPI godot_packed_string_array_get(const godot_packed_string_array *p_self, const godot_int p_idx); -godot_int GDAPI godot_pool_string_array_size(const godot_pool_string_array *p_self); +godot_int GDAPI godot_packed_string_array_size(const godot_packed_string_array *p_self); -godot_bool GDAPI godot_pool_string_array_empty(const godot_pool_string_array *p_self); +godot_bool GDAPI godot_packed_string_array_empty(const godot_packed_string_array *p_self); -void GDAPI godot_pool_string_array_destroy(godot_pool_string_array *p_self); +void GDAPI godot_packed_string_array_destroy(godot_packed_string_array *p_self); // vector2 -void GDAPI godot_pool_vector2_array_new(godot_pool_vector2_array *r_dest); -void GDAPI godot_pool_vector2_array_new_copy(godot_pool_vector2_array *r_dest, const godot_pool_vector2_array *p_src); -void GDAPI godot_pool_vector2_array_new_with_array(godot_pool_vector2_array *r_dest, const godot_array *p_a); - -void GDAPI godot_pool_vector2_array_append(godot_pool_vector2_array *p_self, const godot_vector2 *p_data); - -void GDAPI godot_pool_vector2_array_append_array(godot_pool_vector2_array *p_self, const godot_pool_vector2_array *p_array); +void GDAPI godot_packed_vector2_array_new(godot_packed_vector2_array *r_dest); +void GDAPI godot_packed_vector2_array_new_copy(godot_packed_vector2_array *r_dest, const godot_packed_vector2_array *p_src); +void GDAPI godot_packed_vector2_array_new_with_array(godot_packed_vector2_array *r_dest, const godot_array *p_a); -godot_error GDAPI godot_pool_vector2_array_insert(godot_pool_vector2_array *p_self, const godot_int p_idx, const godot_vector2 *p_data); +void GDAPI godot_packed_vector2_array_append(godot_packed_vector2_array *p_self, const godot_vector2 *p_data); -void GDAPI godot_pool_vector2_array_invert(godot_pool_vector2_array *p_self); +void GDAPI godot_packed_vector2_array_append_array(godot_packed_vector2_array *p_self, const godot_packed_vector2_array *p_array); -void GDAPI godot_pool_vector2_array_push_back(godot_pool_vector2_array *p_self, const godot_vector2 *p_data); +godot_error GDAPI godot_packed_vector2_array_insert(godot_packed_vector2_array *p_self, const godot_int p_idx, const godot_vector2 *p_data); -void GDAPI godot_pool_vector2_array_remove(godot_pool_vector2_array *p_self, const godot_int p_idx); +void GDAPI godot_packed_vector2_array_invert(godot_packed_vector2_array *p_self); -void GDAPI godot_pool_vector2_array_resize(godot_pool_vector2_array *p_self, const godot_int p_size); +void GDAPI godot_packed_vector2_array_push_back(godot_packed_vector2_array *p_self, const godot_vector2 *p_data); -godot_pool_vector2_array_read_access GDAPI *godot_pool_vector2_array_read(const godot_pool_vector2_array *p_self); +void GDAPI godot_packed_vector2_array_remove(godot_packed_vector2_array *p_self, const godot_int p_idx); -godot_pool_vector2_array_write_access GDAPI *godot_pool_vector2_array_write(godot_pool_vector2_array *p_self); +void GDAPI godot_packed_vector2_array_resize(godot_packed_vector2_array *p_self, const godot_int p_size); -void GDAPI godot_pool_vector2_array_set(godot_pool_vector2_array *p_self, const godot_int p_idx, const godot_vector2 *p_data); -godot_vector2 GDAPI godot_pool_vector2_array_get(const godot_pool_vector2_array *p_self, const godot_int p_idx); +void GDAPI godot_packed_vector2_array_set(godot_packed_vector2_array *p_self, const godot_int p_idx, const godot_vector2 *p_data); +godot_vector2 GDAPI godot_packed_vector2_array_get(const godot_packed_vector2_array *p_self, const godot_int p_idx); -godot_int GDAPI godot_pool_vector2_array_size(const godot_pool_vector2_array *p_self); +godot_int GDAPI godot_packed_vector2_array_size(const godot_packed_vector2_array *p_self); -godot_bool GDAPI godot_pool_vector2_array_empty(const godot_pool_vector2_array *p_self); +godot_bool GDAPI godot_packed_vector2_array_empty(const godot_packed_vector2_array *p_self); -void GDAPI godot_pool_vector2_array_destroy(godot_pool_vector2_array *p_self); +void GDAPI godot_packed_vector2_array_destroy(godot_packed_vector2_array *p_self); // vector3 -void GDAPI godot_pool_vector3_array_new(godot_pool_vector3_array *r_dest); -void GDAPI godot_pool_vector3_array_new_copy(godot_pool_vector3_array *r_dest, const godot_pool_vector3_array *p_src); -void GDAPI godot_pool_vector3_array_new_with_array(godot_pool_vector3_array *r_dest, const godot_array *p_a); +void GDAPI godot_packed_vector3_array_new(godot_packed_vector3_array *r_dest); +void GDAPI godot_packed_vector3_array_new_copy(godot_packed_vector3_array *r_dest, const godot_packed_vector3_array *p_src); +void GDAPI godot_packed_vector3_array_new_with_array(godot_packed_vector3_array *r_dest, const godot_array *p_a); -void GDAPI godot_pool_vector3_array_append(godot_pool_vector3_array *p_self, const godot_vector3 *p_data); +void GDAPI godot_packed_vector3_array_append(godot_packed_vector3_array *p_self, const godot_vector3 *p_data); -void GDAPI godot_pool_vector3_array_append_array(godot_pool_vector3_array *p_self, const godot_pool_vector3_array *p_array); +void GDAPI godot_packed_vector3_array_append_array(godot_packed_vector3_array *p_self, const godot_packed_vector3_array *p_array); -godot_error GDAPI godot_pool_vector3_array_insert(godot_pool_vector3_array *p_self, const godot_int p_idx, const godot_vector3 *p_data); +godot_error GDAPI godot_packed_vector3_array_insert(godot_packed_vector3_array *p_self, const godot_int p_idx, const godot_vector3 *p_data); -void GDAPI godot_pool_vector3_array_invert(godot_pool_vector3_array *p_self); +void GDAPI godot_packed_vector3_array_invert(godot_packed_vector3_array *p_self); -void GDAPI godot_pool_vector3_array_push_back(godot_pool_vector3_array *p_self, const godot_vector3 *p_data); +void GDAPI godot_packed_vector3_array_push_back(godot_packed_vector3_array *p_self, const godot_vector3 *p_data); -void GDAPI godot_pool_vector3_array_remove(godot_pool_vector3_array *p_self, const godot_int p_idx); +void GDAPI godot_packed_vector3_array_remove(godot_packed_vector3_array *p_self, const godot_int p_idx); -void GDAPI godot_pool_vector3_array_resize(godot_pool_vector3_array *p_self, const godot_int p_size); +void GDAPI godot_packed_vector3_array_resize(godot_packed_vector3_array *p_self, const godot_int p_size); -godot_pool_vector3_array_read_access GDAPI *godot_pool_vector3_array_read(const godot_pool_vector3_array *p_self); +void GDAPI godot_packed_vector3_array_set(godot_packed_vector3_array *p_self, const godot_int p_idx, const godot_vector3 *p_data); +godot_vector3 GDAPI godot_packed_vector3_array_get(const godot_packed_vector3_array *p_self, const godot_int p_idx); -godot_pool_vector3_array_write_access GDAPI *godot_pool_vector3_array_write(godot_pool_vector3_array *p_self); +godot_int GDAPI godot_packed_vector3_array_size(const godot_packed_vector3_array *p_self); -void GDAPI godot_pool_vector3_array_set(godot_pool_vector3_array *p_self, const godot_int p_idx, const godot_vector3 *p_data); -godot_vector3 GDAPI godot_pool_vector3_array_get(const godot_pool_vector3_array *p_self, const godot_int p_idx); +godot_bool GDAPI godot_packed_vector3_array_empty(const godot_packed_vector3_array *p_self); -godot_int GDAPI godot_pool_vector3_array_size(const godot_pool_vector3_array *p_self); - -godot_bool GDAPI godot_pool_vector3_array_empty(const godot_pool_vector3_array *p_self); - -void GDAPI godot_pool_vector3_array_destroy(godot_pool_vector3_array *p_self); +void GDAPI godot_packed_vector3_array_destroy(godot_packed_vector3_array *p_self); // color -void GDAPI godot_pool_color_array_new(godot_pool_color_array *r_dest); -void GDAPI godot_pool_color_array_new_copy(godot_pool_color_array *r_dest, const godot_pool_color_array *p_src); -void GDAPI godot_pool_color_array_new_with_array(godot_pool_color_array *r_dest, const godot_array *p_a); - -void GDAPI godot_pool_color_array_append(godot_pool_color_array *p_self, const godot_color *p_data); - -void GDAPI godot_pool_color_array_append_array(godot_pool_color_array *p_self, const godot_pool_color_array *p_array); - -godot_error GDAPI godot_pool_color_array_insert(godot_pool_color_array *p_self, const godot_int p_idx, const godot_color *p_data); - -void GDAPI godot_pool_color_array_invert(godot_pool_color_array *p_self); - -void GDAPI godot_pool_color_array_push_back(godot_pool_color_array *p_self, const godot_color *p_data); - -void GDAPI godot_pool_color_array_remove(godot_pool_color_array *p_self, const godot_int p_idx); - -void GDAPI godot_pool_color_array_resize(godot_pool_color_array *p_self, const godot_int p_size); - -godot_pool_color_array_read_access GDAPI *godot_pool_color_array_read(const godot_pool_color_array *p_self); - -godot_pool_color_array_write_access GDAPI *godot_pool_color_array_write(godot_pool_color_array *p_self); - -void GDAPI godot_pool_color_array_set(godot_pool_color_array *p_self, const godot_int p_idx, const godot_color *p_data); -godot_color GDAPI godot_pool_color_array_get(const godot_pool_color_array *p_self, const godot_int p_idx); - -godot_int GDAPI godot_pool_color_array_size(const godot_pool_color_array *p_self); - -godot_bool GDAPI godot_pool_color_array_empty(const godot_pool_color_array *p_self); - -void GDAPI godot_pool_color_array_destroy(godot_pool_color_array *p_self); - -// -// read accessor functions -// - -godot_pool_byte_array_read_access GDAPI *godot_pool_byte_array_read_access_copy(const godot_pool_byte_array_read_access *p_other); -const uint8_t GDAPI *godot_pool_byte_array_read_access_ptr(const godot_pool_byte_array_read_access *p_read); -void GDAPI godot_pool_byte_array_read_access_operator_assign(godot_pool_byte_array_read_access *p_read, godot_pool_byte_array_read_access *p_other); -void GDAPI godot_pool_byte_array_read_access_destroy(godot_pool_byte_array_read_access *p_read); - -godot_pool_int_array_read_access GDAPI *godot_pool_int_array_read_access_copy(const godot_pool_int_array_read_access *p_other); -const godot_int GDAPI *godot_pool_int_array_read_access_ptr(const godot_pool_int_array_read_access *p_read); -void GDAPI godot_pool_int_array_read_access_operator_assign(godot_pool_int_array_read_access *p_read, godot_pool_int_array_read_access *p_other); -void GDAPI godot_pool_int_array_read_access_destroy(godot_pool_int_array_read_access *p_read); - -godot_pool_real_array_read_access GDAPI *godot_pool_real_array_read_access_copy(const godot_pool_real_array_read_access *p_other); -const godot_real GDAPI *godot_pool_real_array_read_access_ptr(const godot_pool_real_array_read_access *p_read); -void GDAPI godot_pool_real_array_read_access_operator_assign(godot_pool_real_array_read_access *p_read, godot_pool_real_array_read_access *p_other); -void GDAPI godot_pool_real_array_read_access_destroy(godot_pool_real_array_read_access *p_read); - -godot_pool_string_array_read_access GDAPI *godot_pool_string_array_read_access_copy(const godot_pool_string_array_read_access *p_other); -const godot_string GDAPI *godot_pool_string_array_read_access_ptr(const godot_pool_string_array_read_access *p_read); -void GDAPI godot_pool_string_array_read_access_operator_assign(godot_pool_string_array_read_access *p_read, godot_pool_string_array_read_access *p_other); -void GDAPI godot_pool_string_array_read_access_destroy(godot_pool_string_array_read_access *p_read); +void GDAPI godot_packed_color_array_new(godot_packed_color_array *r_dest); +void GDAPI godot_packed_color_array_new_copy(godot_packed_color_array *r_dest, const godot_packed_color_array *p_src); +void GDAPI godot_packed_color_array_new_with_array(godot_packed_color_array *r_dest, const godot_array *p_a); -godot_pool_vector2_array_read_access GDAPI *godot_pool_vector2_array_read_access_copy(const godot_pool_vector2_array_read_access *p_other); -const godot_vector2 GDAPI *godot_pool_vector2_array_read_access_ptr(const godot_pool_vector2_array_read_access *p_read); -void GDAPI godot_pool_vector2_array_read_access_operator_assign(godot_pool_vector2_array_read_access *p_read, godot_pool_vector2_array_read_access *p_other); -void GDAPI godot_pool_vector2_array_read_access_destroy(godot_pool_vector2_array_read_access *p_read); +void GDAPI godot_packed_color_array_append(godot_packed_color_array *p_self, const godot_color *p_data); -godot_pool_vector3_array_read_access GDAPI *godot_pool_vector3_array_read_access_copy(const godot_pool_vector3_array_read_access *p_other); -const godot_vector3 GDAPI *godot_pool_vector3_array_read_access_ptr(const godot_pool_vector3_array_read_access *p_read); -void GDAPI godot_pool_vector3_array_read_access_operator_assign(godot_pool_vector3_array_read_access *p_read, godot_pool_vector3_array_read_access *p_other); -void GDAPI godot_pool_vector3_array_read_access_destroy(godot_pool_vector3_array_read_access *p_read); +void GDAPI godot_packed_color_array_append_array(godot_packed_color_array *p_self, const godot_packed_color_array *p_array); -godot_pool_color_array_read_access GDAPI *godot_pool_color_array_read_access_copy(const godot_pool_color_array_read_access *p_other); -const godot_color GDAPI *godot_pool_color_array_read_access_ptr(const godot_pool_color_array_read_access *p_read); -void GDAPI godot_pool_color_array_read_access_operator_assign(godot_pool_color_array_read_access *p_read, godot_pool_color_array_read_access *p_other); -void GDAPI godot_pool_color_array_read_access_destroy(godot_pool_color_array_read_access *p_read); +godot_error GDAPI godot_packed_color_array_insert(godot_packed_color_array *p_self, const godot_int p_idx, const godot_color *p_data); -// -// write accessor functions -// +void GDAPI godot_packed_color_array_invert(godot_packed_color_array *p_self); -godot_pool_byte_array_write_access GDAPI *godot_pool_byte_array_write_access_copy(const godot_pool_byte_array_write_access *p_other); -uint8_t GDAPI *godot_pool_byte_array_write_access_ptr(const godot_pool_byte_array_write_access *p_write); -void GDAPI godot_pool_byte_array_write_access_operator_assign(godot_pool_byte_array_write_access *p_write, godot_pool_byte_array_write_access *p_other); -void GDAPI godot_pool_byte_array_write_access_destroy(godot_pool_byte_array_write_access *p_write); +void GDAPI godot_packed_color_array_push_back(godot_packed_color_array *p_self, const godot_color *p_data); -godot_pool_int_array_write_access GDAPI *godot_pool_int_array_write_access_copy(const godot_pool_int_array_write_access *p_other); -godot_int GDAPI *godot_pool_int_array_write_access_ptr(const godot_pool_int_array_write_access *p_write); -void GDAPI godot_pool_int_array_write_access_operator_assign(godot_pool_int_array_write_access *p_write, godot_pool_int_array_write_access *p_other); -void GDAPI godot_pool_int_array_write_access_destroy(godot_pool_int_array_write_access *p_write); +void GDAPI godot_packed_color_array_remove(godot_packed_color_array *p_self, const godot_int p_idx); -godot_pool_real_array_write_access GDAPI *godot_pool_real_array_write_access_copy(const godot_pool_real_array_write_access *p_other); -godot_real GDAPI *godot_pool_real_array_write_access_ptr(const godot_pool_real_array_write_access *p_write); -void GDAPI godot_pool_real_array_write_access_operator_assign(godot_pool_real_array_write_access *p_write, godot_pool_real_array_write_access *p_other); -void GDAPI godot_pool_real_array_write_access_destroy(godot_pool_real_array_write_access *p_write); +void GDAPI godot_packed_color_array_resize(godot_packed_color_array *p_self, const godot_int p_size); -godot_pool_string_array_write_access GDAPI *godot_pool_string_array_write_access_copy(const godot_pool_string_array_write_access *p_other); -godot_string GDAPI *godot_pool_string_array_write_access_ptr(const godot_pool_string_array_write_access *p_write); -void GDAPI godot_pool_string_array_write_access_operator_assign(godot_pool_string_array_write_access *p_write, godot_pool_string_array_write_access *p_other); -void GDAPI godot_pool_string_array_write_access_destroy(godot_pool_string_array_write_access *p_write); +void GDAPI godot_packed_color_array_set(godot_packed_color_array *p_self, const godot_int p_idx, const godot_color *p_data); +godot_color GDAPI godot_packed_color_array_get(const godot_packed_color_array *p_self, const godot_int p_idx); -godot_pool_vector2_array_write_access GDAPI *godot_pool_vector2_array_write_access_copy(const godot_pool_vector2_array_write_access *p_other); -godot_vector2 GDAPI *godot_pool_vector2_array_write_access_ptr(const godot_pool_vector2_array_write_access *p_write); -void GDAPI godot_pool_vector2_array_write_access_operator_assign(godot_pool_vector2_array_write_access *p_write, godot_pool_vector2_array_write_access *p_other); -void GDAPI godot_pool_vector2_array_write_access_destroy(godot_pool_vector2_array_write_access *p_write); +godot_int GDAPI godot_packed_color_array_size(const godot_packed_color_array *p_self); -godot_pool_vector3_array_write_access GDAPI *godot_pool_vector3_array_write_access_copy(const godot_pool_vector3_array_write_access *p_other); -godot_vector3 GDAPI *godot_pool_vector3_array_write_access_ptr(const godot_pool_vector3_array_write_access *p_write); -void GDAPI godot_pool_vector3_array_write_access_operator_assign(godot_pool_vector3_array_write_access *p_write, godot_pool_vector3_array_write_access *p_other); -void GDAPI godot_pool_vector3_array_write_access_destroy(godot_pool_vector3_array_write_access *p_write); +godot_bool GDAPI godot_packed_color_array_empty(const godot_packed_color_array *p_self); -godot_pool_color_array_write_access GDAPI *godot_pool_color_array_write_access_copy(const godot_pool_color_array_write_access *p_other); -godot_color GDAPI *godot_pool_color_array_write_access_ptr(const godot_pool_color_array_write_access *p_write); -void GDAPI godot_pool_color_array_write_access_operator_assign(godot_pool_color_array_write_access *p_write, godot_pool_color_array_write_access *p_other); -void GDAPI godot_pool_color_array_write_access_destroy(godot_pool_color_array_write_access *p_write); +void GDAPI godot_packed_color_array_destroy(godot_packed_color_array *p_self); #ifdef __cplusplus } diff --git a/modules/gdnative/include/gdnative/string.h b/modules/gdnative/include/gdnative/string.h index b676d21fb2..608978db76 100644 --- a/modules/gdnative/include/gdnative/string.h +++ b/modules/gdnative/include/gdnative/string.h @@ -209,9 +209,9 @@ uint32_t GDAPI godot_string_hash_chars(const char *p_cstr); uint32_t GDAPI godot_string_hash_chars_with_len(const char *p_cstr, godot_int p_len); uint32_t GDAPI godot_string_hash_utf8_chars(const wchar_t *p_str); uint32_t GDAPI godot_string_hash_utf8_chars_with_len(const wchar_t *p_str, godot_int p_len); -godot_pool_byte_array GDAPI godot_string_md5_buffer(const godot_string *p_self); +godot_packed_byte_array GDAPI godot_string_md5_buffer(const godot_string *p_self); godot_string GDAPI godot_string_md5_text(const godot_string *p_self); -godot_pool_byte_array GDAPI godot_string_sha256_buffer(const godot_string *p_self); +godot_packed_byte_array GDAPI godot_string_sha256_buffer(const godot_string *p_self); godot_string GDAPI godot_string_sha256_text(const godot_string *p_self); godot_bool godot_string_empty(const godot_string *p_self); @@ -252,7 +252,7 @@ godot_string GDAPI godot_string_dedent(const godot_string *p_self); godot_string GDAPI godot_string_trim_prefix(const godot_string *p_self, const godot_string *p_prefix); godot_string GDAPI godot_string_trim_suffix(const godot_string *p_self, const godot_string *p_suffix); godot_string GDAPI godot_string_rstrip(const godot_string *p_self, const godot_string *p_chars); -godot_pool_string_array GDAPI godot_string_rsplit(const godot_string *p_self, const godot_string *p_divisor, const godot_bool p_allow_empty, const godot_int p_maxsplit); +godot_packed_string_array GDAPI godot_string_rsplit(const godot_string *p_self, const godot_string *p_divisor, const godot_bool p_allow_empty, const godot_int p_maxsplit); void GDAPI godot_string_destroy(godot_string *p_self); diff --git a/modules/gdnative/include/gdnative/variant.h b/modules/gdnative/include/gdnative/variant.h index c65f7a28d2..4d70f1143c 100644 --- a/modules/gdnative/include/gdnative/variant.h +++ b/modules/gdnative/include/gdnative/variant.h @@ -76,13 +76,13 @@ typedef enum godot_variant_type { GODOT_VARIANT_TYPE_ARRAY, // 20 // arrays - GODOT_VARIANT_TYPE_POOL_BYTE_ARRAY, - GODOT_VARIANT_TYPE_POOL_INT_ARRAY, - GODOT_VARIANT_TYPE_POOL_REAL_ARRAY, - GODOT_VARIANT_TYPE_POOL_STRING_ARRAY, - GODOT_VARIANT_TYPE_POOL_VECTOR2_ARRAY, // 25 - GODOT_VARIANT_TYPE_POOL_VECTOR3_ARRAY, - GODOT_VARIANT_TYPE_POOL_COLOR_ARRAY, + GODOT_VARIANT_TYPE_PACKED_BYTE_ARRAY, + GODOT_VARIANT_TYPE_PACKED_INT_ARRAY, + GODOT_VARIANT_TYPE_PACKED_REAL_ARRAY, + GODOT_VARIANT_TYPE_PACKED_STRING_ARRAY, + GODOT_VARIANT_TYPE_PACKED_VECTOR2_ARRAY, // 25 + GODOT_VARIANT_TYPE_PACKED_VECTOR3_ARRAY, + GODOT_VARIANT_TYPE_PACKED_COLOR_ARRAY, } godot_variant_type; typedef enum godot_variant_call_error_error { @@ -194,13 +194,13 @@ void GDAPI godot_variant_new_rid(godot_variant *r_dest, const godot_rid *p_rid); void GDAPI godot_variant_new_object(godot_variant *r_dest, const godot_object *p_obj); void GDAPI godot_variant_new_dictionary(godot_variant *r_dest, const godot_dictionary *p_dict); void GDAPI godot_variant_new_array(godot_variant *r_dest, const godot_array *p_arr); -void GDAPI godot_variant_new_pool_byte_array(godot_variant *r_dest, const godot_pool_byte_array *p_pba); -void GDAPI godot_variant_new_pool_int_array(godot_variant *r_dest, const godot_pool_int_array *p_pia); -void GDAPI godot_variant_new_pool_real_array(godot_variant *r_dest, const godot_pool_real_array *p_pra); -void GDAPI godot_variant_new_pool_string_array(godot_variant *r_dest, const godot_pool_string_array *p_psa); -void GDAPI godot_variant_new_pool_vector2_array(godot_variant *r_dest, const godot_pool_vector2_array *p_pv2a); -void GDAPI godot_variant_new_pool_vector3_array(godot_variant *r_dest, const godot_pool_vector3_array *p_pv3a); -void GDAPI godot_variant_new_pool_color_array(godot_variant *r_dest, const godot_pool_color_array *p_pca); +void GDAPI godot_variant_new_packed_byte_array(godot_variant *r_dest, const godot_packed_byte_array *p_pba); +void GDAPI godot_variant_new_packed_int_array(godot_variant *r_dest, const godot_packed_int_array *p_pia); +void GDAPI godot_variant_new_packed_real_array(godot_variant *r_dest, const godot_packed_real_array *p_pra); +void GDAPI godot_variant_new_packed_string_array(godot_variant *r_dest, const godot_packed_string_array *p_psa); +void GDAPI godot_variant_new_packed_vector2_array(godot_variant *r_dest, const godot_packed_vector2_array *p_pv2a); +void GDAPI godot_variant_new_packed_vector3_array(godot_variant *r_dest, const godot_packed_vector3_array *p_pv3a); +void GDAPI godot_variant_new_packed_color_array(godot_variant *r_dest, const godot_packed_color_array *p_pca); godot_bool GDAPI godot_variant_as_bool(const godot_variant *p_self); uint64_t GDAPI godot_variant_as_uint(const godot_variant *p_self); @@ -222,13 +222,13 @@ godot_rid GDAPI godot_variant_as_rid(const godot_variant *p_self); godot_object GDAPI *godot_variant_as_object(const godot_variant *p_self); godot_dictionary GDAPI godot_variant_as_dictionary(const godot_variant *p_self); godot_array GDAPI godot_variant_as_array(const godot_variant *p_self); -godot_pool_byte_array GDAPI godot_variant_as_pool_byte_array(const godot_variant *p_self); -godot_pool_int_array GDAPI godot_variant_as_pool_int_array(const godot_variant *p_self); -godot_pool_real_array GDAPI godot_variant_as_pool_real_array(const godot_variant *p_self); -godot_pool_string_array GDAPI godot_variant_as_pool_string_array(const godot_variant *p_self); -godot_pool_vector2_array GDAPI godot_variant_as_pool_vector2_array(const godot_variant *p_self); -godot_pool_vector3_array GDAPI godot_variant_as_pool_vector3_array(const godot_variant *p_self); -godot_pool_color_array GDAPI godot_variant_as_pool_color_array(const godot_variant *p_self); +godot_packed_byte_array GDAPI godot_variant_as_packed_byte_array(const godot_variant *p_self); +godot_packed_int_array GDAPI godot_variant_as_packed_int_array(const godot_variant *p_self); +godot_packed_real_array GDAPI godot_variant_as_packed_real_array(const godot_variant *p_self); +godot_packed_string_array GDAPI godot_variant_as_packed_string_array(const godot_variant *p_self); +godot_packed_vector2_array GDAPI godot_variant_as_packed_vector2_array(const godot_variant *p_self); +godot_packed_vector3_array GDAPI godot_variant_as_packed_vector3_array(const godot_variant *p_self); +godot_packed_color_array GDAPI godot_variant_as_packed_color_array(const godot_variant *p_self); godot_variant GDAPI godot_variant_call(godot_variant *p_self, const godot_string *p_method, const godot_variant **p_args, const godot_int p_argcount, godot_variant_call_error *r_error); diff --git a/modules/gdnative/include/pluginscript/godot_pluginscript.h b/modules/gdnative/include/pluginscript/godot_pluginscript.h index 210d3f7756..341e7f9e2b 100644 --- a/modules/gdnative/include/pluginscript/godot_pluginscript.h +++ b/modules/gdnative/include/pluginscript/godot_pluginscript.h @@ -129,9 +129,9 @@ typedef struct { godot_bool supports_builtin_mode; godot_string (*get_template_source_code)(godot_pluginscript_language_data *p_data, const godot_string *p_class_name, const godot_string *p_base_class_name); - godot_bool (*validate)(godot_pluginscript_language_data *p_data, const godot_string *p_script, int *r_line_error, int *r_col_error, godot_string *r_test_error, const godot_string *p_path, godot_pool_string_array *r_functions); + godot_bool (*validate)(godot_pluginscript_language_data *p_data, const godot_string *p_script, int *r_line_error, int *r_col_error, godot_string *r_test_error, const godot_string *p_path, godot_packed_string_array *r_functions); int (*find_function)(godot_pluginscript_language_data *p_data, const godot_string *p_function, const godot_string *p_code); // Can be NULL - godot_string (*make_function)(godot_pluginscript_language_data *p_data, const godot_string *p_class, const godot_string *p_name, const godot_pool_string_array *p_args); + godot_string (*make_function)(godot_pluginscript_language_data *p_data, const godot_string *p_class, const godot_string *p_name, const godot_packed_string_array *p_args); godot_error (*complete_code)(godot_pluginscript_language_data *p_data, const godot_string *p_code, const godot_string *p_path, godot_object *p_owner, godot_array *r_options, godot_bool *r_force, godot_string *r_call_hint); void (*auto_indent_code)(godot_pluginscript_language_data *p_data, godot_string *p_code, int p_from_line, int p_to_line); @@ -141,9 +141,9 @@ typedef struct { int (*debug_get_stack_level_line)(godot_pluginscript_language_data *p_data, int p_level); godot_string (*debug_get_stack_level_function)(godot_pluginscript_language_data *p_data, int p_level); godot_string (*debug_get_stack_level_source)(godot_pluginscript_language_data *p_data, int p_level); - void (*debug_get_stack_level_locals)(godot_pluginscript_language_data *p_data, int p_level, godot_pool_string_array *p_locals, godot_array *p_values, int p_max_subitems, int p_max_depth); - void (*debug_get_stack_level_members)(godot_pluginscript_language_data *p_data, int p_level, godot_pool_string_array *p_members, godot_array *p_values, int p_max_subitems, int p_max_depth); - void (*debug_get_globals)(godot_pluginscript_language_data *p_data, godot_pool_string_array *p_locals, godot_array *p_values, int p_max_subitems, int p_max_depth); + void (*debug_get_stack_level_locals)(godot_pluginscript_language_data *p_data, int p_level, godot_packed_string_array *p_locals, godot_array *p_values, int p_max_subitems, int p_max_depth); + void (*debug_get_stack_level_members)(godot_pluginscript_language_data *p_data, int p_level, godot_packed_string_array *p_members, godot_array *p_values, int p_max_subitems, int p_max_depth); + void (*debug_get_globals)(godot_pluginscript_language_data *p_data, godot_packed_string_array *p_locals, godot_array *p_values, int p_max_subitems, int p_max_depth); godot_string (*debug_parse_stack_level_expression)(godot_pluginscript_language_data *p_data, int p_level, const godot_string *p_expression, int p_max_subitems, int p_max_depth); // TODO: could this stuff be moved to the godot_pluginscript_language_desc ? diff --git a/modules/gdnative/include/videodecoder/godot_videodecoder.h b/modules/gdnative/include/videodecoder/godot_videodecoder.h index 714991ca72..3e91a2e9ac 100644 --- a/modules/gdnative/include/videodecoder/godot_videodecoder.h +++ b/modules/gdnative/include/videodecoder/godot_videodecoder.h @@ -54,7 +54,7 @@ typedef struct void (*seek)(void *, godot_real); void (*set_audio_track)(void *, godot_int); void (*update)(void *, godot_real); - godot_pool_byte_array *(*get_videoframe)(void *); + godot_packed_byte_array *(*get_videoframe)(void *); godot_int (*get_audioframe)(void *, float *, int); godot_int (*get_channels)(const void *); godot_int (*get_mix_rate)(const void *); diff --git a/modules/gdnative/nativescript/nativescript.cpp b/modules/gdnative/nativescript/nativescript.cpp index df85155ff5..a2be4807d7 100644 --- a/modules/gdnative/nativescript/nativescript.cpp +++ b/modules/gdnative/nativescript/nativescript.cpp @@ -1361,7 +1361,7 @@ bool NativeScriptLanguage::supports_builtin_mode() const { int NativeScriptLanguage::find_function(const String &p_function, const String &p_code) const { return -1; } -String NativeScriptLanguage::make_function(const String &p_class, const String &p_name, const PoolStringArray &p_args) const { +String NativeScriptLanguage::make_function(const String &p_class, const String &p_name, const PackedStringArray &p_args) const { return ""; } void NativeScriptLanguage::auto_indent_code(String &p_code, int p_from_line, int p_to_line) const { diff --git a/modules/gdnative/nativescript/nativescript.h b/modules/gdnative/nativescript/nativescript.h index 2ff08e32cd..58e4052368 100644 --- a/modules/gdnative/nativescript/nativescript.h +++ b/modules/gdnative/nativescript/nativescript.h @@ -352,7 +352,7 @@ public: virtual bool has_named_classes() const; virtual bool supports_builtin_mode() const; virtual int find_function(const String &p_function, const String &p_code) const; - virtual String make_function(const String &p_class, const String &p_name, const PoolStringArray &p_args) const; + virtual String make_function(const String &p_class, const String &p_name, const PackedStringArray &p_args) const; virtual void auto_indent_code(String &p_code, int p_from_line, int p_to_line) const; virtual void add_global_constant(const StringName &p_variable, const Variant &p_value); virtual String debug_get_error() const; diff --git a/modules/gdnative/pluginscript/pluginscript_language.cpp b/modules/gdnative/pluginscript/pluginscript_language.cpp index 421d6e0a89..4e39f4b0a8 100644 --- a/modules/gdnative/pluginscript/pluginscript_language.cpp +++ b/modules/gdnative/pluginscript/pluginscript_language.cpp @@ -109,7 +109,7 @@ Ref<Script> PluginScriptLanguage::get_template(const String &p_class_name, const } bool PluginScriptLanguage::validate(const String &p_script, int &r_line_error, int &r_col_error, String &r_test_error, const String &p_path, List<String> *r_functions, List<ScriptLanguage::Warning> *r_warnings, Set<int> *r_safe_lines) const { - PoolStringArray functions; + PackedStringArray functions; if (_desc.validate) { bool ret = _desc.validate( _data, @@ -118,7 +118,7 @@ bool PluginScriptLanguage::validate(const String &p_script, int &r_line_error, i &r_col_error, (godot_string *)&r_test_error, (godot_string *)&p_path, - (godot_pool_string_array *)&functions); + (godot_packed_string_array *)&functions); for (int i = 0; i < functions.size(); i++) { r_functions->push_back(functions[i]); } @@ -149,9 +149,9 @@ int PluginScriptLanguage::find_function(const String &p_function, const String & return -1; } -String PluginScriptLanguage::make_function(const String &p_class, const String &p_name, const PoolStringArray &p_args) const { +String PluginScriptLanguage::make_function(const String &p_class, const String &p_name, const PackedStringArray &p_args) const { if (_desc.make_function) { - godot_string tmp = _desc.make_function(_data, (godot_string *)&p_class, (godot_string *)&p_name, (godot_pool_string_array *)&p_args); + godot_string tmp = _desc.make_function(_data, (godot_string *)&p_class, (godot_string *)&p_name, (godot_packed_string_array *)&p_args); String ret = *(String *)&tmp; godot_string_destroy(&tmp); return ret; @@ -336,9 +336,9 @@ String PluginScriptLanguage::debug_get_stack_level_source(int p_level) const { void PluginScriptLanguage::debug_get_stack_level_locals(int p_level, List<String> *p_locals, List<Variant> *p_values, int p_max_subitems, int p_max_depth) { if (_desc.debug_get_stack_level_locals) { - PoolStringArray locals; + PackedStringArray locals; Array values; - _desc.debug_get_stack_level_locals(_data, p_level, (godot_pool_string_array *)&locals, (godot_array *)&values, p_max_subitems, p_max_depth); + _desc.debug_get_stack_level_locals(_data, p_level, (godot_packed_string_array *)&locals, (godot_array *)&values, p_max_subitems, p_max_depth); for (int i = 0; i < locals.size(); i++) { p_locals->push_back(locals[i]); } @@ -350,9 +350,9 @@ void PluginScriptLanguage::debug_get_stack_level_locals(int p_level, List<String void PluginScriptLanguage::debug_get_stack_level_members(int p_level, List<String> *p_members, List<Variant> *p_values, int p_max_subitems, int p_max_depth) { if (_desc.debug_get_stack_level_members) { - PoolStringArray members; + PackedStringArray members; Array values; - _desc.debug_get_stack_level_members(_data, p_level, (godot_pool_string_array *)&members, (godot_array *)&values, p_max_subitems, p_max_depth); + _desc.debug_get_stack_level_members(_data, p_level, (godot_packed_string_array *)&members, (godot_array *)&values, p_max_subitems, p_max_depth); for (int i = 0; i < members.size(); i++) { p_members->push_back(members[i]); } @@ -364,9 +364,9 @@ void PluginScriptLanguage::debug_get_stack_level_members(int p_level, List<Strin void PluginScriptLanguage::debug_get_globals(List<String> *p_locals, List<Variant> *p_values, int p_max_subitems, int p_max_depth) { if (_desc.debug_get_globals) { - PoolStringArray locals; + PackedStringArray locals; Array values; - _desc.debug_get_globals(_data, (godot_pool_string_array *)&locals, (godot_array *)&values, p_max_subitems, p_max_depth); + _desc.debug_get_globals(_data, (godot_packed_string_array *)&locals, (godot_array *)&values, p_max_subitems, p_max_depth); for (int i = 0; i < locals.size(); i++) { p_locals->push_back(locals[i]); } diff --git a/modules/gdnative/pluginscript/pluginscript_language.h b/modules/gdnative/pluginscript/pluginscript_language.h index 145ab5599c..037d7a4948 100644 --- a/modules/gdnative/pluginscript/pluginscript_language.h +++ b/modules/gdnative/pluginscript/pluginscript_language.h @@ -80,7 +80,7 @@ public: virtual bool supports_builtin_mode() const; virtual bool can_inherit_from_file() { return true; } virtual int find_function(const String &p_function, const String &p_code) const; - virtual String make_function(const String &p_class, const String &p_name, const PoolStringArray &p_args) const; + virtual String make_function(const String &p_class, const String &p_name, const PackedStringArray &p_args) const; virtual Error complete_code(const String &p_code, const String &p_path, Object *p_owner, List<ScriptCodeCompletionOption> *r_options, bool &r_force, String &r_call_hint); virtual void auto_indent_code(String &p_code, int p_from_line, int p_to_line) const; virtual void add_global_constant(const StringName &p_variable, const Variant &p_value); diff --git a/modules/gdnative/pluginscript/pluginscript_script.cpp b/modules/gdnative/pluginscript/pluginscript_script.cpp index c370062262..fffb169129 100644 --- a/modules/gdnative/pluginscript/pluginscript_script.cpp +++ b/modules/gdnative/pluginscript/pluginscript_script.cpp @@ -428,22 +428,22 @@ ScriptLanguage *PluginScript::get_language() const { Error PluginScript::load_source_code(const String &p_path) { - PoolVector<uint8_t> sourcef; + Vector<uint8_t> sourcef; Error err; FileAccess *f = FileAccess::open(p_path, FileAccess::READ, &err); ERR_FAIL_COND_V_MSG(err, err, "Cannot open file '" + p_path + "'."); int len = f->get_len(); sourcef.resize(len + 1); - PoolVector<uint8_t>::Write w = sourcef.write(); - int r = f->get_buffer(w.ptr(), len); + uint8_t *w = sourcef.ptrw(); + int r = f->get_buffer(w, len); f->close(); memdelete(f); ERR_FAIL_COND_V(r != len, ERR_CANT_OPEN); w[len] = 0; String s; - if (s.parse_utf8((const char *)w.ptr())) { + if (s.parse_utf8((const char *)w)) { ERR_FAIL_V_MSG(ERR_INVALID_DATA, "Script '" + p_path + "' contains invalid unicode (UTF-8), so it was not loaded. Please ensure that scripts are saved in valid UTF-8 unicode."); } diff --git a/modules/gdnative/register_types.cpp b/modules/gdnative/register_types.cpp index 4142f60ba6..e5d688afd4 100644 --- a/modules/gdnative/register_types.cpp +++ b/modules/gdnative/register_types.cpp @@ -325,7 +325,7 @@ void unregister_gdnative_types() { print_line(String("dict:\t" ) + itos(sizeof(Dictionary))); print_line(String("node_path:\t") + itos(sizeof(NodePath))); print_line(String("plane:\t") + itos(sizeof(Plane))); - print_line(String("poolarray:\t") + itos(sizeof(PoolByteArray))); + print_line(String("poolarray:\t") + itos(sizeof(PackedByteArray))); print_line(String("quat:\t") + itos(sizeof(Quat))); print_line(String("rect2:\t") + itos(sizeof(Rect2))); print_line(String("aabb:\t") + itos(sizeof(AABB))); diff --git a/modules/gdnative/videodecoder/video_stream_gdnative.cpp b/modules/gdnative/videodecoder/video_stream_gdnative.cpp index 8dcafc1987..bd16563ff0 100644 --- a/modules/gdnative/videodecoder/video_stream_gdnative.cpp +++ b/modules/gdnative/videodecoder/video_stream_gdnative.cpp @@ -187,7 +187,7 @@ void VideoStreamPlaybackGDNative::update(float p_delta) { } void VideoStreamPlaybackGDNative::update_texture() { - PoolByteArray *pba = (PoolByteArray *)interface->get_videoframe(data_struct); + PackedByteArray *pba = (PackedByteArray *)interface->get_videoframe(data_struct); if (pba == NULL) { playing = false; diff --git a/modules/gdnavigation/nav_region.cpp b/modules/gdnavigation/nav_region.cpp index d2d9d8b517..0215821305 100644 --- a/modules/gdnavigation/nav_region.cpp +++ b/modules/gdnavigation/nav_region.cpp @@ -78,12 +78,12 @@ void NavRegion::update_polygons() { if (mesh.is_null()) return; - PoolVector<Vector3> vertices = mesh->get_vertices(); + Vector<Vector3> vertices = mesh->get_vertices(); int len = vertices.size(); if (len == 0) return; - PoolVector<Vector3>::Read vertices_r = vertices.read(); + const Vector3 *vertices_r = vertices.ptr(); polygons.resize(mesh->get_polygon_count()); diff --git a/modules/gdnavigation/navigation_mesh_generator.cpp b/modules/gdnavigation/navigation_mesh_generator.cpp index 04b86fabc5..7f8761dac8 100644 --- a/modules/gdnavigation/navigation_mesh_generator.cpp +++ b/modules/gdnavigation/navigation_mesh_generator.cpp @@ -90,13 +90,13 @@ void NavigationMeshGenerator::_add_mesh(const Ref<Mesh> &p_mesh, const Transform Array a = p_mesh->surface_get_arrays(i); - PoolVector<Vector3> mesh_vertices = a[Mesh::ARRAY_VERTEX]; - PoolVector<Vector3>::Read vr = mesh_vertices.read(); + Vector<Vector3> mesh_vertices = a[Mesh::ARRAY_VERTEX]; + const Vector3 *vr = mesh_vertices.ptr(); if (p_mesh->surface_get_format(i) & Mesh::ARRAY_FORMAT_INDEX) { - PoolVector<int> mesh_indices = a[Mesh::ARRAY_INDEX]; - PoolVector<int>::Read ir = mesh_indices.read(); + Vector<int> mesh_indices = a[Mesh::ARRAY_INDEX]; + const int *ir = mesh_indices.ptr(); for (int j = 0; j < mesh_vertices.size(); j++) { _add_vertex(p_xform.xform(vr[j]), p_verticies); @@ -123,7 +123,7 @@ void NavigationMeshGenerator::_add_mesh(const Ref<Mesh> &p_mesh, const Transform } } -void NavigationMeshGenerator::_add_faces(const PoolVector3Array &p_faces, const Transform &p_xform, Vector<float> &p_verticies, Vector<int> &p_indices) { +void NavigationMeshGenerator::_add_faces(const PackedVector3Array &p_faces, const Transform &p_xform, Vector<float> &p_verticies, Vector<int> &p_indices) { int face_count = p_faces.size() / 3; int current_vertex_count = p_verticies.size() / 3; @@ -227,7 +227,7 @@ void NavigationMeshGenerator::_parse_geometry(Transform p_accumulated_transform, Error err = QuickHull::build(varr, md); if (err == OK) { - PoolVector3Array faces; + PackedVector3Array faces; for (int j = 0; j < md.faces.size(); ++j) { Geometry::MeshData::Face face = md.faces[j]; @@ -279,11 +279,11 @@ void NavigationMeshGenerator::_parse_geometry(Transform p_accumulated_transform, void NavigationMeshGenerator::_convert_detail_mesh_to_native_navigation_mesh(const rcPolyMeshDetail *p_detail_mesh, Ref<NavigationMesh> p_nav_mesh) { - PoolVector<Vector3> nav_vertices; + Vector<Vector3> nav_vertices; for (int i = 0; i < p_detail_mesh->nverts; i++) { const float *v = &p_detail_mesh->verts[i * 3]; - nav_vertices.append(Vector3(v[0], v[1], v[2])); + nav_vertices.push_back(Vector3(v[0], v[1], v[2])); } p_nav_mesh->set_vertices(nav_vertices); @@ -562,7 +562,7 @@ void NavigationMeshGenerator::bake(Ref<NavigationMesh> p_nav_mesh, Node *p_node) void NavigationMeshGenerator::clear(Ref<NavigationMesh> p_nav_mesh) { if (p_nav_mesh.is_valid()) { p_nav_mesh->clear_polygons(); - p_nav_mesh->set_vertices(PoolVector<Vector3>()); + p_nav_mesh->set_vertices(Vector<Vector3>()); } } diff --git a/modules/gdnavigation/navigation_mesh_generator.h b/modules/gdnavigation/navigation_mesh_generator.h index 107dee75e2..27a56e1d7a 100644 --- a/modules/gdnavigation/navigation_mesh_generator.h +++ b/modules/gdnavigation/navigation_mesh_generator.h @@ -51,7 +51,7 @@ protected: static void _add_vertex(const Vector3 &p_vec3, Vector<float> &p_verticies); static void _add_mesh(const Ref<Mesh> &p_mesh, const Transform &p_xform, Vector<float> &p_verticies, Vector<int> &p_indices); - static void _add_faces(const PoolVector3Array &p_faces, const Transform &p_xform, Vector<float> &p_verticies, Vector<int> &p_indices); + static void _add_faces(const PackedVector3Array &p_faces, const Transform &p_xform, Vector<float> &p_verticies, Vector<int> &p_indices); static void _parse_geometry(Transform p_accumulated_transform, Node *p_node, Vector<float> &p_verticies, Vector<int> &p_indices, int p_generate_from, uint32_t p_collision_mask, bool p_recurse_children); static void _convert_detail_mesh_to_native_navigation_mesh(const rcPolyMeshDetail *p_detail_mesh, Ref<NavigationMesh> p_nav_mesh); diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index 07c74a2e26..a73276dda2 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -902,7 +902,7 @@ Error GDScript::load_byte_code(const String &p_path) { Error GDScript::load_source_code(const String &p_path) { - PoolVector<uint8_t> sourcef; + Vector<uint8_t> sourcef; Error err; FileAccess *f = FileAccess::open(p_path, FileAccess::READ, &err); if (err) { @@ -912,15 +912,15 @@ Error GDScript::load_source_code(const String &p_path) { int len = f->get_len(); sourcef.resize(len + 1); - PoolVector<uint8_t>::Write w = sourcef.write(); - int r = f->get_buffer(w.ptr(), len); + uint8_t *w = sourcef.ptrw(); + int r = f->get_buffer(w, len); f->close(); memdelete(f); ERR_FAIL_COND_V(r != len, ERR_CANT_OPEN); w[len] = 0; String s; - if (s.parse_utf8((const char *)w.ptr())) { + if (s.parse_utf8((const char *)w)) { ERR_FAIL_V_MSG(ERR_INVALID_DATA, "Script '" + p_path + "' contains invalid unicode (UTF-8), so it was not loaded. Please ensure that scripts are saved in valid UTF-8 unicode."); } @@ -1986,7 +1986,7 @@ bool GDScriptLanguage::handles_global_class_type(const String &p_type) const { String GDScriptLanguage::get_global_class_name(const String &p_path, String *r_base_type, String *r_icon_path) const { - PoolVector<uint8_t> sourcef; + Vector<uint8_t> sourcef; Error err; FileAccessRef f = FileAccess::open(p_path, FileAccess::READ, &err); if (err) { diff --git a/modules/gdscript/gdscript.h b/modules/gdscript/gdscript.h index 3d24f9b3f5..103de3304e 100644 --- a/modules/gdscript/gdscript.h +++ b/modules/gdscript/gdscript.h @@ -487,7 +487,7 @@ public: virtual bool supports_builtin_mode() const; virtual bool can_inherit_from_file() { return true; } virtual int find_function(const String &p_function, const String &p_code) const; - virtual String make_function(const String &p_class, const String &p_name, const PoolStringArray &p_args) const; + virtual String make_function(const String &p_class, const String &p_name, const PackedStringArray &p_args) const; virtual Error complete_code(const String &p_code, const String &p_path, Object *p_owner, List<ScriptCodeCompletionOption> *r_options, bool &r_forced, String &r_call_hint); #ifdef TOOLS_ENABLED virtual Error lookup_code(const String &p_code, const String &p_symbol, const String &p_path, Object *p_owner, LookupResult &r_result); diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index c2c8ff5b99..52527b7da3 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -457,7 +457,7 @@ void GDScriptLanguage::get_public_constants(List<Pair<String, Variant> > *p_cons p_constants->push_back(nan); } -String GDScriptLanguage::make_function(const String &p_class, const String &p_name, const PoolStringArray &p_args) const { +String GDScriptLanguage::make_function(const String &p_class, const String &p_name, const PackedStringArray &p_args) const { #ifdef TOOLS_ENABLED bool th = EditorSettings::get_singleton()->get_setting("text_editor/completion/add_type_hints"); @@ -2173,8 +2173,8 @@ static void _find_identifiers(const GDScriptCompletionContext &p_context, bool p static const char *_type_names[Variant::VARIANT_MAX] = { "null", "bool", "int", "float", "String", "Vector2", "Rect2", "Vector3", "Transform2D", "Plane", "Quat", "AABB", "Basis", "Transform", - "Color", "NodePath", "RID", "Object", "Dictionary", "Array", "PoolByteArray", "PoolIntArray", "PoolRealArray", "PoolStringArray", - "PoolVector2Array", "PoolVector3Array", "PoolColorArray" + "Color", "NodePath", "RID", "Object", "Dictionary", "Array", "PackedByteArray", "PackedIntArray", "PackedRealArray", "PackedStringArray", + "PackedVector2Array", "PackedVector3Array", "PackedColorArray" }; for (int i = 0; i < Variant::VARIANT_MAX; i++) { diff --git a/modules/gdscript/gdscript_functions.cpp b/modules/gdscript/gdscript_functions.cpp index a46337d7dd..bd887fd303 100644 --- a/modules/gdscript/gdscript_functions.cpp +++ b/modules/gdscript/gdscript_functions.cpp @@ -856,7 +856,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ full_objects = *p_args[1]; } - PoolByteArray barr; + PackedByteArray barr; int len; Error err = encode_variant(*p_args[0], NULL, len, full_objects); if (err) { @@ -869,8 +869,8 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ barr.resize(len); { - PoolByteArray::Write w = barr.write(); - encode_variant(*p_args[0], w.ptr(), len, full_objects); + uint8_t *w = barr.ptrw(); + encode_variant(*p_args[0], w, len, full_objects); } r_ret = barr; } break; @@ -896,24 +896,24 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ allow_objects = *p_args[1]; } - if (p_args[0]->get_type() != Variant::POOL_BYTE_ARRAY) { + if (p_args[0]->get_type() != Variant::PACKED_BYTE_ARRAY) { r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 1; - r_error.expected = Variant::POOL_BYTE_ARRAY; + r_error.expected = Variant::PACKED_BYTE_ARRAY; r_ret = Variant(); return; } - PoolByteArray varr = *p_args[0]; + PackedByteArray varr = *p_args[0]; Variant ret; { - PoolByteArray::Read r = varr.read(); - Error err = decode_variant(ret, r.ptr(), varr.size(), NULL, allow_objects); + const uint8_t *r = varr.ptr(); + Error err = decode_variant(ret, r, varr.size(), NULL, allow_objects); if (err != OK) { r_ret = RTR("Not enough bytes for decoding bytes, or invalid format."); r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; - r_error.expected = Variant::POOL_BYTE_ARRAY; + r_error.expected = Variant::PACKED_BYTE_ARRAY; return; } } @@ -1390,39 +1390,39 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ Array d = *p_args[0]; r_ret = d.size(); } break; - case Variant::POOL_BYTE_ARRAY: { + case Variant::PACKED_BYTE_ARRAY: { - PoolVector<uint8_t> d = *p_args[0]; + Vector<uint8_t> d = *p_args[0]; r_ret = d.size(); } break; - case Variant::POOL_INT_ARRAY: { + case Variant::PACKED_INT_ARRAY: { - PoolVector<int> d = *p_args[0]; + Vector<int> d = *p_args[0]; r_ret = d.size(); } break; - case Variant::POOL_REAL_ARRAY: { + case Variant::PACKED_REAL_ARRAY: { - PoolVector<real_t> d = *p_args[0]; + Vector<real_t> d = *p_args[0]; r_ret = d.size(); } break; - case Variant::POOL_STRING_ARRAY: { + case Variant::PACKED_STRING_ARRAY: { - PoolVector<String> d = *p_args[0]; + Vector<String> d = *p_args[0]; r_ret = d.size(); } break; - case Variant::POOL_VECTOR2_ARRAY: { + case Variant::PACKED_VECTOR2_ARRAY: { - PoolVector<Vector2> d = *p_args[0]; + Vector<Vector2> d = *p_args[0]; r_ret = d.size(); } break; - case Variant::POOL_VECTOR3_ARRAY: { + case Variant::PACKED_VECTOR3_ARRAY: { - PoolVector<Vector3> d = *p_args[0]; + Vector<Vector3> d = *p_args[0]; r_ret = d.size(); } break; - case Variant::POOL_COLOR_ARRAY: { + case Variant::PACKED_COLOR_ARRAY: { - PoolVector<Color> d = *p_args[0]; + Vector<Color> d = *p_args[0]; r_ret = d.size(); } break; default: { @@ -1941,12 +1941,12 @@ MethodInfo GDScriptFunctions::get_info(Function p_func) { MethodInfo mi("var2bytes", PropertyInfo(Variant::NIL, "var", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_NIL_IS_VARIANT), PropertyInfo(Variant::BOOL, "full_objects")); mi.default_arguments.push_back(false); - mi.return_val.type = Variant::POOL_BYTE_ARRAY; + mi.return_val.type = Variant::PACKED_BYTE_ARRAY; return mi; } break; case BYTES_TO_VAR: { - MethodInfo mi(Variant::NIL, "bytes2var", PropertyInfo(Variant::POOL_BYTE_ARRAY, "bytes"), PropertyInfo(Variant::BOOL, "allow_objects")); + MethodInfo mi(Variant::NIL, "bytes2var", PropertyInfo(Variant::PACKED_BYTE_ARRAY, "bytes"), PropertyInfo(Variant::BOOL, "allow_objects")); mi.default_arguments.push_back(false); mi.return_val.type = Variant::NIL; mi.return_val.usage |= PROPERTY_USAGE_NIL_IS_VARIANT; diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index fae6fbbb0c..33c6a55bfb 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -6596,13 +6596,13 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) { if (!error) { switch (base_type.builtin_type) { // Expect int or real as index - case Variant::POOL_BYTE_ARRAY: - case Variant::POOL_COLOR_ARRAY: - case Variant::POOL_INT_ARRAY: - case Variant::POOL_REAL_ARRAY: - case Variant::POOL_STRING_ARRAY: - case Variant::POOL_VECTOR2_ARRAY: - case Variant::POOL_VECTOR3_ARRAY: + case Variant::PACKED_BYTE_ARRAY: + case Variant::PACKED_COLOR_ARRAY: + case Variant::PACKED_INT_ARRAY: + case Variant::PACKED_REAL_ARRAY: + case Variant::PACKED_STRING_ARRAY: + case Variant::PACKED_VECTOR2_ARRAY: + case Variant::PACKED_VECTOR3_ARRAY: case Variant::ARRAY: case Variant::STRING: { error = index_type.builtin_type != Variant::INT && index_type.builtin_type != Variant::REAL; @@ -6646,13 +6646,13 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) { case Variant::STRING: case Variant::ARRAY: case Variant::DICTIONARY: - case Variant::POOL_BYTE_ARRAY: - case Variant::POOL_COLOR_ARRAY: - case Variant::POOL_INT_ARRAY: - case Variant::POOL_REAL_ARRAY: - case Variant::POOL_STRING_ARRAY: - case Variant::POOL_VECTOR2_ARRAY: - case Variant::POOL_VECTOR3_ARRAY: { + case Variant::PACKED_BYTE_ARRAY: + case Variant::PACKED_COLOR_ARRAY: + case Variant::PACKED_INT_ARRAY: + case Variant::PACKED_REAL_ARRAY: + case Variant::PACKED_STRING_ARRAY: + case Variant::PACKED_VECTOR2_ARRAY: + case Variant::PACKED_VECTOR3_ARRAY: { break; } default: { @@ -6698,34 +6698,34 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) { return DataType(); } break; // Return int - case Variant::POOL_BYTE_ARRAY: - case Variant::POOL_INT_ARRAY: { + case Variant::PACKED_BYTE_ARRAY: + case Variant::PACKED_INT_ARRAY: { result.builtin_type = Variant::INT; } break; // Return real - case Variant::POOL_REAL_ARRAY: + case Variant::PACKED_REAL_ARRAY: case Variant::VECTOR2: case Variant::VECTOR3: case Variant::QUAT: { result.builtin_type = Variant::REAL; } break; // Return color - case Variant::POOL_COLOR_ARRAY: { + case Variant::PACKED_COLOR_ARRAY: { result.builtin_type = Variant::COLOR; } break; // Return string - case Variant::POOL_STRING_ARRAY: + case Variant::PACKED_STRING_ARRAY: case Variant::STRING: { result.builtin_type = Variant::STRING; } break; // Return Vector2 - case Variant::POOL_VECTOR2_ARRAY: + case Variant::PACKED_VECTOR2_ARRAY: case Variant::TRANSFORM2D: case Variant::RECT2: { result.builtin_type = Variant::VECTOR2; } break; // Return Vector3 - case Variant::POOL_VECTOR3_ARRAY: + case Variant::PACKED_VECTOR3_ARRAY: case Variant::AABB: case Variant::BASIS: { result.builtin_type = Variant::VECTOR3; diff --git a/modules/gdscript/gdscript_tokenizer.cpp b/modules/gdscript/gdscript_tokenizer.cpp index a0e0811c1f..b30f81959e 100644 --- a/modules/gdscript/gdscript_tokenizer.cpp +++ b/modules/gdscript/gdscript_tokenizer.cpp @@ -163,13 +163,13 @@ static const _bit _type_list[] = { { Variant::NODE_PATH, "NodePath" }, { Variant::DICTIONARY, "Dictionary" }, { Variant::ARRAY, "Array" }, - { Variant::POOL_BYTE_ARRAY, "PoolByteArray" }, - { Variant::POOL_INT_ARRAY, "PoolIntArray" }, - { Variant::POOL_REAL_ARRAY, "PoolRealArray" }, - { Variant::POOL_STRING_ARRAY, "PoolStringArray" }, - { Variant::POOL_VECTOR2_ARRAY, "PoolVector2Array" }, - { Variant::POOL_VECTOR3_ARRAY, "PoolVector3Array" }, - { Variant::POOL_COLOR_ARRAY, "PoolColorArray" }, + { Variant::PACKED_BYTE_ARRAY, "PackedByteArray" }, + { Variant::PACKED_INT_ARRAY, "PackedIntArray" }, + { Variant::PACKED_REAL_ARRAY, "PackedRealArray" }, + { Variant::PACKED_STRING_ARRAY, "PackedStringArray" }, + { Variant::PACKED_VECTOR2_ARRAY, "PackedVector2Array" }, + { Variant::PACKED_VECTOR3_ARRAY, "PackedVector3Array" }, + { Variant::PACKED_COLOR_ARRAY, "PackedColorArray" }, { Variant::VARIANT_MAX, NULL }, }; diff --git a/modules/gdscript/language_server/gdscript_language_protocol.cpp b/modules/gdscript/language_server/gdscript_language_protocol.cpp index 7133c6b4be..b2da5dfdbc 100644 --- a/modules/gdscript/language_server/gdscript_language_protocol.cpp +++ b/modules/gdscript/language_server/gdscript_language_protocol.cpp @@ -39,10 +39,10 @@ GDScriptLanguageProtocol *GDScriptLanguageProtocol::singleton = NULL; void GDScriptLanguageProtocol::on_data_received(int p_id) { lastest_client_id = p_id; Ref<WebSocketPeer> peer = server->get_peer(p_id); - PoolByteArray data; + PackedByteArray data; if (OK == peer->get_packet_buffer(data)) { String message; - message.parse_utf8((const char *)data.read().ptr(), data.size()); + message.parse_utf8((const char *)data.ptr(), data.size()); if (message.begins_with("Content-Length:")) return; String output = process_message(message); if (!output.empty()) { diff --git a/modules/glslang/register_types.cpp b/modules/glslang/register_types.cpp index 1e4481a6a0..d2b4a18fc7 100644 --- a/modules/glslang/register_types.cpp +++ b/modules/glslang/register_types.cpp @@ -142,9 +142,9 @@ static const TBuiltInResource default_builtin_resource = { } }; -static PoolVector<uint8_t> _compile_shader_glsl(RenderingDevice::ShaderStage p_stage, const String &p_source_code, RenderingDevice::ShaderLanguage p_language, String *r_error) { +static Vector<uint8_t> _compile_shader_glsl(RenderingDevice::ShaderStage p_stage, const String &p_source_code, RenderingDevice::ShaderLanguage p_language, String *r_error) { - PoolVector<uint8_t> ret; + Vector<uint8_t> ret; ERR_FAIL_COND_V(p_language == RenderingDevice::SHADER_LANGUAGE_HLSL, ret); @@ -224,8 +224,8 @@ static PoolVector<uint8_t> _compile_shader_glsl(RenderingDevice::ShaderStage p_s ret.resize(SpirV.size() * sizeof(uint32_t)); { - PoolVector<uint8_t>::Write w = ret.write(); - copymem(w.ptr(), &SpirV[0], SpirV.size() * sizeof(uint32_t)); + uint8_t *w = ret.ptrw(); + copymem(w, &SpirV[0], SpirV.size() * sizeof(uint32_t)); } return ret; diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp index 7fe58f8ce7..ba0449c046 100644 --- a/modules/gridmap/grid_map.cpp +++ b/modules/gridmap/grid_map.cpp @@ -49,9 +49,9 @@ bool GridMap::_set(const StringName &p_name, const Variant &p_value) { if (d.has("cells")) { - PoolVector<int> cells = d["cells"]; + Vector<int> cells = d["cells"]; int amount = cells.size(); - PoolVector<int>::Read r = cells.read(); + const int *r = cells.ptr(); ERR_FAIL_COND_V(amount % 3, false); // not even cell_map.clear(); for (int i = 0; i < amount / 3; i++) { @@ -103,10 +103,10 @@ bool GridMap::_get(const StringName &p_name, Variant &r_ret) const { Dictionary d; - PoolVector<int> cells; + Vector<int> cells; cells.resize(cell_map.size() * 3); { - PoolVector<int>::Write w = cells.write(); + int *w = cells.ptrw(); int i = 0; for (Map<IndexKey, Cell>::Element *E = cell_map.front(); E; E = E->next(), i++) { @@ -439,7 +439,7 @@ bool GridMap::_octant_update(const OctantKey &p_key) { return true; } - PoolVector<Vector3> col_debug; + Vector<Vector3> col_debug; /* * foreach item in this octant, diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp index 2144ff264f..43f5feb388 100644 --- a/modules/gridmap/grid_map_editor_plugin.cpp +++ b/modules/gridmap/grid_map_editor_plugin.cpp @@ -1370,9 +1370,9 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { { // Selection mesh create. - PoolVector<Vector3> lines; - PoolVector<Vector3> triangles; - PoolVector<Vector3> square[3]; + Vector<Vector3> lines; + Vector<Vector3> triangles; + Vector<Vector3> square[3]; for (int i = 0; i < 6; i++) { diff --git a/modules/hdr/image_loader_hdr.cpp b/modules/hdr/image_loader_hdr.cpp index 3fa7266f1a..c03ae4ab1f 100644 --- a/modules/hdr/image_loader_hdr.cpp +++ b/modules/hdr/image_loader_hdr.cpp @@ -63,15 +63,15 @@ Error ImageLoaderHDR::load_image(Ref<Image> p_image, FileAccess *f, bool p_force int width = f->get_line().to_int(); - PoolVector<uint8_t> imgdata; + Vector<uint8_t> imgdata; imgdata.resize(height * width * sizeof(uint32_t)); { - PoolVector<uint8_t>::Write w = imgdata.write(); + uint8_t *w = imgdata.ptrw(); - uint8_t *ptr = (uint8_t *)w.ptr(); + uint8_t *ptr = (uint8_t *)w; if (width < 8 || width >= 32768) { // Read flat data diff --git a/modules/jpg/image_loader_jpegd.cpp b/modules/jpg/image_loader_jpegd.cpp index a1f0f0ef6a..9e87d11ac1 100644 --- a/modules/jpg/image_loader_jpegd.cpp +++ b/modules/jpg/image_loader_jpegd.cpp @@ -57,13 +57,13 @@ Error jpeg_load_image_from_buffer(Image *p_image, const uint8_t *p_buffer, int p const int dst_bpl = image_width * comps; - PoolVector<uint8_t> data; + Vector<uint8_t> data; data.resize(dst_bpl * image_height); - PoolVector<uint8_t>::Write dw = data.write(); + uint8_t *dw = data.ptrw(); - jpgd::uint8 *pImage_data = (jpgd::uint8 *)dw.ptr(); + jpgd::uint8 *pImage_data = (jpgd::uint8 *)dw; for (int y = 0; y < image_height; y++) { const jpgd::uint8 *pScan_line; @@ -96,7 +96,6 @@ Error jpeg_load_image_from_buffer(Image *p_image, const uint8_t *p_buffer, int p else fmt = Image::FORMAT_RGB8; - dw.release(); p_image->create(image_width, image_height, 0, fmt, data); return OK; @@ -104,18 +103,18 @@ Error jpeg_load_image_from_buffer(Image *p_image, const uint8_t *p_buffer, int p Error ImageLoaderJPG::load_image(Ref<Image> p_image, FileAccess *f, bool p_force_linear, float p_scale) { - PoolVector<uint8_t> src_image; + Vector<uint8_t> src_image; int src_image_len = f->get_len(); ERR_FAIL_COND_V(src_image_len == 0, ERR_FILE_CORRUPT); src_image.resize(src_image_len); - PoolVector<uint8_t>::Write w = src_image.write(); + uint8_t *w = src_image.ptrw(); f->get_buffer(&w[0], src_image_len); f->close(); - Error err = jpeg_load_image_from_buffer(p_image.ptr(), w.ptr(), src_image_len); + Error err = jpeg_load_image_from_buffer(p_image.ptr(), w, src_image_len); return err; } diff --git a/modules/mbedtls/crypto_mbedtls.cpp b/modules/mbedtls/crypto_mbedtls.cpp index 2bd80064e3..ee3c78aeb3 100644 --- a/modules/mbedtls/crypto_mbedtls.cpp +++ b/modules/mbedtls/crypto_mbedtls.cpp @@ -53,22 +53,22 @@ CryptoKey *CryptoKeyMbedTLS::create() { Error CryptoKeyMbedTLS::load(String p_path) { ERR_FAIL_COND_V_MSG(locks, ERR_ALREADY_IN_USE, "Key is in use"); - PoolByteArray out; + PackedByteArray out; FileAccess *f = FileAccess::open(p_path, FileAccess::READ); ERR_FAIL_COND_V_MSG(!f, ERR_INVALID_PARAMETER, "Cannot open CryptoKeyMbedTLS file '" + p_path + "'."); int flen = f->get_len(); out.resize(flen + 1); { - PoolByteArray::Write w = out.write(); - f->get_buffer(w.ptr(), flen); + uint8_t *w = out.ptrw(); + f->get_buffer(w, flen); w[flen] = 0; //end f string } memdelete(f); - int ret = mbedtls_pk_parse_key(&pkey, out.read().ptr(), out.size(), NULL, 0); + int ret = mbedtls_pk_parse_key(&pkey, out.ptr(), out.size(), NULL, 0); // We MUST zeroize the memory for safety! - mbedtls_platform_zeroize(out.write().ptr(), out.size()); + mbedtls_platform_zeroize(out.ptrw(), out.size()); ERR_FAIL_COND_V_MSG(ret, FAILED, "Error parsing private key '" + itos(ret) + "'."); return OK; @@ -102,20 +102,20 @@ X509Certificate *X509CertificateMbedTLS::create() { Error X509CertificateMbedTLS::load(String p_path) { ERR_FAIL_COND_V_MSG(locks, ERR_ALREADY_IN_USE, "Certificate is in use"); - PoolByteArray out; + PackedByteArray out; FileAccess *f = FileAccess::open(p_path, FileAccess::READ); ERR_FAIL_COND_V_MSG(!f, ERR_INVALID_PARAMETER, "Cannot open X509CertificateMbedTLS file '" + p_path + "'."); int flen = f->get_len(); out.resize(flen + 1); { - PoolByteArray::Write w = out.write(); - f->get_buffer(w.ptr(), flen); + uint8_t *w = out.ptrw(); + f->get_buffer(w, flen); w[flen] = 0; //end f string } memdelete(f); - int ret = mbedtls_x509_crt_parse(&cert, out.read().ptr(), out.size()); + int ret = mbedtls_x509_crt_parse(&cert, out.ptr(), out.size()); ERR_FAIL_COND_V_MSG(ret, FAILED, "Error parsing some certificates: " + itos(ret)); return OK; @@ -210,15 +210,15 @@ void CryptoMbedTLS::load_default_certificates(String p_path) { #ifdef BUILTIN_CERTS_ENABLED else { // Use builtin certs only if user did not override it in project settings. - PoolByteArray out; + PackedByteArray out; out.resize(_certs_uncompressed_size + 1); - PoolByteArray::Write w = out.write(); - Compression::decompress(w.ptr(), _certs_uncompressed_size, _certs_compressed, _certs_compressed_size, Compression::MODE_DEFLATE); + uint8_t *w = out.ptrw(); + Compression::decompress(w, _certs_uncompressed_size, _certs_compressed, _certs_compressed_size, Compression::MODE_DEFLATE); w[_certs_uncompressed_size] = 0; // Make sure it ends with string terminator #ifdef DEBUG_ENABLED print_verbose("Loaded builtin certs"); #endif - default_certs->load_from_memory(out.read().ptr(), out.size()); + default_certs->load_from_memory(out.ptr(), out.size()); } #endif } @@ -276,9 +276,9 @@ Ref<X509Certificate> CryptoMbedTLS::generate_self_signed_certificate(Ref<CryptoK return out; } -PoolByteArray CryptoMbedTLS::generate_random_bytes(int p_bytes) { - PoolByteArray out; +PackedByteArray CryptoMbedTLS::generate_random_bytes(int p_bytes) { + PackedByteArray out; out.resize(p_bytes); - mbedtls_ctr_drbg_random(&ctr_drbg, out.write().ptr(), p_bytes); + mbedtls_ctr_drbg_random(&ctr_drbg, out.ptrw(), p_bytes); return out; } diff --git a/modules/mbedtls/crypto_mbedtls.h b/modules/mbedtls/crypto_mbedtls.h index edb5841761..6c1c0e255d 100644 --- a/modules/mbedtls/crypto_mbedtls.h +++ b/modules/mbedtls/crypto_mbedtls.h @@ -113,7 +113,7 @@ public: static X509CertificateMbedTLS *get_default_certificates(); static void load_default_certificates(String p_path); - virtual PoolByteArray generate_random_bytes(int p_bytes); + virtual PackedByteArray generate_random_bytes(int p_bytes); virtual Ref<CryptoKey> generate_rsa(int p_bytes); virtual Ref<X509Certificate> generate_self_signed_certificate(Ref<CryptoKey> p_key, String p_issuer_name, String p_not_before, String p_not_after); diff --git a/modules/mbedtls/ssl_context_mbedtls.h b/modules/mbedtls/ssl_context_mbedtls.h index 9145e0fd72..01b8b3fd4d 100644 --- a/modules/mbedtls/ssl_context_mbedtls.h +++ b/modules/mbedtls/ssl_context_mbedtls.h @@ -34,7 +34,7 @@ #include "crypto_mbedtls.h" #include "core/os/file_access.h" -#include "core/pool_vector.h" + #include "core/reference.h" #include <mbedtls/config.h> @@ -48,7 +48,7 @@ class SSLContextMbedTLS : public Reference { protected: bool inited; - static PoolByteArray _read_file(String p_path); + static PackedByteArray _read_file(String p_path); public: Ref<X509CertificateMbedTLS> certs; diff --git a/modules/mono/build_scripts/make_android_mono_config.py b/modules/mono/build_scripts/make_android_mono_config.py index 8cad204d7b..0afd939c57 100644 --- a/modules/mono/build_scripts/make_android_mono_config.py +++ b/modules/mono/build_scripts/make_android_mono_config.py @@ -24,7 +24,7 @@ def generate_compressed_config(config_src, output_dir): #ifdef ANDROID_ENABLED #include "core/io/compression.h" -#include "core/pool_vector.h" + namespace { @@ -36,9 +36,9 @@ static const unsigned char config_compressed_data[] = { %s }; } // namespace String get_godot_android_mono_config() { - PoolVector<uint8_t> data; + Vector<uint8_t> data; data.resize(config_uncompressed_size); - PoolVector<uint8_t>::Write w = data.write(); + uint8_t* w = data.ptrw(); Compression::decompress(w.ptr(), config_uncompressed_size, config_compressed_data, config_compressed_size, Compression::MODE_DEFLATE); String s; diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index c722076fe2..15415d7655 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -428,24 +428,24 @@ static String variant_type_to_managed_name(const String &p_var_type_name) { if (p_var_type_name == Variant::get_type_name(Variant::ARRAY)) return "Collections.Array"; - if (p_var_type_name == Variant::get_type_name(Variant::POOL_BYTE_ARRAY)) + if (p_var_type_name == Variant::get_type_name(Variant::PACKED_BYTE_ARRAY)) return "byte[]"; - if (p_var_type_name == Variant::get_type_name(Variant::POOL_INT_ARRAY)) + if (p_var_type_name == Variant::get_type_name(Variant::PACKED_INT_ARRAY)) return "int[]"; - if (p_var_type_name == Variant::get_type_name(Variant::POOL_REAL_ARRAY)) { + if (p_var_type_name == Variant::get_type_name(Variant::PACKED_REAL_ARRAY)) { #ifdef REAL_T_IS_DOUBLE return "double[]"; #else return "float[]"; #endif } - if (p_var_type_name == Variant::get_type_name(Variant::POOL_STRING_ARRAY)) + if (p_var_type_name == Variant::get_type_name(Variant::PACKED_STRING_ARRAY)) return "string[]"; - if (p_var_type_name == Variant::get_type_name(Variant::POOL_VECTOR2_ARRAY)) + if (p_var_type_name == Variant::get_type_name(Variant::PACKED_VECTOR2_ARRAY)) return "Vector2[]"; - if (p_var_type_name == Variant::get_type_name(Variant::POOL_VECTOR3_ARRAY)) + if (p_var_type_name == Variant::get_type_name(Variant::PACKED_VECTOR3_ARRAY)) return "Vector3[]"; - if (p_var_type_name == Variant::get_type_name(Variant::POOL_COLOR_ARRAY)) + if (p_var_type_name == Variant::get_type_name(Variant::PACKED_COLOR_ARRAY)) return "Color[]"; Variant::Type var_types[] = { @@ -473,7 +473,7 @@ static String variant_type_to_managed_name(const String &p_var_type_name) { return "object"; } -String CSharpLanguage::make_function(const String &, const String &p_name, const PoolStringArray &p_args) const { +String CSharpLanguage::make_function(const String &, const String &p_name, const PackedStringArray &p_args) const { // FIXME // - Due to Godot's API limitation this just appends the function to the end of the file // - Use fully qualified name if there is ambiguity @@ -491,7 +491,7 @@ String CSharpLanguage::make_function(const String &, const String &p_name, const return s; } #else -String CSharpLanguage::make_function(const String &, const String &, const PoolStringArray &) const { +String CSharpLanguage::make_function(const String &, const String &, const PackedStringArray &) const { return String(); } #endif diff --git a/modules/mono/csharp_script.h b/modules/mono/csharp_script.h index 32a5b30c18..8ee741b4d2 100644 --- a/modules/mono/csharp_script.h +++ b/modules/mono/csharp_script.h @@ -432,7 +432,7 @@ public: virtual bool has_named_classes() const; virtual bool supports_builtin_mode() const; /* TODO? */ virtual int find_function(const String &p_function, const String &p_code) const { return -1; } - virtual String make_function(const String &p_class, const String &p_name, const PoolStringArray &p_args) const; + virtual String make_function(const String &p_class, const String &p_name, const PackedStringArray &p_args) const; virtual String _get_indentation() const; /* TODO? */ virtual void auto_indent_code(String &p_code, int p_from_line, int p_to_line) const {} /* TODO */ virtual void add_global_constant(const StringName &p_variable, const Variant &p_value) {} diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp index 34f01ce3c6..0724d72ce6 100644 --- a/modules/mono/editor/bindings_generator.cpp +++ b/modules/mono/editor/bindings_generator.cpp @@ -503,23 +503,23 @@ String BindingsGenerator::bbcode_to_xml(const String &p_bbcode, const TypeInterf xml_output.append("<c>"); xml_output.append(tag); xml_output.append("</c>"); - } else if (tag == "PoolByteArray") { + } else if (tag == "PackedByteArray") { xml_output.append("<see cref=\"byte\"/>"); - } else if (tag == "PoolIntArray") { + } else if (tag == "PackedIntArray") { xml_output.append("<see cref=\"int\"/>"); - } else if (tag == "PoolRealArray") { + } else if (tag == "PackedRealArray") { #ifdef REAL_T_IS_DOUBLE xml_output.append("<see cref=\"double\"/>"); #else xml_output.append("<see cref=\"float\"/>"); #endif - } else if (tag == "PoolStringArray") { + } else if (tag == "PackedStringArray") { xml_output.append("<see cref=\"string\"/>"); - } else if (tag == "PoolVector2Array") { + } else if (tag == "PackedVector2Array") { xml_output.append("<see cref=\"" BINDINGS_NAMESPACE ".Vector2\"/>"); - } else if (tag == "PoolVector3Array") { + } else if (tag == "PackedVector3Array") { xml_output.append("<see cref=\"" BINDINGS_NAMESPACE ".Vector3\"/>"); - } else if (tag == "PoolColorArray") { + } else if (tag == "PackedColorArray") { xml_output.append("<see cref=\"" BINDINGS_NAMESPACE ".Color\"/>"); } else { const TypeInterface *target_itype = _get_type_or_null(TypeReference(tag)); @@ -2628,13 +2628,13 @@ bool BindingsGenerator::_arg_default_value_from_variant(const Variant &p_val, Ar r_iarg.default_argument = "null"; break; case Variant::ARRAY: - case Variant::POOL_BYTE_ARRAY: - case Variant::POOL_INT_ARRAY: - case Variant::POOL_REAL_ARRAY: - case Variant::POOL_STRING_ARRAY: - case Variant::POOL_VECTOR2_ARRAY: - case Variant::POOL_VECTOR3_ARRAY: - case Variant::POOL_COLOR_ARRAY: + case Variant::PACKED_BYTE_ARRAY: + case Variant::PACKED_INT_ARRAY: + case Variant::PACKED_REAL_ARRAY: + case Variant::PACKED_STRING_ARRAY: + case Variant::PACKED_VECTOR2_ARRAY: + case Variant::PACKED_VECTOR3_ARRAY: + case Variant::PACKED_COLOR_ARRAY: r_iarg.default_argument = "new %s {}"; r_iarg.def_param_mode = ArgumentInterface::NULLABLE_REF; break; @@ -2914,20 +2914,20 @@ void BindingsGenerator::_populate_builtin_type_interfaces() { #define INSERT_ARRAY(m_type, m_proxy_t) INSERT_ARRAY_FULL(m_type, m_type, m_proxy_t) - INSERT_ARRAY(PoolIntArray, int); - INSERT_ARRAY_FULL(PoolByteArray, PoolByteArray, byte); + INSERT_ARRAY(PackedIntArray, int); + INSERT_ARRAY_FULL(PackedByteArray, PackedByteArray, byte); #ifdef REAL_T_IS_DOUBLE - INSERT_ARRAY(PoolRealArray, double); + INSERT_ARRAY(PackedRealArray, double); #else - INSERT_ARRAY(PoolRealArray, float); + INSERT_ARRAY(PackedRealArray, float); #endif - INSERT_ARRAY(PoolStringArray, string); + INSERT_ARRAY(PackedStringArray, string); - INSERT_ARRAY(PoolColorArray, Color); - INSERT_ARRAY(PoolVector2Array, Vector2); - INSERT_ARRAY(PoolVector3Array, Vector3); + INSERT_ARRAY(PackedColorArray, Color); + INSERT_ARRAY(PackedVector2Array, Vector2); + INSERT_ARRAY(PackedVector3Array, Vector3); #undef INSERT_ARRAY diff --git a/modules/mono/glue/gd_glue.cpp b/modules/mono/glue/gd_glue.cpp index 17483c4457..ce81ea391d 100644 --- a/modules/mono/glue/gd_glue.cpp +++ b/modules/mono/glue/gd_glue.cpp @@ -44,8 +44,8 @@ MonoObject *godot_icall_GD_bytes2var(MonoArray *p_bytes, MonoBoolean p_allow_objects) { Variant ret; - PoolByteArray varr = GDMonoMarshal::mono_array_to_PoolByteArray(p_bytes); - PoolByteArray::Read r = varr.read(); + PackedByteArray varr = GDMonoMarshal::mono_array_to_PackedByteArray(p_bytes); + const uint8_t *r = varr.ptr(); Error err = decode_variant(ret, r.ptr(), varr.size(), NULL, p_allow_objects); if (err != OK) { ret = RTR("Not enough bytes for decoding bytes, or invalid format."); @@ -257,18 +257,18 @@ void godot_icall_GD_pushwarning(MonoString *p_str) { MonoArray *godot_icall_GD_var2bytes(MonoObject *p_var, MonoBoolean p_full_objects) { Variant var = GDMonoMarshal::mono_object_to_variant(p_var); - PoolByteArray barr; + PackedByteArray barr; int len; Error err = encode_variant(var, NULL, len, p_full_objects); ERR_FAIL_COND_V_MSG(err != OK, NULL, "Unexpected error encoding variable to bytes, likely unserializable type found (Object or RID)."); barr.resize(len); { - PoolByteArray::Write w = barr.write(); + uint8_t *w = barr.ptrw(); encode_variant(var, w.ptr(), len, p_full_objects); } - return GDMonoMarshal::PoolByteArray_to_mono_array(barr); + return GDMonoMarshal::PackedByteArray_to_mono_array(barr); } MonoString *godot_icall_GD_var2str(MonoObject *p_var) { diff --git a/modules/mono/mono_gd/gd_mono_field.cpp b/modules/mono/mono_gd/gd_mono_field.cpp index 178647b968..21d78483ee 100644 --- a/modules/mono/mono_gd/gd_mono_field.cpp +++ b/modules/mono/mono_gd/gd_mono_field.cpp @@ -247,37 +247,37 @@ void GDMonoField::set_value_from_variant(MonoObject *p_object, const Variant &p_ } if (array_type->eklass == CACHED_CLASS_RAW(uint8_t)) { - SET_FROM_ARRAY(PoolByteArray); + SET_FROM_ARRAY(PackedByteArray); break; } if (array_type->eklass == CACHED_CLASS_RAW(int32_t)) { - SET_FROM_ARRAY(PoolIntArray); + SET_FROM_ARRAY(PackedIntArray); break; } if (array_type->eklass == REAL_T_MONOCLASS) { - SET_FROM_ARRAY(PoolRealArray); + SET_FROM_ARRAY(PackedRealArray); break; } if (array_type->eklass == CACHED_CLASS_RAW(String)) { - SET_FROM_ARRAY(PoolStringArray); + SET_FROM_ARRAY(PackedStringArray); break; } if (array_type->eklass == CACHED_CLASS_RAW(Vector2)) { - SET_FROM_ARRAY(PoolVector2Array); + SET_FROM_ARRAY(PackedVector2Array); break; } if (array_type->eklass == CACHED_CLASS_RAW(Vector3)) { - SET_FROM_ARRAY(PoolVector3Array); + SET_FROM_ARRAY(PackedVector3Array); break; } if (array_type->eklass == CACHED_CLASS_RAW(Color)) { - SET_FROM_ARRAY(PoolColorArray); + SET_FROM_ARRAY(PackedColorArray); break; } @@ -434,26 +434,26 @@ void GDMonoField::set_value_from_variant(MonoObject *p_object, const Variant &p_ MonoObject *managed = GDMonoUtils::create_managed_from(p_value.operator Array(), CACHED_CLASS(Array)); mono_field_set_value(p_object, mono_field, managed); } break; - case Variant::POOL_BYTE_ARRAY: { - SET_FROM_ARRAY(PoolByteArray); + case Variant::PACKED_BYTE_ARRAY: { + SET_FROM_ARRAY(PackedByteArray); } break; - case Variant::POOL_INT_ARRAY: { - SET_FROM_ARRAY(PoolIntArray); + case Variant::PACKED_INT_ARRAY: { + SET_FROM_ARRAY(PackedIntArray); } break; - case Variant::POOL_REAL_ARRAY: { - SET_FROM_ARRAY(PoolRealArray); + case Variant::PACKED_REAL_ARRAY: { + SET_FROM_ARRAY(PackedRealArray); } break; - case Variant::POOL_STRING_ARRAY: { - SET_FROM_ARRAY(PoolStringArray); + case Variant::PACKED_STRING_ARRAY: { + SET_FROM_ARRAY(PackedStringArray); } break; - case Variant::POOL_VECTOR2_ARRAY: { - SET_FROM_ARRAY(PoolVector2Array); + case Variant::PACKED_VECTOR2_ARRAY: { + SET_FROM_ARRAY(PackedVector2Array); } break; - case Variant::POOL_VECTOR3_ARRAY: { - SET_FROM_ARRAY(PoolVector3Array); + case Variant::PACKED_VECTOR3_ARRAY: { + SET_FROM_ARRAY(PackedVector3Array); } break; - case Variant::POOL_COLOR_ARRAY: { - SET_FROM_ARRAY(PoolColorArray); + case Variant::PACKED_COLOR_ARRAY: { + SET_FROM_ARRAY(PackedColorArray); } break; default: break; } diff --git a/modules/mono/mono_gd/gd_mono_marshal.cpp b/modules/mono/mono_gd/gd_mono_marshal.cpp index 19d627218e..63890f6066 100644 --- a/modules/mono/mono_gd/gd_mono_marshal.cpp +++ b/modules/mono/mono_gd/gd_mono_marshal.cpp @@ -113,25 +113,25 @@ Variant::Type managed_to_variant_type(const ManagedType &p_type) { return Variant::ARRAY; if (array_type->eklass == CACHED_CLASS_RAW(uint8_t)) - return Variant::POOL_BYTE_ARRAY; + return Variant::PACKED_BYTE_ARRAY; if (array_type->eklass == CACHED_CLASS_RAW(int32_t)) - return Variant::POOL_INT_ARRAY; + return Variant::PACKED_INT_ARRAY; if (array_type->eklass == REAL_T_MONOCLASS) - return Variant::POOL_REAL_ARRAY; + return Variant::PACKED_REAL_ARRAY; if (array_type->eklass == CACHED_CLASS_RAW(String)) - return Variant::POOL_STRING_ARRAY; + return Variant::PACKED_STRING_ARRAY; if (array_type->eklass == CACHED_CLASS_RAW(Vector2)) - return Variant::POOL_VECTOR2_ARRAY; + return Variant::PACKED_VECTOR2_ARRAY; if (array_type->eklass == CACHED_CLASS_RAW(Vector3)) - return Variant::POOL_VECTOR3_ARRAY; + return Variant::PACKED_VECTOR3_ARRAY; if (array_type->eklass == CACHED_CLASS_RAW(Color)) - return Variant::POOL_COLOR_ARRAY; + return Variant::PACKED_COLOR_ARRAY; } break; case MONO_TYPE_CLASS: { @@ -491,25 +491,25 @@ MonoObject *variant_to_mono_object(const Variant *p_var, const ManagedType &p_ty return (MonoObject *)Array_to_mono_array(p_var->operator Array()); if (array_type->eklass == CACHED_CLASS_RAW(uint8_t)) - return (MonoObject *)PoolByteArray_to_mono_array(p_var->operator PoolByteArray()); + return (MonoObject *)PackedByteArray_to_mono_array(p_var->operator PackedByteArray()); if (array_type->eklass == CACHED_CLASS_RAW(int32_t)) - return (MonoObject *)PoolIntArray_to_mono_array(p_var->operator PoolIntArray()); + return (MonoObject *)PackedIntArray_to_mono_array(p_var->operator PackedIntArray()); if (array_type->eklass == REAL_T_MONOCLASS) - return (MonoObject *)PoolRealArray_to_mono_array(p_var->operator PoolRealArray()); + return (MonoObject *)PackedRealArray_to_mono_array(p_var->operator PackedRealArray()); if (array_type->eklass == CACHED_CLASS_RAW(String)) - return (MonoObject *)PoolStringArray_to_mono_array(p_var->operator PoolStringArray()); + return (MonoObject *)PackedStringArray_to_mono_array(p_var->operator PackedStringArray()); if (array_type->eklass == CACHED_CLASS_RAW(Vector2)) - return (MonoObject *)PoolVector2Array_to_mono_array(p_var->operator PoolVector2Array()); + return (MonoObject *)PackedVector2Array_to_mono_array(p_var->operator PackedVector2Array()); if (array_type->eklass == CACHED_CLASS_RAW(Vector3)) - return (MonoObject *)PoolVector3Array_to_mono_array(p_var->operator PoolVector3Array()); + return (MonoObject *)PackedVector3Array_to_mono_array(p_var->operator PackedVector3Array()); if (array_type->eklass == CACHED_CLASS_RAW(Color)) - return (MonoObject *)PoolColorArray_to_mono_array(p_var->operator PoolColorArray()); + return (MonoObject *)PackedColorArray_to_mono_array(p_var->operator PackedColorArray()); ERR_FAIL_V_MSG(NULL, "Attempted to convert Variant to a managed array of unmarshallable element type."); } break; @@ -638,20 +638,20 @@ MonoObject *variant_to_mono_object(const Variant *p_var, const ManagedType &p_ty return GDMonoUtils::create_managed_from(p_var->operator Dictionary(), CACHED_CLASS(Dictionary)); case Variant::ARRAY: return GDMonoUtils::create_managed_from(p_var->operator Array(), CACHED_CLASS(Array)); - case Variant::POOL_BYTE_ARRAY: - return (MonoObject *)PoolByteArray_to_mono_array(p_var->operator PoolByteArray()); - case Variant::POOL_INT_ARRAY: - return (MonoObject *)PoolIntArray_to_mono_array(p_var->operator PoolIntArray()); - case Variant::POOL_REAL_ARRAY: - return (MonoObject *)PoolRealArray_to_mono_array(p_var->operator PoolRealArray()); - case Variant::POOL_STRING_ARRAY: - return (MonoObject *)PoolStringArray_to_mono_array(p_var->operator PoolStringArray()); - case Variant::POOL_VECTOR2_ARRAY: - return (MonoObject *)PoolVector2Array_to_mono_array(p_var->operator PoolVector2Array()); - case Variant::POOL_VECTOR3_ARRAY: - return (MonoObject *)PoolVector3Array_to_mono_array(p_var->operator PoolVector3Array()); - case Variant::POOL_COLOR_ARRAY: - return (MonoObject *)PoolColorArray_to_mono_array(p_var->operator PoolColorArray()); + case Variant::PACKED_BYTE_ARRAY: + return (MonoObject *)PackedByteArray_to_mono_array(p_var->operator PackedByteArray()); + case Variant::PACKED_INT_ARRAY: + return (MonoObject *)PackedIntArray_to_mono_array(p_var->operator PackedIntArray()); + case Variant::PACKED_REAL_ARRAY: + return (MonoObject *)PackedRealArray_to_mono_array(p_var->operator PackedRealArray()); + case Variant::PACKED_STRING_ARRAY: + return (MonoObject *)PackedStringArray_to_mono_array(p_var->operator PackedStringArray()); + case Variant::PACKED_VECTOR2_ARRAY: + return (MonoObject *)PackedVector2Array_to_mono_array(p_var->operator PackedVector2Array()); + case Variant::PACKED_VECTOR3_ARRAY: + return (MonoObject *)PackedVector3Array_to_mono_array(p_var->operator PackedVector3Array()); + case Variant::PACKED_COLOR_ARRAY: + return (MonoObject *)PackedColorArray_to_mono_array(p_var->operator PackedColorArray()); default: return NULL; } @@ -785,25 +785,25 @@ Variant mono_object_to_variant_impl(MonoObject *p_obj, const ManagedType &p_type return mono_array_to_Array((MonoArray *)p_obj); if (array_type->eklass == CACHED_CLASS_RAW(uint8_t)) - return mono_array_to_PoolByteArray((MonoArray *)p_obj); + return mono_array_to_PackedByteArray((MonoArray *)p_obj); if (array_type->eklass == CACHED_CLASS_RAW(int32_t)) - return mono_array_to_PoolIntArray((MonoArray *)p_obj); + return mono_array_to_PackedIntArray((MonoArray *)p_obj); if (array_type->eklass == REAL_T_MONOCLASS) - return mono_array_to_PoolRealArray((MonoArray *)p_obj); + return mono_array_to_PackedRealArray((MonoArray *)p_obj); if (array_type->eklass == CACHED_CLASS_RAW(String)) - return mono_array_to_PoolStringArray((MonoArray *)p_obj); + return mono_array_to_PackedStringArray((MonoArray *)p_obj); if (array_type->eklass == CACHED_CLASS_RAW(Vector2)) - return mono_array_to_PoolVector2Array((MonoArray *)p_obj); + return mono_array_to_PackedVector2Array((MonoArray *)p_obj); if (array_type->eklass == CACHED_CLASS_RAW(Vector3)) - return mono_array_to_PoolVector3Array((MonoArray *)p_obj); + return mono_array_to_PackedVector3Array((MonoArray *)p_obj); if (array_type->eklass == CACHED_CLASS_RAW(Color)) - return mono_array_to_PoolColorArray((MonoArray *)p_obj); + return mono_array_to_PackedColorArray((MonoArray *)p_obj); if (p_fail_with_err) { ERR_FAIL_V_MSG(Variant(), "Attempted to convert a managed array of unmarshallable element type to Variant."); @@ -987,8 +987,8 @@ Array mono_array_to_Array(MonoArray *p_array) { // TODO: Use memcpy where possible -MonoArray *PoolIntArray_to_mono_array(const PoolIntArray &p_array) { - PoolIntArray::Read r = p_array.read(); +MonoArray *PackedIntArray_to_mono_array(const PackedIntArray &p_array) { + const int *r = p_array.ptr(); MonoArray *ret = mono_array_new(mono_domain_get(), CACHED_CLASS_RAW(int32_t), p_array.size()); @@ -999,13 +999,13 @@ MonoArray *PoolIntArray_to_mono_array(const PoolIntArray &p_array) { return ret; } -PoolIntArray mono_array_to_PoolIntArray(MonoArray *p_array) { - PoolIntArray ret; +PackedIntArray mono_array_to_PackedIntArray(MonoArray *p_array) { + PackedIntArray ret; if (!p_array) return ret; int length = mono_array_length(p_array); ret.resize(length); - PoolIntArray::Write w = ret.write(); + int *w = ret.ptrw(); for (int i = 0; i < length; i++) { w[i] = mono_array_get(p_array, int32_t, i); @@ -1014,8 +1014,8 @@ PoolIntArray mono_array_to_PoolIntArray(MonoArray *p_array) { return ret; } -MonoArray *PoolByteArray_to_mono_array(const PoolByteArray &p_array) { - PoolByteArray::Read r = p_array.read(); +MonoArray *PackedByteArray_to_mono_array(const PackedByteArray &p_array) { + const uint8_t *r = p_array.ptr(); MonoArray *ret = mono_array_new(mono_domain_get(), CACHED_CLASS_RAW(uint8_t), p_array.size()); @@ -1026,13 +1026,13 @@ MonoArray *PoolByteArray_to_mono_array(const PoolByteArray &p_array) { return ret; } -PoolByteArray mono_array_to_PoolByteArray(MonoArray *p_array) { - PoolByteArray ret; +PackedByteArray mono_array_to_PackedByteArray(MonoArray *p_array) { + PackedByteArray ret; if (!p_array) return ret; int length = mono_array_length(p_array); ret.resize(length); - PoolByteArray::Write w = ret.write(); + uint8_t *w = ret.ptrw(); for (int i = 0; i < length; i++) { w[i] = mono_array_get(p_array, uint8_t, i); @@ -1041,8 +1041,8 @@ PoolByteArray mono_array_to_PoolByteArray(MonoArray *p_array) { return ret; } -MonoArray *PoolRealArray_to_mono_array(const PoolRealArray &p_array) { - PoolRealArray::Read r = p_array.read(); +MonoArray *PackedRealArray_to_mono_array(const PackedRealArray &p_array) { + const real_t *r = p_array.ptr(); MonoArray *ret = mono_array_new(mono_domain_get(), REAL_T_MONOCLASS, p_array.size()); @@ -1053,13 +1053,13 @@ MonoArray *PoolRealArray_to_mono_array(const PoolRealArray &p_array) { return ret; } -PoolRealArray mono_array_to_PoolRealArray(MonoArray *p_array) { - PoolRealArray ret; +PackedRealArray mono_array_to_PackedRealArray(MonoArray *p_array) { + PackedRealArray ret; if (!p_array) return ret; int length = mono_array_length(p_array); ret.resize(length); - PoolRealArray::Write w = ret.write(); + real_t *w = ret.ptrw(); for (int i = 0; i < length; i++) { w[i] = mono_array_get(p_array, real_t, i); @@ -1068,8 +1068,8 @@ PoolRealArray mono_array_to_PoolRealArray(MonoArray *p_array) { return ret; } -MonoArray *PoolStringArray_to_mono_array(const PoolStringArray &p_array) { - PoolStringArray::Read r = p_array.read(); +MonoArray *PackedStringArray_to_mono_array(const PackedStringArray &p_array) { + const String *r = p_array.ptr(); MonoArray *ret = mono_array_new(mono_domain_get(), CACHED_CLASS_RAW(String), p_array.size()); @@ -1081,13 +1081,13 @@ MonoArray *PoolStringArray_to_mono_array(const PoolStringArray &p_array) { return ret; } -PoolStringArray mono_array_to_PoolStringArray(MonoArray *p_array) { - PoolStringArray ret; +PackedStringArray mono_array_to_PackedStringArray(MonoArray *p_array) { + PackedStringArray ret; if (!p_array) return ret; int length = mono_array_length(p_array); ret.resize(length); - PoolStringArray::Write w = ret.write(); + String *w = ret.ptrw(); for (int i = 0; i < length; i++) { MonoString *elem = mono_array_get(p_array, MonoString *, i); @@ -1097,8 +1097,8 @@ PoolStringArray mono_array_to_PoolStringArray(MonoArray *p_array) { return ret; } -MonoArray *PoolColorArray_to_mono_array(const PoolColorArray &p_array) { - PoolColorArray::Read r = p_array.read(); +MonoArray *PackedColorArray_to_mono_array(const PackedColorArray &p_array) { + const Color *r = p_array.ptr(); MonoArray *ret = mono_array_new(mono_domain_get(), CACHED_CLASS_RAW(Color), p_array.size()); @@ -1110,13 +1110,13 @@ MonoArray *PoolColorArray_to_mono_array(const PoolColorArray &p_array) { return ret; } -PoolColorArray mono_array_to_PoolColorArray(MonoArray *p_array) { - PoolColorArray ret; +PackedColorArray mono_array_to_PackedColorArray(MonoArray *p_array) { + PackedColorArray ret; if (!p_array) return ret; int length = mono_array_length(p_array); ret.resize(length); - PoolColorArray::Write w = ret.write(); + Color *w = ret.ptrw(); for (int i = 0; i < length; i++) { w[i] = MARSHALLED_IN(Color, (M_Color *)mono_array_addr_with_size(p_array, sizeof(M_Color), i)); @@ -1125,8 +1125,8 @@ PoolColorArray mono_array_to_PoolColorArray(MonoArray *p_array) { return ret; } -MonoArray *PoolVector2Array_to_mono_array(const PoolVector2Array &p_array) { - PoolVector2Array::Read r = p_array.read(); +MonoArray *PackedVector2Array_to_mono_array(const PackedVector2Array &p_array) { + const Vector2 *r = p_array.ptr(); MonoArray *ret = mono_array_new(mono_domain_get(), CACHED_CLASS_RAW(Vector2), p_array.size()); @@ -1138,13 +1138,13 @@ MonoArray *PoolVector2Array_to_mono_array(const PoolVector2Array &p_array) { return ret; } -PoolVector2Array mono_array_to_PoolVector2Array(MonoArray *p_array) { - PoolVector2Array ret; +PackedVector2Array mono_array_to_PackedVector2Array(MonoArray *p_array) { + PackedVector2Array ret; if (!p_array) return ret; int length = mono_array_length(p_array); ret.resize(length); - PoolVector2Array::Write w = ret.write(); + Vector2 *w = ret.ptrw(); for (int i = 0; i < length; i++) { w[i] = MARSHALLED_IN(Vector2, (M_Vector2 *)mono_array_addr_with_size(p_array, sizeof(M_Vector2), i)); @@ -1153,8 +1153,8 @@ PoolVector2Array mono_array_to_PoolVector2Array(MonoArray *p_array) { return ret; } -MonoArray *PoolVector3Array_to_mono_array(const PoolVector3Array &p_array) { - PoolVector3Array::Read r = p_array.read(); +MonoArray *PackedVector3Array_to_mono_array(const PackedVector3Array &p_array) { + const Vector3 *r = p_array.ptr(); MonoArray *ret = mono_array_new(mono_domain_get(), CACHED_CLASS_RAW(Vector3), p_array.size()); @@ -1166,13 +1166,13 @@ MonoArray *PoolVector3Array_to_mono_array(const PoolVector3Array &p_array) { return ret; } -PoolVector3Array mono_array_to_PoolVector3Array(MonoArray *p_array) { - PoolVector3Array ret; +PackedVector3Array mono_array_to_PackedVector3Array(MonoArray *p_array) { + PackedVector3Array ret; if (!p_array) return ret; int length = mono_array_length(p_array); ret.resize(length); - PoolVector3Array::Write w = ret.write(); + Vector3 *w = ret.ptrw(); for (int i = 0; i < length; i++) { w[i] = MARSHALLED_IN(Vector3, (M_Vector3 *)mono_array_addr_with_size(p_array, sizeof(M_Vector3), i)); diff --git a/modules/mono/mono_gd/gd_mono_marshal.h b/modules/mono/mono_gd/gd_mono_marshal.h index e662e7814e..d3527109ff 100644 --- a/modules/mono/mono_gd/gd_mono_marshal.h +++ b/modules/mono/mono_gd/gd_mono_marshal.h @@ -127,40 +127,40 @@ String mono_object_to_variant_string(MonoObject *p_obj, MonoException **r_exc); MonoArray *Array_to_mono_array(const Array &p_array); Array mono_array_to_Array(MonoArray *p_array); -// PoolIntArray +// PackedIntArray -MonoArray *PoolIntArray_to_mono_array(const PoolIntArray &p_array); -PoolIntArray mono_array_to_PoolIntArray(MonoArray *p_array); +MonoArray *PackedIntArray_to_mono_array(const PackedIntArray &p_array); +PackedIntArray mono_array_to_PackedIntArray(MonoArray *p_array); -// PoolByteArray +// PackedByteArray -MonoArray *PoolByteArray_to_mono_array(const PoolByteArray &p_array); -PoolByteArray mono_array_to_PoolByteArray(MonoArray *p_array); +MonoArray *PackedByteArray_to_mono_array(const PackedByteArray &p_array); +PackedByteArray mono_array_to_PackedByteArray(MonoArray *p_array); -// PoolRealArray +// PackedRealArray -MonoArray *PoolRealArray_to_mono_array(const PoolRealArray &p_array); -PoolRealArray mono_array_to_PoolRealArray(MonoArray *p_array); +MonoArray *PackedRealArray_to_mono_array(const PackedRealArray &p_array); +PackedRealArray mono_array_to_PackedRealArray(MonoArray *p_array); -// PoolStringArray +// PackedStringArray -MonoArray *PoolStringArray_to_mono_array(const PoolStringArray &p_array); -PoolStringArray mono_array_to_PoolStringArray(MonoArray *p_array); +MonoArray *PackedStringArray_to_mono_array(const PackedStringArray &p_array); +PackedStringArray mono_array_to_PackedStringArray(MonoArray *p_array); -// PoolColorArray +// PackedColorArray -MonoArray *PoolColorArray_to_mono_array(const PoolColorArray &p_array); -PoolColorArray mono_array_to_PoolColorArray(MonoArray *p_array); +MonoArray *PackedColorArray_to_mono_array(const PackedColorArray &p_array); +PackedColorArray mono_array_to_PackedColorArray(MonoArray *p_array); -// PoolVector2Array +// PackedVector2Array -MonoArray *PoolVector2Array_to_mono_array(const PoolVector2Array &p_array); -PoolVector2Array mono_array_to_PoolVector2Array(MonoArray *p_array); +MonoArray *PackedVector2Array_to_mono_array(const PackedVector2Array &p_array); +PackedVector2Array mono_array_to_PackedVector2Array(MonoArray *p_array); -// PoolVector3Array +// PackedVector3Array -MonoArray *PoolVector3Array_to_mono_array(const PoolVector3Array &p_array); -PoolVector3Array mono_array_to_PoolVector3Array(MonoArray *p_array); +MonoArray *PackedVector3Array_to_mono_array(const PackedVector3Array &p_array); +PackedVector3Array mono_array_to_PackedVector3Array(MonoArray *p_array); // Structures diff --git a/modules/mono/utils/string_utils.cpp b/modules/mono/utils/string_utils.cpp index 911ac5c4a3..49c4fb3f73 100644 --- a/modules/mono/utils/string_utils.cpp +++ b/modules/mono/utils/string_utils.cpp @@ -162,22 +162,22 @@ String escape_csharp_keyword(const String &p_name) { #endif Error read_all_file_utf8(const String &p_path, String &r_content) { - PoolVector<uint8_t> sourcef; + Vector<uint8_t> sourcef; Error err; FileAccess *f = FileAccess::open(p_path, FileAccess::READ, &err); ERR_FAIL_COND_V_MSG(err != OK, err, "Cannot open file '" + p_path + "'."); int len = f->get_len(); sourcef.resize(len + 1); - PoolVector<uint8_t>::Write w = sourcef.write(); - int r = f->get_buffer(w.ptr(), len); + uint8_t *w = sourcef.ptrw(); + int r = f->get_buffer(w, len); f->close(); memdelete(f); ERR_FAIL_COND_V(r != len, ERR_CANT_OPEN); w[len] = 0; String source; - if (source.parse_utf8((const char *)w.ptr())) { + if (source.parse_utf8((const char *)w)) { ERR_FAIL_V(ERR_INVALID_DATA); } diff --git a/modules/opensimplex/open_simplex_noise.cpp b/modules/opensimplex/open_simplex_noise.cpp index bd187e6b5b..bd2dbd74a8 100644 --- a/modules/opensimplex/open_simplex_noise.cpp +++ b/modules/opensimplex/open_simplex_noise.cpp @@ -98,10 +98,10 @@ void OpenSimplexNoise::set_lacunarity(float p_lacunarity) { Ref<Image> OpenSimplexNoise::get_image(int p_width, int p_height) { - PoolVector<uint8_t> data; + Vector<uint8_t> data; data.resize(p_width * p_height * 4); - PoolVector<uint8_t>::Write wd8 = data.write(); + uint8_t *wd8 = data.ptrw(); for (int i = 0; i < p_height; i++) { for (int j = 0; j < p_width; j++) { @@ -121,10 +121,10 @@ Ref<Image> OpenSimplexNoise::get_image(int p_width, int p_height) { Ref<Image> OpenSimplexNoise::get_seamless_image(int p_size) { - PoolVector<uint8_t> data; + Vector<uint8_t> data; data.resize(p_size * p_size * 4); - PoolVector<uint8_t>::Write wd8 = data.write(); + uint8_t *wd8 = data.ptrw(); for (int i = 0; i < p_size; i++) { for (int j = 0; j < p_size; j++) { diff --git a/modules/pvr/texture_loader_pvr.cpp b/modules/pvr/texture_loader_pvr.cpp index 36f2fe1ba1..dab4f64393 100644 --- a/modules/pvr/texture_loader_pvr.cpp +++ b/modules/pvr/texture_loader_pvr.cpp @@ -96,12 +96,12 @@ RES ResourceFormatPVR::load(const String &p_path, const String &p_original_path, print_line("surfcount: "+itos(surfcount)); */ - PoolVector<uint8_t> data; + Vector<uint8_t> data; data.resize(surfsize); ERR_FAIL_COND_V(data.size() == 0, RES()); - PoolVector<uint8_t>::Write w = data.write(); + uint8_t *w = data.ptrw(); f->get_buffer(&w[0], surfsize); err = f->get_error(); ERR_FAIL_COND_V(err != OK, RES()); @@ -152,8 +152,6 @@ RES ResourceFormatPVR::load(const String &p_path, const String &p_original_path, ERR_FAIL_V_MSG(RES(), "Unsupported format in PVR texture: " + itos(flags & 0xFF) + "."); } - w.release(); - Ref<Image> image = memnew(Image(width, height, mipmaps, format, data)); ERR_FAIL_COND_V(image->empty(), RES()); @@ -200,10 +198,10 @@ static void _compress_pvrtc4(Image *p_img) { new_img.instance(); new_img->create(img->get_width(), img->get_height(), img->has_mipmaps(), use_alpha ? Image::FORMAT_PVRTC4A : Image::FORMAT_PVRTC4); - PoolVector<uint8_t> data = new_img->get_data(); + Vector<uint8_t> data = new_img->get_data(); { - PoolVector<uint8_t>::Write wr = data.write(); - PoolVector<uint8_t>::Read r = img->get_data().read(); + uint8_t *wr = data.ptrw(); + const uint8_t *r = img->get_data().ptr(); for (int i = 0; i <= new_img->get_mipmap_count(); i++) { @@ -640,17 +638,14 @@ static void _pvrtc_decompress(Image *p_img) { bool _2bit = (p_img->get_format() == Image::FORMAT_PVRTC2 || p_img->get_format() == Image::FORMAT_PVRTC2A); - PoolVector<uint8_t> data = p_img->get_data(); - PoolVector<uint8_t>::Read r = data.read(); + Vector<uint8_t> data = p_img->get_data(); + const uint8_t *r = data.ptr(); - PoolVector<uint8_t> newdata; + Vector<uint8_t> newdata; newdata.resize(p_img->get_width() * p_img->get_height() * 4); - PoolVector<uint8_t>::Write w = newdata.write(); - - decompress_pvrtc((PVRTCBlock *)r.ptr(), _2bit, p_img->get_width(), p_img->get_height(), 0, (unsigned char *)w.ptr()); + uint8_t *w = newdata.ptrw(); - w.release(); - r.release(); + decompress_pvrtc((PVRTCBlock *)r, _2bit, p_img->get_width(), p_img->get_height(), 0, (unsigned char *)w); bool make_mipmaps = p_img->has_mipmaps(); p_img->create(p_img->get_width(), p_img->get_height(), false, Image::FORMAT_RGBA8, newdata); diff --git a/modules/squish/image_compress_squish.cpp b/modules/squish/image_compress_squish.cpp index 2f680fd3d0..bb77f68590 100644 --- a/modules/squish/image_compress_squish.cpp +++ b/modules/squish/image_compress_squish.cpp @@ -37,13 +37,13 @@ void image_decompress_squish(Image *p_image) { int h = p_image->get_height(); Image::Format target_format = Image::FORMAT_RGBA8; - PoolVector<uint8_t> data; + Vector<uint8_t> data; int target_size = Image::get_image_data_size(w, h, target_format, p_image->has_mipmaps()); int mm_count = p_image->get_mipmap_count(); data.resize(target_size); - PoolVector<uint8_t>::Read rb = p_image->get_data().read(); - PoolVector<uint8_t>::Write wb = data.write(); + const uint8_t *rb = p_image->get_data().ptr(); + uint8_t *wb = data.ptrw(); int squish_flags = Image::FORMAT_MAX; if (p_image->get_format() == Image::FORMAT_DXT1) { @@ -137,14 +137,14 @@ void image_compress_squish(Image *p_image, float p_lossy_quality, Image::UsedCha } } - PoolVector<uint8_t> data; + Vector<uint8_t> data; int target_size = Image::get_image_data_size(w, h, target_format, p_image->has_mipmaps()); int mm_count = p_image->has_mipmaps() ? Image::get_image_required_mipmaps(w, h, target_format) : 0; data.resize(target_size); int shift = Image::get_format_pixel_rshift(target_format); - PoolVector<uint8_t>::Read rb = p_image->get_data().read(); - PoolVector<uint8_t>::Write wb = data.write(); + const uint8_t *rb = p_image->get_data().ptr(); + uint8_t *wb = data.ptrw(); int dst_ofs = 0; @@ -160,9 +160,6 @@ void image_compress_squish(Image *p_image, float p_lossy_quality, Image::UsedCha h = MAX(h / 2, 1); } - rb.release(); - wb.release(); - p_image->create(p_image->get_width(), p_image->get_height(), p_image->has_mipmaps(), target_format, data); } } diff --git a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp index f2d0f5c9a6..6224db90e7 100644 --- a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp +++ b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp @@ -163,32 +163,32 @@ void AudioStreamOGGVorbis::clear_data() { } } -void AudioStreamOGGVorbis::set_data(const PoolVector<uint8_t> &p_data) { +void AudioStreamOGGVorbis::set_data(const Vector<uint8_t> &p_data) { int src_data_len = p_data.size(); #define MAX_TEST_MEM (1 << 20) uint32_t alloc_try = 1024; - PoolVector<char> alloc_mem; - PoolVector<char>::Write w; + Vector<char> alloc_mem; + char *w; stb_vorbis *ogg_stream = NULL; stb_vorbis_alloc ogg_alloc; while (alloc_try < MAX_TEST_MEM) { alloc_mem.resize(alloc_try); - w = alloc_mem.write(); + w = alloc_mem.ptrw(); - ogg_alloc.alloc_buffer = w.ptr(); + ogg_alloc.alloc_buffer = w; ogg_alloc.alloc_buffer_length_in_bytes = alloc_try; - PoolVector<uint8_t>::Read src_datar = p_data.read(); + const uint8_t *src_datar = p_data.ptr(); int error; - ogg_stream = stb_vorbis_open_memory((const unsigned char *)src_datar.ptr(), src_data_len, &error, &ogg_alloc); + ogg_stream = stb_vorbis_open_memory((const unsigned char *)src_datar, src_data_len, &error, &ogg_alloc); if (!ogg_stream && error == VORBIS_outofmem) { - w.release(); + alloc_try *= 2; } else { @@ -209,7 +209,7 @@ void AudioStreamOGGVorbis::set_data(const PoolVector<uint8_t> &p_data) { // free any existing data clear_data(); - data = AudioServer::get_singleton()->audio_data_alloc(src_data_len, src_datar.ptr()); + data = AudioServer::get_singleton()->audio_data_alloc(src_data_len, src_datar); data_len = src_data_len; break; @@ -217,15 +217,15 @@ void AudioStreamOGGVorbis::set_data(const PoolVector<uint8_t> &p_data) { } } -PoolVector<uint8_t> AudioStreamOGGVorbis::get_data() const { +Vector<uint8_t> AudioStreamOGGVorbis::get_data() const { - PoolVector<uint8_t> vdata; + Vector<uint8_t> vdata; if (data_len && data) { vdata.resize(data_len); { - PoolVector<uint8_t>::Write w = vdata.write(); - copymem(w.ptr(), data, data_len); + uint8_t *w = vdata.ptrw(); + copymem(w, data, data_len); } } @@ -265,7 +265,7 @@ void AudioStreamOGGVorbis::_bind_methods() { ClassDB::bind_method(D_METHOD("set_loop_offset", "seconds"), &AudioStreamOGGVorbis::set_loop_offset); ClassDB::bind_method(D_METHOD("get_loop_offset"), &AudioStreamOGGVorbis::get_loop_offset); - ADD_PROPERTY(PropertyInfo(Variant::POOL_BYTE_ARRAY, "data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_data", "get_data"); + ADD_PROPERTY(PropertyInfo(Variant::PACKED_BYTE_ARRAY, "data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_data", "get_data"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "loop"), "set_loop", "has_loop"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "loop_offset"), "set_loop_offset", "get_loop_offset"); } diff --git a/modules/stb_vorbis/audio_stream_ogg_vorbis.h b/modules/stb_vorbis/audio_stream_ogg_vorbis.h index e909759acb..f296e8c19f 100644 --- a/modules/stb_vorbis/audio_stream_ogg_vorbis.h +++ b/modules/stb_vorbis/audio_stream_ogg_vorbis.h @@ -102,8 +102,8 @@ public: virtual Ref<AudioStreamPlayback> instance_playback(); virtual String get_stream_name() const; - void set_data(const PoolVector<uint8_t> &p_data); - PoolVector<uint8_t> get_data() const; + void set_data(const Vector<uint8_t> &p_data); + Vector<uint8_t> get_data() const; virtual float get_length() const; //if supported, otherwise return 0 diff --git a/modules/stb_vorbis/resource_importer_ogg_vorbis.cpp b/modules/stb_vorbis/resource_importer_ogg_vorbis.cpp index 06399f4005..ec89f2ac76 100644 --- a/modules/stb_vorbis/resource_importer_ogg_vorbis.cpp +++ b/modules/stb_vorbis/resource_importer_ogg_vorbis.cpp @@ -87,11 +87,11 @@ Error ResourceImporterOGGVorbis::import(const String &p_source_file, const Strin size_t len = f->get_len(); - PoolVector<uint8_t> data; + Vector<uint8_t> data; data.resize(len); - PoolVector<uint8_t>::Write w = data.write(); + uint8_t *w = data.ptrw(); - f->get_buffer(w.ptr(), len); + f->get_buffer(w, len); memdelete(f); diff --git a/modules/svg/image_loader_svg.cpp b/modules/svg/image_loader_svg.cpp index 7f91908a33..e9d30d015a 100644 --- a/modules/svg/image_loader_svg.cpp +++ b/modules/svg/image_loader_svg.cpp @@ -94,10 +94,10 @@ void ImageLoaderSVG::set_convert_colors(Dictionary *p_replace_color) { } } -Error ImageLoaderSVG::_create_image(Ref<Image> p_image, const PoolVector<uint8_t> *p_data, float p_scale, bool upsample, bool convert_colors) { +Error ImageLoaderSVG::_create_image(Ref<Image> p_image, const Vector<uint8_t> *p_data, float p_scale, bool upsample, bool convert_colors) { NSVGimage *svg_image; - PoolVector<uint8_t>::Read src_r = p_data->read(); - svg_image = nsvgParse((char *)src_r.ptr(), "px", 96); + const uint8_t *src_r = p_data->ptr(); + svg_image = nsvgParse((char *)src_r, "px", 96); if (svg_image == NULL) { ERR_PRINT("SVG Corrupted"); return ERR_FILE_CORRUPT; @@ -115,14 +115,13 @@ Error ImageLoaderSVG::_create_image(Ref<Image> p_image, const PoolVector<uint8_t const int h = (int)(svg_image->height * p_scale * upscale); ERR_FAIL_COND_V_MSG(h > Image::MAX_HEIGHT, ERR_PARAMETER_RANGE_ERROR, vformat("Can't create image from SVG with scale %s, the resulting image size exceeds max height.", rtos(p_scale))); - PoolVector<uint8_t> dst_image; + Vector<uint8_t> dst_image; dst_image.resize(w * h * 4); - PoolVector<uint8_t>::Write dw = dst_image.write(); + uint8_t *dw = dst_image.ptrw(); - rasterizer.rasterize(svg_image, 0, 0, p_scale * upscale, (unsigned char *)dw.ptr(), w, h, w * 4); + rasterizer.rasterize(svg_image, 0, 0, p_scale * upscale, (unsigned char *)dw, w, h, w * 4); - dw.release(); p_image->create(w, h, false, Image::FORMAT_RGBA8, dst_image); if (upsample) { p_image->shrink_x2(); @@ -136,10 +135,10 @@ Error ImageLoaderSVG::_create_image(Ref<Image> p_image, const PoolVector<uint8_t Error ImageLoaderSVG::create_image_from_string(Ref<Image> p_image, const char *p_svg_str, float p_scale, bool upsample, bool convert_colors) { size_t str_len = strlen(p_svg_str); - PoolVector<uint8_t> src_data; + Vector<uint8_t> src_data; src_data.resize(str_len + 1); - PoolVector<uint8_t>::Write src_w = src_data.write(); - memcpy(src_w.ptr(), p_svg_str, str_len + 1); + uint8_t *src_w = src_data.ptrw(); + memcpy(src_w, p_svg_str, str_len + 1); return _create_image(p_image, &src_data, p_scale, upsample, convert_colors); } @@ -147,11 +146,11 @@ Error ImageLoaderSVG::create_image_from_string(Ref<Image> p_image, const char *p Error ImageLoaderSVG::load_image(Ref<Image> p_image, FileAccess *f, bool p_force_linear, float p_scale) { uint32_t size = f->get_len(); - PoolVector<uint8_t> src_image; + Vector<uint8_t> src_image; src_image.resize(size + 1); - PoolVector<uint8_t>::Write src_w = src_image.write(); - f->get_buffer(src_w.ptr(), size); - src_w.ptr()[size] = '\0'; + uint8_t *src_w = src_image.ptrw(); + f->get_buffer(src_w, size); + src_w[size] = '\0'; return _create_image(p_image, &src_image, p_scale, 1.0); } diff --git a/modules/svg/image_loader_svg.h b/modules/svg/image_loader_svg.h index 24cee82480..def2885199 100644 --- a/modules/svg/image_loader_svg.h +++ b/modules/svg/image_loader_svg.h @@ -60,7 +60,7 @@ class ImageLoaderSVG : public ImageFormatLoader { } replace_colors; static SVGRasterizer rasterizer; static void _convert_colors(NSVGimage *p_svg_image); - static Error _create_image(Ref<Image> p_image, const PoolVector<uint8_t> *p_data, float p_scale, bool upsample, bool convert_colors = false); + static Error _create_image(Ref<Image> p_image, const Vector<uint8_t> *p_data, float p_scale, bool upsample, bool convert_colors = false); public: static void set_convert_colors(Dictionary *p_replace_color = NULL); diff --git a/modules/tga/image_loader_tga.cpp b/modules/tga/image_loader_tga.cpp index 480016eb97..0e904fdd76 100644 --- a/modules/tga/image_loader_tga.cpp +++ b/modules/tga/image_loader_tga.cpp @@ -36,12 +36,12 @@ Error ImageLoaderTGA::decode_tga_rle(const uint8_t *p_compressed_buffer, size_t p_pixel_size, uint8_t *p_uncompressed_buffer, size_t p_output_size) { Error error; - PoolVector<uint8_t> pixels; + Vector<uint8_t> pixels; error = pixels.resize(p_pixel_size); if (error != OK) return error; - PoolVector<uint8_t>::Write pixels_w = pixels.write(); + uint8_t *pixels_w = pixels.ptrw(); size_t compressed_pos = 0; size_t output_pos = 0; @@ -55,12 +55,12 @@ Error ImageLoaderTGA::decode_tga_rle(const uint8_t *p_compressed_buffer, size_t if (c & 0x80) { for (size_t i = 0; i < p_pixel_size; i++) { - pixels_w.ptr()[i] = p_compressed_buffer[compressed_pos]; + pixels_w[i] = p_compressed_buffer[compressed_pos]; compressed_pos += 1; } for (size_t i = 0; i < count; i++) { for (size_t j = 0; j < p_pixel_size; j++) { - p_uncompressed_buffer[output_pos + j] = pixels_w.ptr()[j]; + p_uncompressed_buffer[output_pos + j] = pixels_w[j]; } output_pos += p_pixel_size; } @@ -116,9 +116,9 @@ Error ImageLoaderTGA::convert_to_image(Ref<Image> p_image, const uint8_t *p_buff x_end = -1; } - PoolVector<uint8_t> image_data; + Vector<uint8_t> image_data; image_data.resize(width * height * sizeof(uint32_t)); - PoolVector<uint8_t>::Write image_data_w = image_data.write(); + uint8_t *image_data_w = image_data.ptrw(); size_t i = 0; uint32_t x = x_start; @@ -199,8 +199,6 @@ Error ImageLoaderTGA::convert_to_image(Ref<Image> p_image, const uint8_t *p_buff } } - image_data_w.release(); - p_image->create(width, height, 0, Image::FORMAT_RGBA8, image_data); return OK; @@ -208,7 +206,7 @@ Error ImageLoaderTGA::convert_to_image(Ref<Image> p_image, const uint8_t *p_buff Error ImageLoaderTGA::load_image(Ref<Image> p_image, FileAccess *f, bool p_force_linear, float p_scale) { - PoolVector<uint8_t> src_image; + Vector<uint8_t> src_image; int src_image_len = f->get_len(); ERR_FAIL_COND_V(src_image_len == 0, ERR_FILE_CORRUPT); ERR_FAIL_COND_V(src_image_len < (int)sizeof(tga_header_s), ERR_FILE_CORRUPT); @@ -259,49 +257,49 @@ Error ImageLoaderTGA::load_image(Ref<Image> p_image, FileAccess *f, bool p_force if (err == OK) { f->seek(f->get_position() + tga_header.id_length); - PoolVector<uint8_t> palette; + Vector<uint8_t> palette; if (has_color_map) { size_t color_map_size = tga_header.color_map_length * (tga_header.color_map_depth >> 3); err = palette.resize(color_map_size); if (err == OK) { - PoolVector<uint8_t>::Write palette_w = palette.write(); + uint8_t *palette_w = palette.ptrw(); f->get_buffer(&palette_w[0], color_map_size); } else { return OK; } } - PoolVector<uint8_t>::Write src_image_w = src_image.write(); + uint8_t *src_image_w = src_image.ptrw(); f->get_buffer(&src_image_w[0], src_image_len - f->get_position()); - PoolVector<uint8_t>::Read src_image_r = src_image.read(); + const uint8_t *src_image_r = src_image.ptr(); const size_t pixel_size = tga_header.pixel_depth >> 3; const size_t buffer_size = (tga_header.image_width * tga_header.image_height) * pixel_size; - PoolVector<uint8_t> uncompressed_buffer; + Vector<uint8_t> uncompressed_buffer; uncompressed_buffer.resize(buffer_size); - PoolVector<uint8_t>::Write uncompressed_buffer_w = uncompressed_buffer.write(); - PoolVector<uint8_t>::Read uncompressed_buffer_r; + uint8_t *uncompressed_buffer_w = uncompressed_buffer.ptrw(); + const uint8_t *uncompressed_buffer_r; const uint8_t *buffer = NULL; if (is_encoded) { - err = decode_tga_rle(src_image_r.ptr(), pixel_size, uncompressed_buffer_w.ptr(), buffer_size); + err = decode_tga_rle(src_image_r, pixel_size, uncompressed_buffer_w, buffer_size); if (err == OK) { - uncompressed_buffer_r = uncompressed_buffer.read(); - buffer = uncompressed_buffer_r.ptr(); + uncompressed_buffer_r = uncompressed_buffer.ptr(); + buffer = uncompressed_buffer_r; } } else { - buffer = src_image_r.ptr(); + buffer = src_image_r; }; if (err == OK) { - PoolVector<uint8_t>::Read palette_r = palette.read(); - err = convert_to_image(p_image, buffer, tga_header, palette_r.ptr(), is_monochrome); + const uint8_t *palette_r = palette.ptr(); + err = convert_to_image(p_image, buffer, tga_header, palette_r, is_monochrome); } } diff --git a/modules/theora/video_stream_theora.cpp b/modules/theora/video_stream_theora.cpp index de229745f5..a44ed0304d 100644 --- a/modules/theora/video_stream_theora.cpp +++ b/modules/theora/video_stream_theora.cpp @@ -87,8 +87,8 @@ void VideoStreamPlaybackTheora::video_write(void) { int pitch = 4; frame_data.resize(size.x * size.y * pitch); { - PoolVector<uint8_t>::Write w = frame_data.write(); - char *dst = (char *)w.ptr(); + uint8_t *w = frame_data.ptrw(); + char *dst = (char *)w; //uv_offset=(ti.pic_x/2)+(yuv[1].stride)*(ti.pic_y/2); diff --git a/modules/theora/video_stream_theora.h b/modules/theora/video_stream_theora.h index c0a0faec4b..258b3a1cce 100644 --- a/modules/theora/video_stream_theora.h +++ b/modules/theora/video_stream_theora.h @@ -54,7 +54,7 @@ class VideoStreamPlaybackTheora : public VideoStreamPlayback { //Image frames[MAX_FRAMES]; Image::Format format; - PoolVector<uint8_t> frame_data; + Vector<uint8_t> frame_data; int frames_pending; FileAccess *file; String file_name; diff --git a/modules/tinyexr/image_loader_tinyexr.cpp b/modules/tinyexr/image_loader_tinyexr.cpp index 79cb135abb..41938f5b42 100644 --- a/modules/tinyexr/image_loader_tinyexr.cpp +++ b/modules/tinyexr/image_loader_tinyexr.cpp @@ -37,12 +37,12 @@ Error ImageLoaderTinyEXR::load_image(Ref<Image> p_image, FileAccess *f, bool p_force_linear, float p_scale) { - PoolVector<uint8_t> src_image; + Vector<uint8_t> src_image; int src_image_len = f->get_len(); ERR_FAIL_COND_V(src_image_len == 0, ERR_FILE_CORRUPT); src_image.resize(src_image_len); - PoolVector<uint8_t>::Write w = src_image.write(); + uint8_t *w = src_image.ptrw(); f->get_buffer(&w[0], src_image_len); @@ -60,13 +60,13 @@ Error ImageLoaderTinyEXR::load_image(Ref<Image> p_image, FileAccess *f, bool p_f InitEXRHeader(&exr_header); - int ret = ParseEXRVersionFromMemory(&exr_version, w.ptr(), src_image_len); + int ret = ParseEXRVersionFromMemory(&exr_version, w, src_image_len); if (ret != TINYEXR_SUCCESS) { return ERR_FILE_CORRUPT; } - ret = ParseEXRHeaderFromMemory(&exr_header, &exr_version, w.ptr(), src_image_len, &err); + ret = ParseEXRHeaderFromMemory(&exr_header, &exr_version, w, src_image_len, &err); if (ret != TINYEXR_SUCCESS) { if (err) { ERR_PRINT(String(err)); @@ -82,7 +82,7 @@ Error ImageLoaderTinyEXR::load_image(Ref<Image> p_image, FileAccess *f, bool p_f } InitEXRImage(&exr_image); - ret = LoadEXRImageFromMemory(&exr_image, &exr_header, w.ptr(), src_image_len, &err); + ret = LoadEXRImageFromMemory(&exr_image, &exr_header, w, src_image_len, &err); if (ret != TINYEXR_SUCCESS) { if (err) { ERR_PRINT(String(err)); @@ -136,7 +136,7 @@ Error ImageLoaderTinyEXR::load_image(Ref<Image> p_image, FileAccess *f, bool p_f // EXR image data loaded, now parse it into Godot-friendly image data - PoolVector<uint8_t> imgdata; + Vector<uint8_t> imgdata; Image::Format format; int output_channels = 0; @@ -180,8 +180,8 @@ Error ImageLoaderTinyEXR::load_image(Ref<Image> p_image, FileAccess *f, bool p_f } { - PoolVector<uint8_t>::Write wd = imgdata.write(); - uint16_t *iw = (uint16_t *)wd.ptr(); + uint8_t *wd = imgdata.ptrw(); + uint16_t *iw = (uint16_t *)wd; // Assume `out_rgba` have enough memory allocated. for (int tile_index = 0; tile_index < num_tiles; tile_index++) { @@ -235,8 +235,6 @@ Error ImageLoaderTinyEXR::load_image(Ref<Image> p_image, FileAccess *f, bool p_f p_image->create(exr_image.width, exr_image.height, false, format, imgdata); - w.release(); - FreeEXRHeader(&exr_header); FreeEXRImage(&exr_image); diff --git a/modules/tinyexr/image_saver_tinyexr.cpp b/modules/tinyexr/image_saver_tinyexr.cpp index a0c01f7e65..05080289bd 100644 --- a/modules/tinyexr/image_saver_tinyexr.cpp +++ b/modules/tinyexr/image_saver_tinyexr.cpp @@ -159,7 +159,7 @@ Error save_exr(const String &p_path, const Ref<Image> &p_img, bool p_grayscale) // Godot does not support more than 4 channels, // so we can preallocate header infos on the stack and use only the subset we need - PoolByteArray channels[max_channels]; + PackedByteArray channels[max_channels]; unsigned char *channels_ptrs[max_channels]; EXRChannelInfo channel_infos[max_channels]; int pixel_types[max_channels]; @@ -188,25 +188,25 @@ Error save_exr(const String &p_path, const Ref<Image> &p_img, bool p_grayscale) const int *channel_mapping = channel_mappings[channel_count - 1]; { - PoolByteArray src_data = p_img->get_data(); - PoolByteArray::Read src_r = src_data.read(); + PackedByteArray src_data = p_img->get_data(); + const uint8_t *src_r = src_data.ptr(); for (int channel_index = 0; channel_index < channel_count; ++channel_index) { // De-interleave channels - PoolByteArray &dst = channels[channel_index]; + PackedByteArray &dst = channels[channel_index]; dst.resize(pixel_count * target_pixel_type_size); - PoolByteArray::Write dst_w = dst.write(); + uint8_t *dst_w = dst.ptrw(); if (src_pixel_type == SRC_FLOAT && target_pixel_type == TINYEXR_PIXELTYPE_FLOAT) { // Note: we don't save mipmaps CRASH_COND(src_data.size() < pixel_count * channel_count * target_pixel_type_size); - const float *src_rp = (float *)src_r.ptr(); - float *dst_wp = (float *)dst_w.ptr(); + const float *src_rp = (float *)src_r; + float *dst_wp = (float *)dst_w; for (int i = 0; i < pixel_count; ++i) { dst_wp[i] = src_rp[channel_index + i * channel_count]; @@ -216,8 +216,8 @@ Error save_exr(const String &p_path, const Ref<Image> &p_img, bool p_grayscale) CRASH_COND(src_data.size() < pixel_count * channel_count * target_pixel_type_size); - const uint16_t *src_rp = (uint16_t *)src_r.ptr(); - uint16_t *dst_wp = (uint16_t *)dst_w.ptr(); + const uint16_t *src_rp = (uint16_t *)src_r; + uint16_t *dst_wp = (uint16_t *)dst_w; for (int i = 0; i < pixel_count; ++i) { dst_wp[i] = src_rp[channel_index + i * channel_count]; @@ -227,8 +227,8 @@ Error save_exr(const String &p_path, const Ref<Image> &p_img, bool p_grayscale) CRASH_COND(src_data.size() < pixel_count * channel_count); - const uint8_t *src_rp = (uint8_t *)src_r.ptr(); - uint16_t *dst_wp = (uint16_t *)dst_w.ptr(); + const uint8_t *src_rp = (uint8_t *)src_r; + uint16_t *dst_wp = (uint16_t *)dst_w; for (int i = 0; i < pixel_count; ++i) { dst_wp[i] = Math::make_half_float(src_rp[channel_index + i * channel_count] / 255.f); @@ -240,7 +240,7 @@ Error save_exr(const String &p_path, const Ref<Image> &p_img, bool p_grayscale) int remapped_index = channel_mapping[channel_index]; - channels_ptrs[remapped_index] = dst_w.ptr(); + channels_ptrs[remapped_index] = dst_w; // No conversion pixel_types[remapped_index] = target_pixel_type; diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp index e712190344..762566e9ae 100644 --- a/modules/visual_script/visual_script.cpp +++ b/modules/visual_script/visual_script.cpp @@ -2584,7 +2584,7 @@ int VisualScriptLanguage::find_function(const String &p_function, const String & return -1; } -String VisualScriptLanguage::make_function(const String &p_class, const String &p_name, const PoolStringArray &p_args) const { +String VisualScriptLanguage::make_function(const String &p_class, const String &p_name, const PackedStringArray &p_args) const { return String(); } diff --git a/modules/visual_script/visual_script.h b/modules/visual_script/visual_script.h index d3569bb040..cc77f9d891 100644 --- a/modules/visual_script/visual_script.h +++ b/modules/visual_script/visual_script.h @@ -599,7 +599,7 @@ public: virtual bool has_named_classes() const; virtual bool supports_builtin_mode() const; virtual int find_function(const String &p_function, const String &p_code) const; - virtual String make_function(const String &p_class, const String &p_name, const PoolStringArray &p_args) const; + virtual String make_function(const String &p_class, const String &p_name, const PackedStringArray &p_args) const; virtual void auto_indent_code(String &p_code, int p_from_line, int p_to_line) const; virtual void add_global_constant(const StringName &p_variable, const Variant &p_value); diff --git a/modules/visual_script/visual_script_builtin_funcs.cpp b/modules/visual_script/visual_script_builtin_funcs.cpp index 832c4c2cc4..e6c95c38b8 100644 --- a/modules/visual_script/visual_script_builtin_funcs.cpp +++ b/modules/visual_script/visual_script_builtin_funcs.cpp @@ -467,7 +467,7 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const case BYTES_TO_VAR: { if (p_idx == 0) - return PropertyInfo(Variant::POOL_BYTE_ARRAY, "bytes"); + return PropertyInfo(Variant::PACKED_BYTE_ARRAY, "bytes"); else return PropertyInfo(Variant::BOOL, "allow_objects"); } break; @@ -632,7 +632,7 @@ PropertyInfo VisualScriptBuiltinFunc::get_output_value_port_info(int p_idx) cons } break; case VAR_TO_BYTES: { if (p_idx == 0) - t = Variant::POOL_BYTE_ARRAY; + t = Variant::PACKED_BYTE_ARRAY; else t = Variant::BOOL; @@ -1228,7 +1228,7 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in r_error.expected = Variant::BOOL; return; } - PoolByteArray barr; + PackedByteArray barr; int len; bool full_objects = *p_inputs[1]; Error err = encode_variant(*p_inputs[0], NULL, len, full_objects); @@ -1242,17 +1242,17 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in barr.resize(len); { - PoolByteArray::Write w = barr.write(); - encode_variant(*p_inputs[0], w.ptr(), len, full_objects); + uint8_t *w = barr.ptrw(); + encode_variant(*p_inputs[0], w, len, full_objects); } *r_return = barr; } break; case VisualScriptBuiltinFunc::BYTES_TO_VAR: { - if (p_inputs[0]->get_type() != Variant::POOL_BYTE_ARRAY) { + if (p_inputs[0]->get_type() != Variant::PACKED_BYTE_ARRAY) { r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; - r_error.expected = Variant::POOL_BYTE_ARRAY; + r_error.expected = Variant::PACKED_BYTE_ARRAY; return; } if (p_inputs[1]->get_type() != Variant::BOOL) { @@ -1262,17 +1262,17 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in return; } - PoolByteArray varr = *p_inputs[0]; + PackedByteArray varr = *p_inputs[0]; bool allow_objects = *p_inputs[1]; Variant ret; { - PoolByteArray::Read r = varr.read(); - Error err = decode_variant(ret, r.ptr(), varr.size(), NULL, allow_objects); + const uint8_t *r = varr.ptr(); + Error err = decode_variant(ret, r, varr.size(), NULL, allow_objects); if (err != OK) { r_error_str = RTR("Not enough bytes for decoding bytes, or invalid format."); r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; - r_error.expected = Variant::POOL_BYTE_ARRAY; + r_error.expected = Variant::PACKED_BYTE_ARRAY; return; } } diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index 9a1125c375..8725563c9b 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -366,13 +366,13 @@ static Color _color_from_type(Variant::Type p_type, bool dark_theme = true) { case Variant::DICTIONARY: color = Color(0.47, 0.93, 0.69); break; case Variant::ARRAY: color = Color(0.88, 0.88, 0.88); break; - case Variant::POOL_BYTE_ARRAY: color = Color(0.67, 0.96, 0.78); break; - case Variant::POOL_INT_ARRAY: color = Color(0.69, 0.86, 0.96); break; - case Variant::POOL_REAL_ARRAY: color = Color(0.59, 0.91, 0.97); break; - case Variant::POOL_STRING_ARRAY: color = Color(0.62, 0.77, 0.95); break; - case Variant::POOL_VECTOR2_ARRAY: color = Color(0.82, 0.7, 0.96); break; - case Variant::POOL_VECTOR3_ARRAY: color = Color(0.87, 0.61, 0.95); break; - case Variant::POOL_COLOR_ARRAY: color = Color(0.91, 1.0, 0.59); break; + case Variant::PACKED_BYTE_ARRAY: color = Color(0.67, 0.96, 0.78); break; + case Variant::PACKED_INT_ARRAY: color = Color(0.69, 0.86, 0.96); break; + case Variant::PACKED_REAL_ARRAY: color = Color(0.59, 0.91, 0.97); break; + case Variant::PACKED_STRING_ARRAY: color = Color(0.62, 0.77, 0.95); break; + case Variant::PACKED_VECTOR2_ARRAY: color = Color(0.82, 0.7, 0.96); break; + case Variant::PACKED_VECTOR3_ARRAY: color = Color(0.87, 0.61, 0.95); break; + case Variant::PACKED_COLOR_ARRAY: color = Color(0.91, 1.0, 0.59); break; default: color.set_hsv(p_type / float(Variant::VARIANT_MAX), 0.7, 0.7); @@ -403,13 +403,13 @@ static Color _color_from_type(Variant::Type p_type, bool dark_theme = true) { case Variant::DICTIONARY: color = Color(0.34, 0.91, 0.62); break; case Variant::ARRAY: color = Color(0.45, 0.45, 0.45); break; - case Variant::POOL_BYTE_ARRAY: color = Color(0.38, 0.92, 0.6); break; - case Variant::POOL_INT_ARRAY: color = Color(0.38, 0.73, 0.92); break; - case Variant::POOL_REAL_ARRAY: color = Color(0.25, 0.83, 0.95); break; - case Variant::POOL_STRING_ARRAY: color = Color(0.38, 0.62, 0.92); break; - case Variant::POOL_VECTOR2_ARRAY: color = Color(0.62, 0.36, 0.92); break; - case Variant::POOL_VECTOR3_ARRAY: color = Color(0.79, 0.35, 0.92); break; - case Variant::POOL_COLOR_ARRAY: color = Color(0.57, 0.73, 0.0); break; + case Variant::PACKED_BYTE_ARRAY: color = Color(0.38, 0.92, 0.6); break; + case Variant::PACKED_INT_ARRAY: color = Color(0.38, 0.73, 0.92); break; + case Variant::PACKED_REAL_ARRAY: color = Color(0.25, 0.83, 0.95); break; + case Variant::PACKED_STRING_ARRAY: color = Color(0.38, 0.62, 0.92); break; + case Variant::PACKED_VECTOR2_ARRAY: color = Color(0.62, 0.36, 0.92); break; + case Variant::PACKED_VECTOR3_ARRAY: color = Color(0.79, 0.35, 0.92); break; + case Variant::PACKED_COLOR_ARRAY: color = Color(0.57, 0.73, 0.0); break; default: color.set_hsv(p_type / float(Variant::VARIANT_MAX), 0.3, 0.3); @@ -520,13 +520,13 @@ void VisualScriptEditor::_update_graph(int p_only_id) { Control::get_icon("MiniObject", "EditorIcons"), Control::get_icon("Dictionary", "EditorIcons"), Control::get_icon("Array", "EditorIcons"), - Control::get_icon("PoolByteArray", "EditorIcons"), - Control::get_icon("PoolIntArray", "EditorIcons"), - Control::get_icon("PoolRealArray", "EditorIcons"), - Control::get_icon("PoolStringArray", "EditorIcons"), - Control::get_icon("PoolVector2Array", "EditorIcons"), - Control::get_icon("PoolVector3Array", "EditorIcons"), - Control::get_icon("PoolColorArray", "EditorIcons") + Control::get_icon("PackedByteArray", "EditorIcons"), + Control::get_icon("PackedIntArray", "EditorIcons"), + Control::get_icon("PackedRealArray", "EditorIcons"), + Control::get_icon("PackedStringArray", "EditorIcons"), + Control::get_icon("PackedVector2Array", "EditorIcons"), + Control::get_icon("PackedVector3Array", "EditorIcons"), + Control::get_icon("PackedColorArray", "EditorIcons") }; Ref<Texture2D> seq_port = Control::get_icon("VisualShaderPort", "EditorIcons"); @@ -976,13 +976,13 @@ void VisualScriptEditor::_update_members() { Control::get_icon("MiniObject", "EditorIcons"), Control::get_icon("Dictionary", "EditorIcons"), Control::get_icon("Array", "EditorIcons"), - Control::get_icon("PoolByteArray", "EditorIcons"), - Control::get_icon("PoolIntArray", "EditorIcons"), - Control::get_icon("PoolRealArray", "EditorIcons"), - Control::get_icon("PoolStringArray", "EditorIcons"), - Control::get_icon("PoolVector2Array", "EditorIcons"), - Control::get_icon("PoolVector3Array", "EditorIcons"), - Control::get_icon("PoolColorArray", "EditorIcons") + Control::get_icon("PackedByteArray", "EditorIcons"), + Control::get_icon("PackedIntArray", "EditorIcons"), + Control::get_icon("PackedRealArray", "EditorIcons"), + Control::get_icon("PackedStringArray", "EditorIcons"), + Control::get_icon("PackedVector2Array", "EditorIcons"), + Control::get_icon("PackedVector3Array", "EditorIcons"), + Control::get_icon("PackedColorArray", "EditorIcons") }; List<StringName> var_names; @@ -2585,7 +2585,7 @@ void VisualScriptEditor::get_breakpoints(List<int> *p_breakpoints) { } } -void VisualScriptEditor::add_callback(const String &p_function, PoolStringArray p_args) { +void VisualScriptEditor::add_callback(const String &p_function, PackedStringArray p_args) { if (script->has_function(p_function)) { _update_members(); diff --git a/modules/visual_script/visual_script_editor.h b/modules/visual_script/visual_script_editor.h index 9f52d87b6a..9a2a42b160 100644 --- a/modules/visual_script/visual_script_editor.h +++ b/modules/visual_script/visual_script_editor.h @@ -313,7 +313,7 @@ public: virtual void tag_saved_version(); virtual void reload(bool p_soft); virtual void get_breakpoints(List<int> *p_breakpoints); - virtual void add_callback(const String &p_function, PoolStringArray p_args); + virtual void add_callback(const String &p_function, PackedStringArray p_args); virtual void update_settings(); virtual bool show_members_overview(); virtual void set_debugger_active(bool p_active); diff --git a/modules/visual_script/visual_script_property_selector.cpp b/modules/visual_script/visual_script_property_selector.cpp index e8c02a41c4..ffcd355fa0 100644 --- a/modules/visual_script/visual_script_property_selector.cpp +++ b/modules/visual_script/visual_script_property_selector.cpp @@ -119,13 +119,13 @@ void VisualScriptPropertySelector::_update_search() { Control::get_icon("Object", "EditorIcons"), Control::get_icon("Dictionary", "EditorIcons"), Control::get_icon("Array", "EditorIcons"), - Control::get_icon("PoolByteArray", "EditorIcons"), - Control::get_icon("PoolIntArray", "EditorIcons"), - Control::get_icon("PoolRealArray", "EditorIcons"), - Control::get_icon("PoolStringArray", "EditorIcons"), - Control::get_icon("PoolVector2Array", "EditorIcons"), - Control::get_icon("PoolVector3Array", "EditorIcons"), - Control::get_icon("PoolColorArray", "EditorIcons") + Control::get_icon("PackedByteArray", "EditorIcons"), + Control::get_icon("PackedIntArray", "EditorIcons"), + Control::get_icon("PackedRealArray", "EditorIcons"), + Control::get_icon("PackedStringArray", "EditorIcons"), + Control::get_icon("PackedVector2Array", "EditorIcons"), + Control::get_icon("PackedVector3Array", "EditorIcons"), + Control::get_icon("PackedColorArray", "EditorIcons") }; { String b = String(E->get()); diff --git a/modules/webm/video_stream_webm.cpp b/modules/webm/video_stream_webm.cpp index 54d34a48c5..5768392fe5 100644 --- a/modules/webm/video_stream_webm.cpp +++ b/modules/webm/video_stream_webm.cpp @@ -315,12 +315,12 @@ void VideoStreamPlaybackWebm::update(float p_delta) { if (err == VPXDecoder::NO_ERROR && image.w == webm->getWidth() && image.h == webm->getHeight()) { - PoolVector<uint8_t>::Write w = frame_data.write(); + uint8_t *w = frame_data.ptrw(); bool converted = false; if (image.chromaShiftW == 0 && image.chromaShiftH == 0 && image.cs == VPX_CS_SRGB) { - uint8_t *wp = w.ptr(); + uint8_t *wp = w; unsigned char *rRow = image.planes[2]; unsigned char *gRow = image.planes[0]; unsigned char *bRow = image.planes[1]; @@ -338,17 +338,17 @@ void VideoStreamPlaybackWebm::update(float p_delta) { converted = true; } else if (image.chromaShiftW == 1 && image.chromaShiftH == 1) { - yuv420_2_rgb8888(w.ptr(), image.planes[0], image.planes[1], image.planes[2], image.w, image.h, image.linesize[0], image.linesize[1], image.w << 2); + yuv420_2_rgb8888(w, image.planes[0], image.planes[1], image.planes[2], image.w, image.h, image.linesize[0], image.linesize[1], image.w << 2); //libyuv::I420ToARGB(image.planes[0], image.linesize[0], image.planes[2], image.linesize[2], image.planes[1], image.linesize[1], w.ptr(), image.w << 2, image.w, image.h); converted = true; } else if (image.chromaShiftW == 1 && image.chromaShiftH == 0) { - yuv422_2_rgb8888(w.ptr(), image.planes[0], image.planes[1], image.planes[2], image.w, image.h, image.linesize[0], image.linesize[1], image.w << 2); + yuv422_2_rgb8888(w, image.planes[0], image.planes[1], image.planes[2], image.w, image.h, image.linesize[0], image.linesize[1], image.w << 2); //libyuv::I422ToARGB(image.planes[0], image.linesize[0], image.planes[2], image.linesize[2], image.planes[1], image.linesize[1], w.ptr(), image.w << 2, image.w, image.h); converted = true; } else if (image.chromaShiftW == 0 && image.chromaShiftH == 0) { - yuv444_2_rgb8888(w.ptr(), image.planes[0], image.planes[1], image.planes[2], image.w, image.h, image.linesize[0], image.linesize[1], image.w << 2); + yuv444_2_rgb8888(w, image.planes[0], image.planes[1], image.planes[2], image.w, image.h, image.linesize[0], image.linesize[1], image.w << 2); //libyuv::I444ToARGB(image.planes[0], image.linesize[0], image.planes[2], image.linesize[2], image.planes[1], image.linesize[1], w.ptr(), image.w << 2, image.w, image.h); converted = true; } else if (image.chromaShiftW == 2 && image.chromaShiftH == 0) { diff --git a/modules/webm/video_stream_webm.h b/modules/webm/video_stream_webm.h index f2a68dd701..a3d3c173f4 100644 --- a/modules/webm/video_stream_webm.h +++ b/modules/webm/video_stream_webm.h @@ -61,7 +61,7 @@ class VideoStreamPlaybackWebm : public VideoStreamPlayback { double delay_compensation; double time, video_frame_delay, video_pos; - PoolVector<uint8_t> frame_data; + Vector<uint8_t> frame_data; Ref<ImageTexture> texture; float *pcm; diff --git a/modules/webp/image_loader_webp.cpp b/modules/webp/image_loader_webp.cpp index 7f4afa9a08..09a8985472 100644 --- a/modules/webp/image_loader_webp.cpp +++ b/modules/webp/image_loader_webp.cpp @@ -38,9 +38,9 @@ #include <webp/decode.h> #include <webp/encode.h> -static PoolVector<uint8_t> _webp_lossy_pack(const Ref<Image> &p_image, float p_quality) { +static Vector<uint8_t> _webp_lossy_pack(const Ref<Image> &p_image, float p_quality) { - ERR_FAIL_COND_V(p_image.is_null() || p_image->empty(), PoolVector<uint8_t>()); + ERR_FAIL_COND_V(p_image.is_null() || p_image->empty(), Vector<uint8_t>()); Ref<Image> img = p_image->duplicate(); if (img->detect_alpha()) @@ -49,37 +49,37 @@ static PoolVector<uint8_t> _webp_lossy_pack(const Ref<Image> &p_image, float p_q img->convert(Image::FORMAT_RGB8); Size2 s(img->get_width(), img->get_height()); - PoolVector<uint8_t> data = img->get_data(); - PoolVector<uint8_t>::Read r = data.read(); + Vector<uint8_t> data = img->get_data(); + const uint8_t *r = data.ptr(); uint8_t *dst_buff = NULL; size_t dst_size = 0; if (img->get_format() == Image::FORMAT_RGB8) { - dst_size = WebPEncodeRGB(r.ptr(), s.width, s.height, 3 * s.width, CLAMP(p_quality * 100.0, 0, 100.0), &dst_buff); + dst_size = WebPEncodeRGB(r, s.width, s.height, 3 * s.width, CLAMP(p_quality * 100.0, 0, 100.0), &dst_buff); } else { - dst_size = WebPEncodeRGBA(r.ptr(), s.width, s.height, 4 * s.width, CLAMP(p_quality * 100.0, 0, 100.0), &dst_buff); + dst_size = WebPEncodeRGBA(r, s.width, s.height, 4 * s.width, CLAMP(p_quality * 100.0, 0, 100.0), &dst_buff); } - ERR_FAIL_COND_V(dst_size == 0, PoolVector<uint8_t>()); - PoolVector<uint8_t> dst; + ERR_FAIL_COND_V(dst_size == 0, Vector<uint8_t>()); + Vector<uint8_t> dst; dst.resize(4 + dst_size); - PoolVector<uint8_t>::Write w = dst.write(); + uint8_t *w = dst.ptrw(); w[0] = 'W'; w[1] = 'E'; w[2] = 'B'; w[3] = 'P'; copymem(&w[4], dst_buff, dst_size); free(dst_buff); - w.release(); + return dst; } -static Ref<Image> _webp_lossy_unpack(const PoolVector<uint8_t> &p_buffer) { +static Ref<Image> _webp_lossy_unpack(const Vector<uint8_t> &p_buffer) { int size = p_buffer.size() - 4; ERR_FAIL_COND_V(size <= 0, Ref<Image>()); - PoolVector<uint8_t>::Read r = p_buffer.read(); + const uint8_t *r = p_buffer.ptr(); ERR_FAIL_COND_V(r[0] != 'W' || r[1] != 'E' || r[2] != 'B' || r[3] != 'P', Ref<Image>()); WebPBitstreamFeatures features; @@ -93,23 +93,21 @@ static Ref<Image> _webp_lossy_unpack(const PoolVector<uint8_t> &p_buffer) { print_line("alpha: "+itos(features.has_alpha)); */ - PoolVector<uint8_t> dst_image; + Vector<uint8_t> dst_image; int datasize = features.width * features.height * (features.has_alpha ? 4 : 3); dst_image.resize(datasize); - PoolVector<uint8_t>::Write dst_w = dst_image.write(); + uint8_t *dst_w = dst_image.ptrw(); bool errdec = false; if (features.has_alpha) { - errdec = WebPDecodeRGBAInto(&r[4], size, dst_w.ptr(), datasize, 4 * features.width) == NULL; + errdec = WebPDecodeRGBAInto(&r[4], size, dst_w, datasize, 4 * features.width) == NULL; } else { - errdec = WebPDecodeRGBInto(&r[4], size, dst_w.ptr(), datasize, 3 * features.width) == NULL; + errdec = WebPDecodeRGBInto(&r[4], size, dst_w, datasize, 3 * features.width) == NULL; } ERR_FAIL_COND_V_MSG(errdec, Ref<Image>(), "Failed decoding WebP image."); - dst_w.release(); - Ref<Image> img = memnew(Image(features.width, features.height, 0, features.has_alpha ? Image::FORMAT_RGBA8 : Image::FORMAT_RGB8, dst_image)); return img; } @@ -123,18 +121,17 @@ Error webp_load_image_from_buffer(Image *p_image, const uint8_t *p_buffer, int p ERR_FAIL_V(ERR_FILE_CORRUPT); } - PoolVector<uint8_t> dst_image; + Vector<uint8_t> dst_image; int datasize = features.width * features.height * (features.has_alpha ? 4 : 3); dst_image.resize(datasize); - PoolVector<uint8_t>::Write dst_w = dst_image.write(); + uint8_t *dst_w = dst_image.ptrw(); bool errdec = false; if (features.has_alpha) { - errdec = WebPDecodeRGBAInto(p_buffer, p_buffer_len, dst_w.ptr(), datasize, 4 * features.width) == NULL; + errdec = WebPDecodeRGBAInto(p_buffer, p_buffer_len, dst_w, datasize, 4 * features.width) == NULL; } else { - errdec = WebPDecodeRGBInto(p_buffer, p_buffer_len, dst_w.ptr(), datasize, 3 * features.width) == NULL; + errdec = WebPDecodeRGBInto(p_buffer, p_buffer_len, dst_w, datasize, 3 * features.width) == NULL; } - dst_w.release(); ERR_FAIL_COND_V_MSG(errdec, ERR_FILE_CORRUPT, "Failed decoding WebP image."); @@ -154,18 +151,18 @@ static Ref<Image> _webp_mem_loader_func(const uint8_t *p_png, int p_size) { Error ImageLoaderWEBP::load_image(Ref<Image> p_image, FileAccess *f, bool p_force_linear, float p_scale) { - PoolVector<uint8_t> src_image; + Vector<uint8_t> src_image; int src_image_len = f->get_len(); ERR_FAIL_COND_V(src_image_len == 0, ERR_FILE_CORRUPT); src_image.resize(src_image_len); - PoolVector<uint8_t>::Write w = src_image.write(); + uint8_t *w = src_image.ptrw(); f->get_buffer(&w[0], src_image_len); f->close(); - Error err = webp_load_image_from_buffer(p_image.ptr(), w.ptr(), src_image_len); + Error err = webp_load_image_from_buffer(p_image.ptr(), w, src_image_len); return err; } diff --git a/modules/websocket/emws_peer.cpp b/modules/websocket/emws_peer.cpp index 588f38cffd..f396a1c812 100644 --- a/modules/websocket/emws_peer.cpp +++ b/modules/websocket/emws_peer.cpp @@ -90,7 +90,7 @@ Error EMWSPeer::get_packet(const uint8_t **r_buffer, int &r_buffer_size) { if (_in_buffer.packets_left() == 0) return ERR_UNAVAILABLE; - PoolVector<uint8_t>::Write rw = _packet_buffer.write(); + uint8_t *rw = _packet_buffer.ptrw(); int read = 0; Error err = _in_buffer.read_packet(rw.ptr(), _packet_buffer.size(), &_is_string, read); ERR_FAIL_COND_V(err != OK, err); diff --git a/modules/websocket/emws_peer.h b/modules/websocket/emws_peer.h index 43b42f9be6..6308ebe490 100644 --- a/modules/websocket/emws_peer.h +++ b/modules/websocket/emws_peer.h @@ -48,7 +48,7 @@ private: int peer_sock; WriteMode write_mode; - PoolVector<uint8_t> _packet_buffer; + Vector<uint8_t> _packet_buffer; PacketBuffer<uint8_t> _in_buffer; uint8_t _is_string; diff --git a/modules/websocket/emws_server.cpp b/modules/websocket/emws_server.cpp index 23faa05365..8ceefa42b6 100644 --- a/modules/websocket/emws_server.cpp +++ b/modules/websocket/emws_server.cpp @@ -53,8 +53,8 @@ Ref<WebSocketPeer> EMWSServer::get_peer(int p_id) const { return NULL; } -PoolVector<String> EMWSServer::get_protocols() const { - PoolVector<String> out; +Vector<String> EMWSServer::get_protocols() const { + Vector<String> out; return out; } diff --git a/modules/websocket/emws_server.h b/modules/websocket/emws_server.h index 869e59fe03..f273fd078f 100644 --- a/modules/websocket/emws_server.h +++ b/modules/websocket/emws_server.h @@ -53,7 +53,7 @@ public: void disconnect_peer(int p_peer_id, int p_code = 1000, String p_reason = ""); int get_max_packet_size() const; virtual void poll(); - virtual PoolVector<String> get_protocols() const; + virtual Vector<String> get_protocols() const; EMWSServer(); ~EMWSServer(); diff --git a/modules/websocket/websocket_multiplayer_peer.cpp b/modules/websocket/websocket_multiplayer_peer.cpp index 27ea50b524..5c01d44ede 100644 --- a/modules/websocket/websocket_multiplayer_peer.cpp +++ b/modules/websocket/websocket_multiplayer_peer.cpp @@ -127,12 +127,12 @@ Error WebSocketMultiplayerPeer::put_packet(const uint8_t *p_buffer, int p_buffer ERR_FAIL_COND_V_MSG(!_is_multiplayer, ERR_UNCONFIGURED, "Please use get_peer(ID).put_packet/var to communicate with peers when not using the MultiplayerAPI."); - PoolVector<uint8_t> buffer = _make_pkt(SYS_NONE, get_unique_id(), _target_peer, p_buffer, p_buffer_size); + Vector<uint8_t> buffer = _make_pkt(SYS_NONE, get_unique_id(), _target_peer, p_buffer, p_buffer_size); if (is_server()) { - return _server_relay(1, _target_peer, &(buffer.read()[0]), buffer.size()); + return _server_relay(1, _target_peer, &(buffer.ptr()[0]), buffer.size()); } else { - return get_peer(1)->put_packet(&(buffer.read()[0]), buffer.size()); + return get_peer(1)->put_packet(&(buffer.ptr()[0]), buffer.size()); } } @@ -183,16 +183,16 @@ void WebSocketMultiplayerPeer::_send_sys(Ref<WebSocketPeer> p_peer, uint8_t p_ty ERR_FAIL_COND(!p_peer.is_valid()); ERR_FAIL_COND(!p_peer->is_connected_to_host()); - PoolVector<uint8_t> message = _make_pkt(p_type, 1, 0, (uint8_t *)&p_peer_id, 4); - p_peer->put_packet(&(message.read()[0]), message.size()); + Vector<uint8_t> message = _make_pkt(p_type, 1, 0, (uint8_t *)&p_peer_id, 4); + p_peer->put_packet(&(message.ptr()[0]), message.size()); } -PoolVector<uint8_t> WebSocketMultiplayerPeer::_make_pkt(uint8_t p_type, int32_t p_from, int32_t p_to, const uint8_t *p_data, uint32_t p_data_size) { +Vector<uint8_t> WebSocketMultiplayerPeer::_make_pkt(uint8_t p_type, int32_t p_from, int32_t p_to, const uint8_t *p_data, uint32_t p_data_size) { - PoolVector<uint8_t> out; + Vector<uint8_t> out; out.resize(PROTO_SIZE + p_data_size); - PoolVector<uint8_t>::Write w = out.write(); + uint8_t *w = out.ptrw(); copymem(&w[0], &p_type, 1); copymem(&w[1], &p_from, 4); copymem(&w[5], &p_to, 4); diff --git a/modules/websocket/websocket_multiplayer_peer.h b/modules/websocket/websocket_multiplayer_peer.h index 27cb6e4eb7..579972ada2 100644 --- a/modules/websocket/websocket_multiplayer_peer.h +++ b/modules/websocket/websocket_multiplayer_peer.h @@ -41,7 +41,7 @@ class WebSocketMultiplayerPeer : public NetworkedMultiplayerPeer { GDCLASS(WebSocketMultiplayerPeer, NetworkedMultiplayerPeer); private: - PoolVector<uint8_t> _make_pkt(uint8_t p_type, int32_t p_from, int32_t p_to, const uint8_t *p_data, uint32_t p_data_size); + Vector<uint8_t> _make_pkt(uint8_t p_type, int32_t p_from, int32_t p_to, const uint8_t *p_data, uint32_t p_data_size); void _store_pkt(int32_t p_source, int32_t p_dest, const uint8_t *p_data, uint32_t p_data_size); Error _server_relay(int32_t p_from, int32_t p_to, const uint8_t *p_buffer, uint32_t p_buffer_size); diff --git a/modules/websocket/wsl_peer.cpp b/modules/websocket/wsl_peer.cpp index 08079145e4..ff32e83dc1 100644 --- a/modules/websocket/wsl_peer.cpp +++ b/modules/websocket/wsl_peer.cpp @@ -43,10 +43,10 @@ String WSLPeer::generate_key() { // Random key RandomNumberGenerator rng; rng.set_seed(OS::get_singleton()->get_unix_time()); - PoolVector<uint8_t> bkey; + Vector<uint8_t> bkey; int len = 16; // 16 bytes, as per RFC bkey.resize(len); - PoolVector<uint8_t>::Write w = bkey.write(); + uint8_t *w = bkey.ptrw(); for (int i = 0; i < len; i++) { w[i] = (uint8_t)rng.randi_range(0, 255); } @@ -260,10 +260,10 @@ Error WSLPeer::get_packet(const uint8_t **r_buffer, int &r_buffer_size) { return ERR_UNAVAILABLE; int read = 0; - PoolVector<uint8_t>::Write rw = _packet_buffer.write(); - _in_buffer.read_packet(rw.ptr(), _packet_buffer.size(), &_is_string, read); + uint8_t *rw = _packet_buffer.ptrw(); + _in_buffer.read_packet(rw, _packet_buffer.size(), &_is_string, read); - *r_buffer = rw.ptr(); + *r_buffer = rw; r_buffer_size = read; return OK; diff --git a/modules/websocket/wsl_peer.h b/modules/websocket/wsl_peer.h index f1c45ee859..00549cd9bc 100644 --- a/modules/websocket/wsl_peer.h +++ b/modules/websocket/wsl_peer.h @@ -86,7 +86,7 @@ private: // Our packet info is just a boolean (is_string), using uint8_t for it. PacketBuffer<uint8_t> _in_buffer; - PoolVector<uint8_t> _packet_buffer; + Vector<uint8_t> _packet_buffer; WriteMode write_mode; |