summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/arkit/arkit_interface.h2
-rw-r--r--modules/arkit/arkit_interface.mm4
-rw-r--r--modules/assimp/editor_scene_importer_assimp.cpp38
-rw-r--r--modules/assimp/import_utils.h14
-rw-r--r--modules/basis_universal/register_types.cpp39
-rw-r--r--modules/basis_universal/texture_basisu.cpp20
-rw-r--r--modules/basis_universal/texture_basisu.h6
-rw-r--r--modules/bmp/image_loader_bmp.cpp38
-rw-r--r--modules/bullet/area_bullet.cpp2
-rw-r--r--modules/bullet/rigid_body_bullet.cpp2
-rw-r--r--modules/bullet/shape_bullet.cpp34
-rw-r--r--modules/bullet/shape_bullet.h12
-rw-r--r--modules/bullet/soft_body_bullet.cpp14
-rw-r--r--modules/bullet/soft_body_bullet.h2
-rw-r--r--modules/bullet/space_bullet.cpp3
-rw-r--r--modules/camera/camera_ios.mm6
-rw-r--r--modules/camera/camera_osx.mm10
-rw-r--r--modules/csg/csg.cpp12
-rw-r--r--modules/csg/csg.h4
-rw-r--r--modules/csg/csg_gizmos.cpp4
-rw-r--r--modules/csg/csg_shape.cpp226
-rw-r--r--modules/csg/csg_shape.h22
-rw-r--r--modules/csg/doc_classes/CSGPolygon.xml2
-rw-r--r--modules/cvtt/image_compress_cvtt.cpp25
-rw-r--r--modules/dds/texture_loader_dds.cpp14
-rw-r--r--modules/enet/doc_classes/NetworkedMultiplayerENet.xml25
-rw-r--r--modules/enet/networked_multiplayer_enet.cpp50
-rw-r--r--modules/enet/networked_multiplayer_enet.h12
-rw-r--r--modules/etc/image_etc.cpp8
-rw-r--r--modules/etc/texture_loader_pkm.cpp7
-rw-r--r--modules/gdnative/arvr/arvr_interface_gdnative.h4
-rw-r--r--modules/gdnative/doc_classes/GDNative.xml4
-rw-r--r--modules/gdnative/doc_classes/GDNativeLibrary.xml2
-rw-r--r--modules/gdnative/doc_classes/NativeScript.xml6
-rw-r--r--modules/gdnative/gdnative/array.cpp29
-rw-r--r--modules/gdnative/gdnative/gdnative.cpp2
-rw-r--r--modules/gdnative/gdnative/pool_arrays.cpp822
-rw-r--r--modules/gdnative/gdnative/string.cpp30
-rw-r--r--modules/gdnative/gdnative/variant.cpp86
-rw-r--r--modules/gdnative/gdnative_api.json1042
-rw-r--r--modules/gdnative/gdnative_library_editor_plugin.cpp16
-rw-r--r--modules/gdnative/gdnative_library_editor_plugin.h2
-rw-r--r--modules/gdnative/gdnative_library_singleton_editor.cpp4
-rw-r--r--modules/gdnative/include/gdnative/array.h14
-rw-r--r--modules/gdnative/include/gdnative/pool_arrays.h432
-rw-r--r--modules/gdnative/include/gdnative/string.h6
-rw-r--r--modules/gdnative/include/gdnative/variant.h54
-rw-r--r--modules/gdnative/include/pluginscript/godot_pluginscript.h10
-rw-r--r--modules/gdnative/include/videodecoder/godot_videodecoder.h2
-rw-r--r--modules/gdnative/nativescript/nativescript.cpp32
-rw-r--r--modules/gdnative/nativescript/nativescript.h6
-rw-r--r--modules/gdnative/pluginscript/pluginscript_instance.cpp2
-rw-r--r--modules/gdnative/pluginscript/pluginscript_instance.h2
-rw-r--r--modules/gdnative/pluginscript/pluginscript_language.cpp20
-rw-r--r--modules/gdnative/pluginscript/pluginscript_language.h2
-rw-r--r--modules/gdnative/pluginscript/pluginscript_script.cpp24
-rw-r--r--modules/gdnative/pluginscript/pluginscript_script.h4
-rw-r--r--modules/gdnative/register_types.cpp2
-rw-r--r--modules/gdnative/videodecoder/video_stream_gdnative.cpp2
-rw-r--r--modules/gdnavigation/gd_navigation_server.cpp59
-rw-r--r--modules/gdnavigation/gd_navigation_server.h9
-rw-r--r--modules/gdnavigation/nav_map.cpp145
-rw-r--r--modules/gdnavigation/nav_map.h4
-rw-r--r--modules/gdnavigation/nav_region.cpp4
-rw-r--r--modules/gdnavigation/navigation_mesh_editor_plugin.cpp4
-rw-r--r--modules/gdnavigation/navigation_mesh_generator.cpp18
-rw-r--r--modules/gdnavigation/navigation_mesh_generator.h2
-rw-r--r--modules/gdnavigation/rvo_agent.cpp2
-rw-r--r--modules/gdscript/doc_classes/@GDScript.xml4
-rw-r--r--modules/gdscript/doc_classes/GDScript.xml2
-rw-r--r--modules/gdscript/gdscript.cpp67
-rw-r--r--modules/gdscript/gdscript.h11
-rw-r--r--modules/gdscript/gdscript_compiler.cpp4
-rw-r--r--modules/gdscript/gdscript_editor.cpp46
-rw-r--r--modules/gdscript/gdscript_function.cpp87
-rw-r--r--modules/gdscript/gdscript_function.h8
-rw-r--r--modules/gdscript/gdscript_functions.cpp380
-rw-r--r--modules/gdscript/gdscript_functions.h2
-rw-r--r--modules/gdscript/gdscript_parser.cpp128
-rw-r--r--modules/gdscript/gdscript_tokenizer.cpp38
-rw-r--r--modules/gdscript/language_server/gdscript_language_protocol.cpp201
-rw-r--r--modules/gdscript/language_server/gdscript_language_protocol.h40
-rw-r--r--modules/gdscript/language_server/gdscript_workspace.cpp49
-rw-r--r--modules/gdscript/language_server/gdscript_workspace.h5
-rw-r--r--modules/glslang/SCsub6
-rw-r--r--modules/glslang/register_types.cpp8
-rw-r--r--modules/gridmap/grid_map.cpp12
-rw-r--r--modules/gridmap/grid_map_editor_plugin.cpp36
-rw-r--r--modules/hdr/image_loader_hdr.cpp6
-rw-r--r--modules/jpg/image_loader_jpegd.cpp13
-rw-r--r--modules/mbedtls/crypto_mbedtls.cpp32
-rw-r--r--modules/mbedtls/crypto_mbedtls.h2
-rw-r--r--modules/mbedtls/dtls_server_mbedtls.cpp78
-rw-r--r--modules/mbedtls/dtls_server_mbedtls.h58
-rwxr-xr-xmodules/mbedtls/packet_peer_mbed_dtls.cpp297
-rwxr-xr-xmodules/mbedtls/packet_peer_mbed_dtls.h88
-rwxr-xr-xmodules/mbedtls/register_types.cpp6
-rw-r--r--modules/mbedtls/ssl_context_mbedtls.cpp61
-rw-r--r--modules/mbedtls/ssl_context_mbedtls.h30
-rwxr-xr-xmodules/mbedtls/stream_peer_mbedtls.cpp13
-rw-r--r--modules/mobile_vr/mobile_vr_interface.cpp14
-rw-r--r--modules/mono/build_scripts/make_android_mono_config.py6
-rw-r--r--modules/mono/csharp_script.cpp44
-rw-r--r--modules/mono/csharp_script.h10
-rw-r--r--modules/mono/doc_classes/@C#.xml2
-rw-r--r--modules/mono/doc_classes/CSharpScript.xml4
-rw-r--r--modules/mono/doc_classes/GodotSharp.xml2
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/BottomPanel.cs2
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Build/MsBuildFinder.cs7
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/BuildManager.cs23
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/BuildTab.cs2
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathLocator.cs78
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathManager.cs28
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Internals/Internal.cs4
-rw-r--r--modules/mono/editor/bindings_generator.cpp54
-rw-r--r--modules/mono/editor/editor_internal_calls.cpp14
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/StringExtensions.cs4
-rw-r--r--modules/mono/glue/base_object_glue.cpp11
-rw-r--r--modules/mono/glue/gd_glue.cpp20
-rw-r--r--modules/mono/mono_gd/gd_mono_field.cpp44
-rw-r--r--modules/mono/mono_gd/gd_mono_marshal.cpp146
-rw-r--r--modules/mono/mono_gd/gd_mono_marshal.h42
-rw-r--r--modules/mono/mono_gd/gd_mono_utils.cpp2
-rw-r--r--modules/mono/signal_awaiter_utils.cpp8
-rw-r--r--modules/mono/signal_awaiter_utils.h2
-rw-r--r--modules/mono/utils/string_utils.cpp8
-rw-r--r--modules/opensimplex/noise_texture.cpp6
-rw-r--r--modules/opensimplex/open_simplex_noise.cpp14
-rw-r--r--modules/pvr/texture_loader_pvr.cpp25
-rw-r--r--modules/squish/image_compress_squish.cpp15
-rw-r--r--modules/stb_vorbis/audio_stream_ogg_vorbis.cpp30
-rw-r--r--modules/stb_vorbis/audio_stream_ogg_vorbis.h4
-rw-r--r--modules/stb_vorbis/doc_classes/AudioStreamOGGVorbis.xml2
-rw-r--r--modules/stb_vorbis/resource_importer_ogg_vorbis.cpp8
-rw-r--r--modules/svg/image_loader_svg.cpp27
-rw-r--r--modules/svg/image_loader_svg.h2
-rw-r--r--modules/tga/image_loader_tga.cpp42
-rw-r--r--modules/theora/video_stream_theora.cpp4
-rw-r--r--modules/theora/video_stream_theora.h2
-rw-r--r--modules/tinyexr/image_loader_tinyexr.cpp18
-rw-r--r--modules/tinyexr/image_saver_tinyexr.cpp24
-rw-r--r--modules/visual_script/doc_classes/VisualScript.xml90
-rw-r--r--modules/visual_script/doc_classes/VisualScriptBasicTypeConstant.xml2
-rw-r--r--modules/visual_script/doc_classes/VisualScriptBuiltinFunc.xml4
-rw-r--r--modules/visual_script/doc_classes/VisualScriptClassConstant.xml4
-rw-r--r--modules/visual_script/doc_classes/VisualScriptEmitSignal.xml2
-rw-r--r--modules/visual_script/doc_classes/VisualScriptFunctionCall.xml6
-rw-r--r--modules/visual_script/doc_classes/VisualScriptInputAction.xml2
-rw-r--r--modules/visual_script/doc_classes/VisualScriptLocalVar.xml2
-rw-r--r--modules/visual_script/doc_classes/VisualScriptLocalVarSet.xml2
-rw-r--r--modules/visual_script/doc_classes/VisualScriptPropertyGet.xml6
-rw-r--r--modules/visual_script/doc_classes/VisualScriptPropertySet.xml6
-rw-r--r--modules/visual_script/doc_classes/VisualScriptTypeCast.xml2
-rw-r--r--modules/visual_script/doc_classes/VisualScriptVariableGet.xml2
-rw-r--r--modules/visual_script/doc_classes/VisualScriptVariableSet.xml2
-rw-r--r--modules/visual_script/doc_classes/VisualScriptYieldSignal.xml4
-rw-r--r--modules/visual_script/visual_script.cpp86
-rw-r--r--modules/visual_script/visual_script.h12
-rw-r--r--modules/visual_script/visual_script_builtin_funcs.cpp168
-rw-r--r--modules/visual_script/visual_script_builtin_funcs.h2
-rw-r--r--modules/visual_script/visual_script_editor.cpp194
-rw-r--r--modules/visual_script/visual_script_editor.h2
-rw-r--r--modules/visual_script/visual_script_expression.cpp18
-rw-r--r--modules/visual_script/visual_script_flow_control.cpp26
-rw-r--r--modules/visual_script/visual_script_func_nodes.cpp50
-rw-r--r--modules/visual_script/visual_script_nodes.cpp100
-rw-r--r--modules/visual_script/visual_script_property_selector.cpp34
-rw-r--r--modules/visual_script/visual_script_yield_nodes.cpp14
-rw-r--r--modules/webm/video_stream_webm.cpp10
-rw-r--r--modules/webm/video_stream_webm.h2
-rw-r--r--modules/webp/image_loader_webp.cpp49
-rw-r--r--modules/websocket/doc_classes/WebSocketClient.xml4
-rw-r--r--modules/websocket/doc_classes/WebSocketServer.xml2
-rw-r--r--modules/websocket/emws_peer.cpp2
-rw-r--r--modules/websocket/emws_peer.h2
-rw-r--r--modules/websocket/emws_server.cpp4
-rw-r--r--modules/websocket/emws_server.h2
-rw-r--r--modules/websocket/websocket_multiplayer_peer.cpp16
-rw-r--r--modules/websocket/websocket_multiplayer_peer.h2
-rw-r--r--modules/websocket/wsl_peer.cpp10
-rw-r--r--modules/websocket/wsl_peer.h2
181 files changed, 3626 insertions, 3512 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..1881d0db33 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);
+ PackedFloat32Array 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..062b5b59f8 100644
--- a/modules/basis_universal/register_types.cpp
+++ b/modules/basis_universal/register_types.cpp
@@ -52,11 +52,10 @@ 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) {
-
- PoolVector<uint8_t> budata;
-
#ifdef TOOLS_ENABLED
+static Vector<uint8_t> basis_universal_packer(const Ref<Image> &p_image, Image::UsedChannels p_channels) {
+
+ Vector<uint8_t> budata;
{
Ref<Image> image = p_image->duplicate();
@@ -74,10 +73,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");
@@ -117,14 +116,10 @@ static PoolVector<uint8_t> basis_universal_packer(const Ref<Image> &p_image, Ima
#ifdef USE_RG_AS_RGBA
image->convert_rg_to_ra_rgba8();
decompress_format = BASIS_DECOMPRESS_RG_AS_RA;
-
#else
-
params.m_seperate_rg_to_color_alpha = true;
decompress_format = BASIS_DECOMPRESS_RG;
-
#endif
-
} break;
case Image::USED_CHANNELS_RGB: {
decompress_format = BASIS_DECOMPRESS_RGB;
@@ -145,22 +140,22 @@ 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());
}
}
-#endif
return budata;
}
+#endif // TOOLS_ENABLED
-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 +236,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;
@@ -286,7 +281,7 @@ void unregister_basis_universal_types() {
#ifdef TOOLS_ENABLED
delete sel_codebook;
-#endif
Image::basis_universal_packer = NULL;
+#endif
Image::basis_universal_unpacker = NULL;
}
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/area_bullet.cpp b/modules/bullet/area_bullet.cpp
index 7806145390..e8a5c1475a 100644
--- a/modules/bullet/area_bullet.cpp
+++ b/modules/bullet/area_bullet.cpp
@@ -117,7 +117,7 @@ void AreaBullet::call_event(CollisionObjectBullet *p_otherObject, PhysicsServer:
call_event_res[3] = 0; // other_body_shape ID
call_event_res[4] = 0; // self_shape ID
- Variant::CallError outResp;
+ Callable::CallError outResp;
areaGodoObject->call(event.event_callback_method, (const Variant **)call_event_res_ptr, 5, outResp);
}
diff --git a/modules/bullet/rigid_body_bullet.cpp b/modules/bullet/rigid_body_bullet.cpp
index e5804fbde8..d33c3a748c 100644
--- a/modules/bullet/rigid_body_bullet.cpp
+++ b/modules/bullet/rigid_body_bullet.cpp
@@ -370,7 +370,7 @@ void RigidBodyBullet::dispatch_callbacks() {
} else {
const Variant *vp[2] = { &variantBodyDirect, &force_integration_callback->udata };
- Variant::CallError responseCallError;
+ Callable::CallError responseCallError;
int argc = (force_integration_callback->udata.get_type() == Variant::NIL) ? 1 : 2;
obj->call(force_integration_callback->method, vp, argc, responseCallError);
}
diff --git a/modules/bullet/shape_bullet.cpp b/modules/bullet/shape_bullet.cpp
index f46db09e4a..6780f89d9e 100644
--- a/modules/bullet/shape_bullet.cpp
+++ b/modules/bullet/shape_bullet.cpp
@@ -122,8 +122,8 @@ btBoxShape *ShapeBullet::create_shape_box(const btVector3 &boxHalfExtents) {
return bulletnew(btBoxShape(boxHalfExtents));
}
-btCapsuleShapeZ *ShapeBullet::create_shape_capsule(btScalar radius, btScalar height) {
- return bulletnew(btCapsuleShapeZ(radius, height));
+btCapsuleShape *ShapeBullet::create_shape_capsule(btScalar radius, btScalar height) {
+ return bulletnew(btCapsuleShape(radius, height));
}
btCylinderShape *ShapeBullet::create_shape_cylinder(btScalar radius, btScalar height) {
@@ -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_FLOAT32_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 PackedFloat32Array 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..c8b5ca102a 100644
--- a/modules/bullet/shape_bullet.h
+++ b/modules/bullet/shape_bullet.h
@@ -85,12 +85,12 @@ public:
static class btStaticPlaneShape *create_shape_plane(const btVector3 &planeNormal, btScalar planeConstant);
static class btSphereShape *create_shape_sphere(btScalar radius);
static class btBoxShape *create_shape_box(const btVector3 &boxHalfExtents);
- static class btCapsuleShapeZ *create_shape_capsule(btScalar radius, btScalar height);
+ static class btCapsuleShape *create_shape_capsule(btScalar radius, btScalar height);
static class btCylinderShape *create_shape_cylinder(btScalar radius, btScalar height);
/// 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/bullet/space_bullet.cpp b/modules/bullet/space_bullet.cpp
index 0e4c4b4731..f6df97f11d 100644
--- a/modules/bullet/space_bullet.cpp
+++ b/modules/bullet/space_bullet.cpp
@@ -726,9 +726,6 @@ void SpaceBullet::check_ghost_overlaps() {
other_body_shape = static_cast<btCollisionShape *>(otherObject->get_bt_shape(z));
- if (other_body_shape->isConcave())
- continue;
-
btTransform other_shape_transform(otherObject->get_bt_shape_transform(z));
other_shape_transform.getOrigin() *= other_body_scale;
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..d017afd792 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) {
@@ -627,7 +621,7 @@ void CSGShape::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_meshes"), &CSGShape::get_meshes);
ADD_PROPERTY(PropertyInfo(Variant::INT, "operation", PROPERTY_HINT_ENUM, "Union,Intersection,Subtraction"), "set_operation", "get_operation");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "snap", PROPERTY_HINT_RANGE, "0.0001,1,0.001"), "set_snap", "get_snap");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "snap", PROPERTY_HINT_RANGE, "0.0001,1,0.001"), "set_snap", "get_snap");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "calculate_tangents"), "set_calculate_tangents", "is_calculating_tangents");
ADD_GROUP("Collision", "collision_");
@@ -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) {
@@ -904,12 +898,12 @@ void CSGMesh::set_mesh(const Ref<Mesh> &p_mesh) {
if (mesh == p_mesh)
return;
if (mesh.is_valid()) {
- mesh->disconnect("changed", this, "_mesh_changed");
+ mesh->disconnect_compat("changed", this, "_mesh_changed");
}
mesh = p_mesh;
if (mesh.is_valid()) {
- mesh->connect("changed", this, "_mesh_changed");
+ mesh->connect_compat("changed", this, "_mesh_changed");
}
_make_dirty();
@@ -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;
@@ -1055,7 +1049,7 @@ void CSGSphere::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_material", "material"), &CSGSphere::set_material);
ClassDB::bind_method(D_METHOD("get_material"), &CSGSphere::get_material);
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "radius", PROPERTY_HINT_RANGE, "0.001,100.0,0.001"), "set_radius", "get_radius");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "radius", PROPERTY_HINT_RANGE, "0.001,100.0,0.001"), "set_radius", "get_radius");
ADD_PROPERTY(PropertyInfo(Variant::INT, "radial_segments", PROPERTY_HINT_RANGE, "1,100,1"), "set_radial_segments", "get_radial_segments");
ADD_PROPERTY(PropertyInfo(Variant::INT, "rings", PROPERTY_HINT_RANGE, "1,100,1"), "set_rings", "get_rings");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "smooth_faces"), "set_smooth_faces", "get_smooth_faces");
@@ -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;
@@ -1242,9 +1236,9 @@ void CSGBox::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_material", "material"), &CSGBox::set_material);
ClassDB::bind_method(D_METHOD("get_material"), &CSGBox::get_material);
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "width", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_width", "get_width");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "height", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_height", "get_height");
- 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::FLOAT, "width", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_width", "get_width");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "height", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_height", "get_height");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "depth", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_depth", "get_depth");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "material", PROPERTY_HINT_RESOURCE_TYPE, "StandardMaterial3D,ShaderMaterial"), "set_material", "get_material");
}
@@ -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;
@@ -1457,8 +1451,8 @@ void CSGCylinder::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_smooth_faces", "smooth_faces"), &CSGCylinder::set_smooth_faces);
ClassDB::bind_method(D_METHOD("get_smooth_faces"), &CSGCylinder::get_smooth_faces);
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "radius", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_radius", "get_radius");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "height", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_height", "get_height");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "radius", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_radius", "get_radius");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "height", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_height", "get_height");
ADD_PROPERTY(PropertyInfo(Variant::INT, "sides", PROPERTY_HINT_RANGE, "3,64,1"), "set_sides", "get_sides");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "cone"), "set_cone", "is_cone");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "smooth_faces"), "set_smooth_faces", "get_smooth_faces");
@@ -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;
@@ -1684,8 +1678,8 @@ void CSGTorus::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_smooth_faces", "smooth_faces"), &CSGTorus::set_smooth_faces);
ClassDB::bind_method(D_METHOD("get_smooth_faces"), &CSGTorus::get_smooth_faces);
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "inner_radius", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_inner_radius", "get_inner_radius");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "outer_radius", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_outer_radius", "get_outer_radius");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "inner_radius", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_inner_radius", "get_inner_radius");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "outer_radius", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_outer_radius", "get_outer_radius");
ADD_PROPERTY(PropertyInfo(Variant::INT, "sides", PROPERTY_HINT_RANGE, "3,64,1"), "set_sides", "get_sides");
ADD_PROPERTY(PropertyInfo(Variant::INT, "ring_sides", PROPERTY_HINT_RANGE, "3,64,1"), "set_ring_sides", "get_ring_sides");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "smooth_faces"), "set_smooth_faces", "get_smooth_faces");
@@ -1818,15 +1812,15 @@ CSGBrush *CSGPolygon::_build_brush() {
if (path != path_cache) {
if (path_cache) {
- path_cache->disconnect("tree_exited", this, "_path_exited");
- path_cache->disconnect("curve_changed", this, "_path_changed");
+ path_cache->disconnect_compat("tree_exited", this, "_path_exited");
+ path_cache->disconnect_compat("curve_changed", this, "_path_changed");
path_cache = NULL;
}
path_cache = path;
- path_cache->connect("tree_exited", this, "_path_exited");
- path_cache->connect("curve_changed", this, "_path_changed");
+ path_cache->connect_compat("tree_exited", this, "_path_exited");
+ path_cache->connect_compat("curve_changed", this, "_path_changed");
path_cache = NULL;
}
curve = path->get_curve();
@@ -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;
@@ -2242,8 +2236,8 @@ CSGBrush *CSGPolygon::_build_brush() {
void CSGPolygon::_notification(int p_what) {
if (p_what == NOTIFICATION_EXIT_TREE) {
if (path_cache) {
- path_cache->disconnect("tree_exited", this, "_path_exited");
- path_cache->disconnect("curve_changed", this, "_path_changed");
+ path_cache->disconnect_compat("tree_exited", this, "_path_exited");
+ path_cache->disconnect_compat("curve_changed", this, "_path_changed");
path_cache = NULL;
}
}
@@ -2318,13 +2312,13 @@ 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");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "depth", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_depth", "get_depth");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "spin_degrees", PROPERTY_HINT_RANGE, "1,360,0.1"), "set_spin_degrees", "get_spin_degrees");
ADD_PROPERTY(PropertyInfo(Variant::INT, "spin_sides", PROPERTY_HINT_RANGE, "3,64,1"), "set_spin_sides", "get_spin_sides");
ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "path_node", PROPERTY_HINT_NODE_PATH_VALID_TYPES, "Path"), "set_path_node", "get_path_node");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "path_interval", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_path_interval", "get_path_interval");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "path_interval", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_path_interval", "get_path_interval");
ADD_PROPERTY(PropertyInfo(Variant::INT, "path_rotation", PROPERTY_HINT_ENUM, "Polygon,Path,PathFollow"), "set_path_rotation", "get_path_rotation");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "path_local"), "set_path_local", "is_path_local");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "path_continuous_u"), "set_path_continuous_u", "is_path_continuous_u");
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/csg/doc_classes/CSGPolygon.xml b/modules/csg/doc_classes/CSGPolygon.xml
index 64ae46c69a..02b2e8b03f 100644
--- a/modules/csg/doc_classes/CSGPolygon.xml
+++ b/modules/csg/doc_classes/CSGPolygon.xml
@@ -38,7 +38,7 @@
<member name="path_rotation" type="int" setter="set_path_rotation" getter="get_path_rotation" enum="CSGPolygon.PathRotation">
The method by which each slice is rotated along the path when [member mode] is [constant MODE_PATH].
</member>
- <member name="polygon" type="PoolVector2Array" setter="set_polygon" getter="get_polygon" default="PoolVector2Array( 0, 0, 0, 1, 1, 1, 1, 0 )">
+ <member name="polygon" type="PackedVector2Array" setter="set_polygon" getter="get_polygon" default="PackedVector2Array( 0, 0, 0, 1, 1, 1, 1, 0 )">
Point array that defines the shape that we'll extrude.
</member>
<member name="smooth_faces" type="bool" setter="set_smooth_faces" getter="get_smooth_faces" default="false">
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/enet/doc_classes/NetworkedMultiplayerENet.xml b/modules/enet/doc_classes/NetworkedMultiplayerENet.xml
index 76b3710e96..456bf649d2 100644
--- a/modules/enet/doc_classes/NetworkedMultiplayerENet.xml
+++ b/modules/enet/doc_classes/NetworkedMultiplayerENet.xml
@@ -104,6 +104,24 @@
The IP used when creating a server. This is set to the wildcard [code]"*"[/code] by default, which binds to all available interfaces. The given IP needs to be in IPv4 or IPv6 address format, for example: [code]"192.168.1.1"[/code].
</description>
</method>
+ <method name="set_dtls_certificate">
+ <return type="void">
+ </return>
+ <argument index="0" name="certificate" type="X509Certificate">
+ </argument>
+ <description>
+ Configure the [X509Certificate] to use when [member use_dtls] is [code]true[/code]. For servers, you must also setup the [CryptoKey] via [method set_dtls_key].
+ </description>
+ </method>
+ <method name="set_dtls_key">
+ <return type="void">
+ </return>
+ <argument index="0" name="key" type="CryptoKey">
+ </argument>
+ <description>
+ Configure the [CryptoKey] to use when [member use_dtls] is [code]true[/code]. Remember to also call [method set_dtls_certificate] to setup your [X509Certificate].
+ </description>
+ </method>
</methods>
<members>
<member name="always_ordered" type="bool" setter="set_always_ordered" getter="is_always_ordered" default="false">
@@ -115,6 +133,9 @@
<member name="compression_mode" type="int" setter="set_compression_mode" getter="get_compression_mode" enum="NetworkedMultiplayerENet.CompressionMode" default="0">
The compression method used for network packets. These have different tradeoffs of compression speed versus bandwidth, you may need to test which one works best for your use case if you use compression at all.
</member>
+ <member name="dtls_verify" type="bool" setter="set_dtls_verify_enabled" getter="is_dtls_verify_enabled" default="true">
+ Enable or disable certiticate verification when [member use_dtls] [code]true[/code].
+ </member>
<member name="refuse_new_connections" type="bool" setter="set_refuse_new_connections" getter="is_refusing_new_connections" override="true" default="false" />
<member name="server_relay" type="bool" setter="set_server_relay_enabled" getter="is_server_relay_enabled" default="true">
Enable or disable the server feature that notifies clients of other peers' connection/disconnection, and relays messages between them. When this option is [code]false[/code], clients won't be automatically notified of other peers and won't be able to send them packets through the server.
@@ -123,6 +144,10 @@
Set the default channel to be used to transfer data. By default, this value is [code]-1[/code] which means that ENet will only use 2 channels, one for reliable and one for unreliable packets. Channel [code]0[/code] is reserved, and cannot be used. Setting this member to any value between [code]0[/code] and [member channel_count] (excluded) will force ENet to use that channel for sending data.
</member>
<member name="transfer_mode" type="int" setter="set_transfer_mode" getter="get_transfer_mode" override="true" enum="NetworkedMultiplayerPeer.TransferMode" default="2" />
+ <member name="use_dtls" type="bool" setter="set_dtls_enabled" getter="is_dtls_enabled" default="false">
+ When enabled, the client or server created by this peer, will use [PacketPeerDTLS] instead of raw UDP sockets for communicating with the remote peer. This will make the communication encrypted with DTLS at the cost of higher resource usage and potentially larger packet size.
+ Note: When creating a DTLS server, make sure you setup the key/certificate pair via [method set_dtls_key] and [method set_dtls_certificate]. For DTLS clients, have a look at the [member dtls_verify] option, and configure the certificate accordingly via [method set_dtls_certificate].
+ </member>
</members>
<constants>
<constant name="COMPRESS_NONE" value="0" enum="CompressionMode">
diff --git a/modules/enet/networked_multiplayer_enet.cpp b/modules/enet/networked_multiplayer_enet.cpp
index ca134824f7..406eb467f0 100644
--- a/modules/enet/networked_multiplayer_enet.cpp
+++ b/modules/enet/networked_multiplayer_enet.cpp
@@ -78,6 +78,7 @@ Error NetworkedMultiplayerENet::create_server(int p_port, int p_max_clients, int
ERR_FAIL_COND_V_MSG(p_max_clients < 1 || p_max_clients > 4095, ERR_INVALID_PARAMETER, "The number of clients must be set between 1 and 4095 (inclusive).");
ERR_FAIL_COND_V_MSG(p_in_bandwidth < 0, ERR_INVALID_PARAMETER, "The incoming bandwidth limit must be greater than or equal to 0 (0 disables the limit).");
ERR_FAIL_COND_V_MSG(p_out_bandwidth < 0, ERR_INVALID_PARAMETER, "The outgoing bandwidth limit must be greater than or equal to 0 (0 disables the limit).");
+ ERR_FAIL_COND_V(dtls_enabled && (dtls_key.is_null() || dtls_cert.is_null()), ERR_INVALID_PARAMETER);
ENetAddress address;
memset(&address, 0, sizeof(address));
@@ -105,6 +106,11 @@ Error NetworkedMultiplayerENet::create_server(int p_port, int p_max_clients, int
p_out_bandwidth /* limit outgoing bandwidth if > 0 */);
ERR_FAIL_COND_V_MSG(!host, ERR_CANT_CREATE, "Couldn't create an ENet multiplayer server.");
+#ifdef GODOT_ENET
+ if (dtls_enabled) {
+ enet_host_dtls_server_setup(host, dtls_key.ptr(), dtls_cert.ptr());
+ }
+#endif
_setup_compressor();
active = true;
@@ -156,6 +162,11 @@ Error NetworkedMultiplayerENet::create_client(const String &p_address, int p_por
}
ERR_FAIL_COND_V_MSG(!host, ERR_CANT_CREATE, "Couldn't create the ENet client host.");
+#ifdef GODOT_ENET
+ if (dtls_enabled) {
+ enet_host_dtls_client_setup(host, dtls_cert.ptr(), dtls_verify, p_address.utf8().get_data());
+ }
+#endif
_setup_compressor();
@@ -856,6 +867,12 @@ void NetworkedMultiplayerENet::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_compression_mode", "mode"), &NetworkedMultiplayerENet::set_compression_mode);
ClassDB::bind_method(D_METHOD("get_compression_mode"), &NetworkedMultiplayerENet::get_compression_mode);
ClassDB::bind_method(D_METHOD("set_bind_ip", "ip"), &NetworkedMultiplayerENet::set_bind_ip);
+ ClassDB::bind_method(D_METHOD("set_dtls_enabled", "enabled"), &NetworkedMultiplayerENet::set_dtls_enabled);
+ ClassDB::bind_method(D_METHOD("is_dtls_enabled"), &NetworkedMultiplayerENet::is_dtls_enabled);
+ ClassDB::bind_method(D_METHOD("set_dtls_key", "key"), &NetworkedMultiplayerENet::set_dtls_key);
+ ClassDB::bind_method(D_METHOD("set_dtls_certificate", "certificate"), &NetworkedMultiplayerENet::set_dtls_certificate);
+ ClassDB::bind_method(D_METHOD("set_dtls_verify_enabled", "enabled"), &NetworkedMultiplayerENet::set_dtls_verify_enabled);
+ ClassDB::bind_method(D_METHOD("is_dtls_verify_enabled"), &NetworkedMultiplayerENet::is_dtls_verify_enabled);
ClassDB::bind_method(D_METHOD("get_peer_address", "id"), &NetworkedMultiplayerENet::get_peer_address);
ClassDB::bind_method(D_METHOD("get_peer_port", "id"), &NetworkedMultiplayerENet::get_peer_port);
@@ -875,6 +892,8 @@ void NetworkedMultiplayerENet::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::INT, "channel_count"), "set_channel_count", "get_channel_count");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "always_ordered"), "set_always_ordered", "is_always_ordered");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "server_relay"), "set_server_relay_enabled", "is_server_relay_enabled");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "dtls_verify"), "set_dtls_verify_enabled", "is_dtls_verify_enabled");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_dtls"), "set_dtls_enabled", "is_dtls_enabled");
BIND_ENUM_CONSTANT(COMPRESS_NONE);
BIND_ENUM_CONSTANT(COMPRESS_RANGE_CODER);
@@ -904,6 +923,9 @@ NetworkedMultiplayerENet::NetworkedMultiplayerENet() {
enet_compressor.destroy = enet_compressor_destroy;
bind_ip = IP_Address("*");
+
+ dtls_enabled = false;
+ dtls_verify = true;
}
NetworkedMultiplayerENet::~NetworkedMultiplayerENet() {
@@ -920,3 +942,31 @@ void NetworkedMultiplayerENet::set_bind_ip(const IP_Address &p_ip) {
bind_ip = p_ip;
}
+
+void NetworkedMultiplayerENet::set_dtls_enabled(bool p_enabled) {
+ ERR_FAIL_COND(active);
+ dtls_enabled = p_enabled;
+}
+
+bool NetworkedMultiplayerENet::is_dtls_enabled() const {
+ return dtls_enabled;
+}
+
+void NetworkedMultiplayerENet::set_dtls_verify_enabled(bool p_enabled) {
+ ERR_FAIL_COND(active);
+ dtls_verify = p_enabled;
+}
+
+bool NetworkedMultiplayerENet::is_dtls_verify_enabled() const {
+ return dtls_verify;
+}
+
+void NetworkedMultiplayerENet::set_dtls_key(Ref<CryptoKey> p_key) {
+ ERR_FAIL_COND(active);
+ dtls_key = p_key;
+}
+
+void NetworkedMultiplayerENet::set_dtls_certificate(Ref<X509Certificate> p_cert) {
+ ERR_FAIL_COND(active);
+ dtls_cert = p_cert;
+}
diff --git a/modules/enet/networked_multiplayer_enet.h b/modules/enet/networked_multiplayer_enet.h
index 11487b99a5..ff436ce2c0 100644
--- a/modules/enet/networked_multiplayer_enet.h
+++ b/modules/enet/networked_multiplayer_enet.h
@@ -31,6 +31,7 @@
#ifndef NETWORKED_MULTIPLAYER_ENET_H
#define NETWORKED_MULTIPLAYER_ENET_H
+#include "core/crypto/crypto.h"
#include "core/io/compression.h"
#include "core/io/networked_multiplayer_peer.h"
@@ -111,6 +112,11 @@ private:
IP_Address bind_ip;
+ bool dtls_enabled;
+ Ref<CryptoKey> dtls_key;
+ Ref<X509Certificate> dtls_cert;
+ bool dtls_verify;
+
protected:
static void _bind_methods();
@@ -166,6 +172,12 @@ public:
~NetworkedMultiplayerENet();
void set_bind_ip(const IP_Address &p_ip);
+ void set_dtls_enabled(bool p_enabled);
+ bool is_dtls_enabled() const;
+ void set_dtls_verify_enabled(bool p_enabled);
+ bool is_dtls_verify_enabled() const;
+ void set_dtls_key(Ref<CryptoKey> p_key);
+ void set_dtls_certificate(Ref<X509Certificate> p_cert);
};
VARIANT_ENUM_CAST(NetworkedMultiplayerENet::CompressionMode);
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/doc_classes/GDNative.xml b/modules/gdnative/doc_classes/GDNative.xml
index b4b63bf04a..44d9e32ed8 100644
--- a/modules/gdnative/doc_classes/GDNative.xml
+++ b/modules/gdnative/doc_classes/GDNative.xml
@@ -10,9 +10,9 @@
<method name="call_native">
<return type="Variant">
</return>
- <argument index="0" name="calling_type" type="String">
+ <argument index="0" name="calling_type" type="StringName">
</argument>
- <argument index="1" name="procedure_name" type="String">
+ <argument index="1" name="procedure_name" type="StringName">
</argument>
<argument index="2" name="arguments" type="Array">
</argument>
diff --git a/modules/gdnative/doc_classes/GDNativeLibrary.xml b/modules/gdnative/doc_classes/GDNativeLibrary.xml
index 820f126dd1..601e132d42 100644
--- a/modules/gdnative/doc_classes/GDNativeLibrary.xml
+++ b/modules/gdnative/doc_classes/GDNativeLibrary.xml
@@ -12,7 +12,7 @@
</tutorials>
<methods>
<method name="get_current_dependencies" qualifiers="const">
- <return type="PoolStringArray">
+ <return type="PackedStringArray">
</return>
<description>
Returns paths to all dependency libraries for the current platform and architecture.
diff --git a/modules/gdnative/doc_classes/NativeScript.xml b/modules/gdnative/doc_classes/NativeScript.xml
index b21d16a6fd..f2e9cac6dc 100644
--- a/modules/gdnative/doc_classes/NativeScript.xml
+++ b/modules/gdnative/doc_classes/NativeScript.xml
@@ -17,7 +17,7 @@
<method name="get_method_documentation" qualifiers="const">
<return type="String">
</return>
- <argument index="0" name="method" type="String">
+ <argument index="0" name="method" type="StringName">
</argument>
<description>
Returns the documentation string that was previously set with [code]godot_nativescript_set_method_documentation[/code].
@@ -26,7 +26,7 @@
<method name="get_property_documentation" qualifiers="const">
<return type="String">
</return>
- <argument index="0" name="path" type="String">
+ <argument index="0" name="path" type="StringName">
</argument>
<description>
Returns the documentation string that was previously set with [code]godot_nativescript_set_property_documentation[/code].
@@ -35,7 +35,7 @@
<method name="get_signal_documentation" qualifiers="const">
<return type="String">
</return>
- <argument index="0" name="signal_name" type="String">
+ <argument index="0" name="signal_name" type="StringName">
</argument>
<description>
Returns the documentation string that was previously set with [code]godot_nativescript_set_signal_documentation[/code].
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/gdnative.cpp b/modules/gdnative/gdnative/gdnative.cpp
index 018a613724..d996b006a5 100644
--- a/modules/gdnative/gdnative/gdnative.cpp
+++ b/modules/gdnative/gdnative/gdnative.cpp
@@ -79,7 +79,7 @@ godot_variant GDAPI godot_method_bind_call(godot_method_bind *p_method_bind, god
Variant *ret_val = (Variant *)&ret;
- Variant::CallError r_error;
+ Callable::CallError r_error;
*ret_val = mb->call(o, args, p_arg_count, r_error);
if (p_call_error) {
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..f0fc44ae8a 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;
+ PackedInt32Array *pia = (PackedInt32Array *)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;
+ PackedFloat32Array *pra = (PackedFloat32Array *)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
+ PackedInt32Array *dest = (PackedInt32Array *)&raw_dest;
+ memnew_placement(dest, PackedInt32Array(self->operator PackedInt32Array())); // operator = is overloaded by PackedInt32Array
*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
+ PackedFloat32Array *dest = (PackedFloat32Array *)&raw_dest;
+ memnew_placement(dest, PackedFloat32Array(self->operator PackedFloat32Array())); // operator = is overloaded by PackedFloat32Array
*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;
}
@@ -459,7 +459,7 @@ godot_variant GDAPI godot_variant_call(godot_variant *p_self, const godot_string
const Variant **args = (const Variant **)p_args;
godot_variant raw_dest;
Variant *dest = (Variant *)&raw_dest;
- Variant::CallError error;
+ Callable::CallError error;
memnew_placement_custom(dest, Variant, Variant(self->call(*method, args, p_argcount, error)));
if (r_error) {
r_error->error = (godot_variant_call_error_error)error.error;
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..b434bc8385 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);
}
@@ -359,7 +359,7 @@ GDNativeLibraryEditor::GDNativeLibraryEditor() {
filter_list->set_item_checked(idx, true);
idx += 1;
}
- filter_list->connect("index_pressed", this, "_on_filter_selected");
+ filter_list->connect_compat("index_pressed", this, "_on_filter_selected");
tree = memnew(Tree);
container->add_child(tree);
@@ -374,16 +374,16 @@ GDNativeLibraryEditor::GDNativeLibraryEditor() {
tree->set_column_title(2, TTR("Dependencies"));
tree->set_column_expand(3, false);
tree->set_column_min_width(3, int(110 * EDSCALE));
- tree->connect("button_pressed", this, "_on_item_button");
- tree->connect("item_collapsed", this, "_on_item_collapsed");
- tree->connect("item_activated", this, "_on_item_activated");
+ tree->connect_compat("button_pressed", this, "_on_item_button");
+ tree->connect_compat("item_collapsed", this, "_on_item_collapsed");
+ tree->connect_compat("item_activated", this, "_on_item_activated");
file_dialog = memnew(EditorFileDialog);
file_dialog->set_access(EditorFileDialog::ACCESS_RESOURCES);
file_dialog->set_resizable(true);
add_child(file_dialog);
- file_dialog->connect("file_selected", this, "_on_library_selected");
- file_dialog->connect("files_selected", this, "_on_dependencies_selected");
+ file_dialog->connect_compat("file_selected", this, "_on_library_selected");
+ file_dialog->connect_compat("files_selected", this, "_on_dependencies_selected");
new_architecture_dialog = memnew(ConfirmationDialog);
add_child(new_architecture_dialog);
@@ -392,7 +392,7 @@ GDNativeLibraryEditor::GDNativeLibraryEditor() {
new_architecture_dialog->add_child(new_architecture_input);
new_architecture_dialog->set_custom_minimum_size(Vector2(300, 80) * EDSCALE);
new_architecture_input->set_anchors_and_margins_preset(PRESET_HCENTER_WIDE, PRESET_MODE_MINSIZE, 5 * EDSCALE);
- new_architecture_dialog->get_ok()->connect("pressed", this, "_on_create_new_entry");
+ new_architecture_dialog->get_ok()->connect_compat("pressed", this, "_on_create_new_entry");
}
void GDNativeLibraryEditorPlugin::edit(Object *p_node) {
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/gdnative_library_singleton_editor.cpp b/modules/gdnative/gdnative_library_singleton_editor.cpp
index 17a7d5492a..e5eb3c44d0 100644
--- a/modules/gdnative/gdnative_library_singleton_editor.cpp
+++ b/modules/gdnative/gdnative_library_singleton_editor.cpp
@@ -207,8 +207,8 @@ GDNativeLibrarySingletonEditor::GDNativeLibrarySingletonEditor() {
libraries->set_hide_root(true);
add_margin_child(TTR("Libraries: "), libraries, true);
updating = false;
- libraries->connect("item_edited", this, "_item_edited");
- EditorFileSystem::get_singleton()->connect("filesystem_changed", this, "_discover_singletons");
+ libraries->connect_compat("item_edited", this, "_item_edited");
+ EditorFileSystem::get_singleton()->connect_compat("filesystem_changed", this, "_discover_singletons");
}
#endif // TOOLS_ENABLED
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..c610377f54 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
+/////// PackedInt32Array
-#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
+/////// PackedFloat32Array
-#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..934e856fbf 100644
--- a/modules/gdnative/include/gdnative/variant.h
+++ b/modules/gdnative/include/gdnative/variant.h
@@ -56,33 +56,35 @@ typedef enum godot_variant_type {
GODOT_VARIANT_TYPE_STRING,
// math types
-
- GODOT_VARIANT_TYPE_VECTOR2, // 5
+ GODOT_VARIANT_TYPE_VECTOR2,
+ GODOT_VARIANT_TYPE_VECTOR2I,
GODOT_VARIANT_TYPE_RECT2,
+ GODOT_VARIANT_TYPE_RECT2I,
GODOT_VARIANT_TYPE_VECTOR3,
+ GODOT_VARIANT_TYPE_VECTOR3I,
GODOT_VARIANT_TYPE_TRANSFORM2D,
GODOT_VARIANT_TYPE_PLANE,
- GODOT_VARIANT_TYPE_QUAT, // 10
+ GODOT_VARIANT_TYPE_QUAT,
GODOT_VARIANT_TYPE_AABB,
GODOT_VARIANT_TYPE_BASIS,
GODOT_VARIANT_TYPE_TRANSFORM,
// misc types
GODOT_VARIANT_TYPE_COLOR,
- GODOT_VARIANT_TYPE_NODE_PATH, // 15
+ GODOT_VARIANT_TYPE_NODE_PATH,
GODOT_VARIANT_TYPE_RID,
GODOT_VARIANT_TYPE_OBJECT,
GODOT_VARIANT_TYPE_DICTIONARY,
- GODOT_VARIANT_TYPE_ARRAY, // 20
+ GODOT_VARIANT_TYPE_ARRAY,
// 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,
+ GODOT_VARIANT_TYPE_PACKED_VECTOR3_ARRAY,
+ GODOT_VARIANT_TYPE_PACKED_COLOR_ARRAY,
} godot_variant_type;
typedef enum godot_variant_call_error_error {
@@ -194,13 +196,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 +224,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..8240ae2f83 100644
--- a/modules/gdnative/nativescript/nativescript.cpp
+++ b/modules/gdnative/nativescript/nativescript.cpp
@@ -725,21 +725,21 @@ String NativeScript::get_property_documentation(const StringName &p_path) const
ERR_FAIL_V_MSG("", "Attempt to get property documentation for non-existent signal.");
}
-Variant NativeScript::_new(const Variant **p_args, int p_argcount, Variant::CallError &r_error) {
+Variant NativeScript::_new(const Variant **p_args, int p_argcount, Callable::CallError &r_error) {
if (lib_path.empty() || class_name.empty() || library.is_null()) {
- r_error.error = Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL;
+ r_error.error = Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL;
return Variant();
}
NativeScriptDesc *script_data = get_script_desc();
if (!script_data) {
- r_error.error = Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL;
+ r_error.error = Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL;
return Variant();
}
- r_error.error = Variant::CallError::CALL_OK;
+ r_error.error = Callable::CallError::CALL_OK;
REF ref;
Object *owner = NULL;
@@ -751,7 +751,7 @@ Variant NativeScript::_new(const Variant **p_args, int p_argcount, Variant::Call
}
if (!owner) {
- r_error.error = Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL;
+ r_error.error = Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL;
return Variant();
}
@@ -964,7 +964,7 @@ bool NativeScriptInstance::has_method(const StringName &p_method) const {
return script->has_method(p_method);
}
-Variant NativeScriptInstance::call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error) {
+Variant NativeScriptInstance::call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) {
NativeScriptDesc *script_data = GET_SCRIPT_DESC();
@@ -989,14 +989,14 @@ Variant NativeScriptInstance::call(const StringName &p_method, const Variant **p
Variant res = *(Variant *)&result;
godot_variant_destroy(&result);
- r_error.error = Variant::CallError::CALL_OK;
+ r_error.error = Callable::CallError::CALL_OK;
return res;
}
script_data = script_data->base_data;
}
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
return Variant();
}
@@ -1017,9 +1017,9 @@ void NativeScriptInstance::notification(int p_notification) {
String NativeScriptInstance::to_string(bool *r_valid) {
if (has_method(CoreStringNames::get_singleton()->_to_string)) {
- Variant::CallError ce;
+ Callable::CallError ce;
Variant ret = call(CoreStringNames::get_singleton()->_to_string, NULL, 0, ce);
- if (ce.error == Variant::CallError::CALL_OK) {
+ if (ce.error == Callable::CallError::CALL_OK) {
if (ret.get_type() != Variant::STRING) {
if (r_valid)
*r_valid = false;
@@ -1036,21 +1036,21 @@ String NativeScriptInstance::to_string(bool *r_valid) {
}
void NativeScriptInstance::refcount_incremented() {
- Variant::CallError err;
+ Callable::CallError err;
call("_refcount_incremented", NULL, 0, err);
- if (err.error != Variant::CallError::CALL_OK && err.error != Variant::CallError::CALL_ERROR_INVALID_METHOD) {
+ if (err.error != Callable::CallError::CALL_OK && err.error != Callable::CallError::CALL_ERROR_INVALID_METHOD) {
ERR_PRINT("Failed to invoke _refcount_incremented - should not happen");
}
}
bool NativeScriptInstance::refcount_decremented() {
- Variant::CallError err;
+ Callable::CallError err;
Variant ret = call("_refcount_decremented", NULL, 0, err);
- if (err.error != Variant::CallError::CALL_OK && err.error != Variant::CallError::CALL_ERROR_INVALID_METHOD) {
+ if (err.error != Callable::CallError::CALL_OK && err.error != Callable::CallError::CALL_ERROR_INVALID_METHOD) {
ERR_PRINT("Failed to invoke _refcount_decremented - should not happen");
return true; // assume we can destroy the object
}
- if (err.error == Variant::CallError::CALL_ERROR_INVALID_METHOD) {
+ if (err.error == Callable::CallError::CALL_ERROR_INVALID_METHOD) {
// the method does not exist, default is true
return true;
}
@@ -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..609ffa2bd4 100644
--- a/modules/gdnative/nativescript/nativescript.h
+++ b/modules/gdnative/nativescript/nativescript.h
@@ -197,7 +197,7 @@ public:
String get_signal_documentation(const StringName &p_signal_name) const;
String get_property_documentation(const StringName &p_path) const;
- Variant _new(const Variant **p_args, int p_argcount, Variant::CallError &r_error);
+ Variant _new(const Variant **p_args, int p_argcount, Callable::CallError &r_error);
NativeScript();
~NativeScript();
@@ -224,7 +224,7 @@ public:
virtual Variant::Type get_property_type(const StringName &p_name, bool *r_is_valid) const;
virtual void get_method_list(List<MethodInfo> *p_list) const;
virtual bool has_method(const StringName &p_method) const;
- virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error);
+ virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error);
virtual void notification(int p_notification);
String to_string(bool *r_valid);
virtual Ref<Script> get_script() const;
@@ -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_instance.cpp b/modules/gdnative/pluginscript/pluginscript_instance.cpp
index 26a1d5f47a..22e8372130 100644
--- a/modules/gdnative/pluginscript/pluginscript_instance.cpp
+++ b/modules/gdnative/pluginscript/pluginscript_instance.cpp
@@ -79,7 +79,7 @@ bool PluginScriptInstance::has_method(const StringName &p_method) const {
return _script->has_method(p_method);
}
-Variant PluginScriptInstance::call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error) {
+Variant PluginScriptInstance::call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) {
// TODO: optimize when calling a Godot method from Godot to avoid param conversion ?
godot_variant ret = _desc->call_method(
_data, (godot_string_name *)&p_method, (const godot_variant **)p_args,
diff --git a/modules/gdnative/pluginscript/pluginscript_instance.h b/modules/gdnative/pluginscript/pluginscript_instance.h
index 154bebd72a..c91ad643a7 100644
--- a/modules/gdnative/pluginscript/pluginscript_instance.h
+++ b/modules/gdnative/pluginscript/pluginscript_instance.h
@@ -60,7 +60,7 @@ public:
virtual void get_method_list(List<MethodInfo> *p_list) const;
virtual bool has_method(const StringName &p_method) const;
- virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error);
+ virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error);
// Rely on default implementations provided by ScriptInstance for the moment.
// Note that multilevel call could be removed in 3.0 release, so stay tuned
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..fe1f63f6da 100644
--- a/modules/gdnative/pluginscript/pluginscript_script.cpp
+++ b/modules/gdnative/pluginscript/pluginscript_script.cpp
@@ -55,9 +55,9 @@ void PluginScript::_bind_methods() {
ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "new", &PluginScript::_new, MethodInfo("new"));
}
-PluginScriptInstance *PluginScript::_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, Variant::CallError &r_error) {
+PluginScriptInstance *PluginScript::_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, Callable::CallError &r_error) {
- r_error.error = Variant::CallError::CALL_OK;
+ r_error.error = Callable::CallError::CALL_OK;
// Create instance
PluginScriptInstance *instance = memnew(PluginScriptInstance());
@@ -67,7 +67,7 @@ PluginScriptInstance *PluginScript::_create_instance(const Variant **p_args, int
_instances.insert(instance->get_owner());
_language->unlock();
} else {
- r_error.error = Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL;
+ r_error.error = Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL;
memdelete(instance);
ERR_FAIL_V(NULL);
}
@@ -83,12 +83,12 @@ PluginScriptInstance *PluginScript::_create_instance(const Variant **p_args, int
return instance;
}
-Variant PluginScript::_new(const Variant **p_args, int p_argcount, Variant::CallError &r_error) {
+Variant PluginScript::_new(const Variant **p_args, int p_argcount, Callable::CallError &r_error) {
- r_error.error = Variant::CallError::CALL_OK;
+ r_error.error = Callable::CallError::CALL_OK;
if (!_valid) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
return Variant();
}
@@ -102,7 +102,7 @@ Variant PluginScript::_new(const Variant **p_args, int p_argcount, Variant::Call
}
if (!owner) {
- r_error.error = Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL;
+ r_error.error = Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL;
return Variant();
}
@@ -201,7 +201,7 @@ ScriptInstance *PluginScript::instance_create(Object *p_this) {
}
}
- Variant::CallError unchecked_error;
+ Callable::CallError unchecked_error;
return _create_instance(NULL, 0, p_this, unchecked_error);
}
@@ -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/pluginscript/pluginscript_script.h b/modules/gdnative/pluginscript/pluginscript_script.h
index f6bca8a9cb..5c93ae38f5 100644
--- a/modules/gdnative/pluginscript/pluginscript_script.h
+++ b/modules/gdnative/pluginscript/pluginscript_script.h
@@ -72,8 +72,8 @@ private:
protected:
static void _bind_methods();
- PluginScriptInstance *_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, Variant::CallError &r_error);
- Variant _new(const Variant **p_args, int p_argcount, Variant::CallError &r_error);
+ PluginScriptInstance *_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, Callable::CallError &r_error);
+ Variant _new(const Variant **p_args, int p_argcount, Callable::CallError &r_error);
#ifdef TOOLS_ENABLED
Set<PlaceHolderScriptInstance *> placeholders;
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/gd_navigation_server.cpp b/modules/gdnavigation/gd_navigation_server.cpp
index 5bafa5507c..4129d1f65a 100644
--- a/modules/gdnavigation/gd_navigation_server.cpp
+++ b/modules/gdnavigation/gd_navigation_server.cpp
@@ -121,6 +121,7 @@ GdNavigationServer::GdNavigationServer() :
}
GdNavigationServer::~GdNavigationServer() {
+ flush_queries();
memdelete(operations_mutex);
memdelete(commands_mutex);
}
@@ -170,7 +171,7 @@ COMMAND_2(map_set_up, RID, p_map, Vector3, p_up) {
}
Vector3 GdNavigationServer::map_get_up(RID p_map) const {
- NavMap *map = map_owner.getornull(p_map);
+ const NavMap *map = map_owner.getornull(p_map);
ERR_FAIL_COND_V(map == NULL, Vector3());
return map->get_up();
@@ -184,7 +185,7 @@ COMMAND_2(map_set_cell_size, RID, p_map, real_t, p_cell_size) {
}
real_t GdNavigationServer::map_get_cell_size(RID p_map) const {
- NavMap *map = map_owner.getornull(p_map);
+ const NavMap *map = map_owner.getornull(p_map);
ERR_FAIL_COND_V(map == NULL, 0);
return map->get_cell_size();
@@ -198,19 +199,47 @@ COMMAND_2(map_set_edge_connection_margin, RID, p_map, real_t, p_connection_margi
}
real_t GdNavigationServer::map_get_edge_connection_margin(RID p_map) const {
- NavMap *map = map_owner.getornull(p_map);
+ const NavMap *map = map_owner.getornull(p_map);
ERR_FAIL_COND_V(map == NULL, 0);
return map->get_edge_connection_margin();
}
Vector<Vector3> GdNavigationServer::map_get_path(RID p_map, Vector3 p_origin, Vector3 p_destination, bool p_optimize) const {
- NavMap *map = map_owner.getornull(p_map);
+ const NavMap *map = map_owner.getornull(p_map);
ERR_FAIL_COND_V(map == NULL, Vector<Vector3>());
return map->get_path(p_origin, p_destination, p_optimize);
}
+Vector3 GdNavigationServer::map_get_closest_point_to_segment(RID p_map, const Vector3 &p_from, const Vector3 &p_to, const bool p_use_collision) const {
+ const NavMap *map = map_owner.getornull(p_map);
+ ERR_FAIL_COND_V(map == NULL, Vector3());
+
+ return map->get_closest_point_to_segment(p_from, p_to, p_use_collision);
+}
+
+Vector3 GdNavigationServer::map_get_closest_point(RID p_map, const Vector3 &p_point) const {
+ const NavMap *map = map_owner.getornull(p_map);
+ ERR_FAIL_COND_V(map == NULL, Vector3());
+
+ return map->get_closest_point(p_point);
+}
+
+Vector3 GdNavigationServer::map_get_closest_point_normal(RID p_map, const Vector3 &p_point) const {
+ const NavMap *map = map_owner.getornull(p_map);
+ ERR_FAIL_COND_V(map == NULL, Vector3());
+
+ return map->get_closest_point_normal(p_point);
+}
+
+RID GdNavigationServer::map_get_closest_point_owner(RID p_map, const Vector3 &p_point) const {
+ const NavMap *map = map_owner.getornull(p_map);
+ ERR_FAIL_COND_V(map == NULL, RID());
+
+ return map->get_closest_point_owner(p_point);
+}
+
RID GdNavigationServer::region_create() const {
auto mut_this = const_cast<GdNavigationServer *>(this);
mut_this->operations_mutex->lock();
@@ -446,12 +475,9 @@ void GdNavigationServer::set_active(bool p_active) const {
mut_this->operations_mutex->unlock();
}
-void GdNavigationServer::step(real_t p_delta_time) {
- if (!active) {
- return;
- }
-
- // With c++ we can't be 100% sure this is called in single thread so use the mutex.
+void GdNavigationServer::flush_queries() {
+ // In c++ we can't be sure that this is performed in the main thread
+ // even with mutable functions.
commands_mutex->lock();
operations_mutex->lock();
for (size_t i(0); i < commands.size(); i++) {
@@ -461,13 +487,24 @@ void GdNavigationServer::step(real_t p_delta_time) {
commands.clear();
operations_mutex->unlock();
commands_mutex->unlock();
+}
- // These are internal operations so don't need to be shielded.
+void GdNavigationServer::process(real_t p_delta_time) {
+ flush_queries();
+
+ if (!active) {
+ return;
+ }
+
+ // In c++ we can't be sure that this is performed in the main thread
+ // even with mutable functions.
+ operations_mutex->lock();
for (int i(0); i < active_maps.size(); i++) {
active_maps[i]->sync();
active_maps[i]->step(p_delta_time);
active_maps[i]->dispatch_callbacks();
}
+ operations_mutex->unlock();
}
#undef COMMAND_1
diff --git a/modules/gdnavigation/gd_navigation_server.h b/modules/gdnavigation/gd_navigation_server.h
index 564e9870a0..0400acf1a3 100644
--- a/modules/gdnavigation/gd_navigation_server.h
+++ b/modules/gdnavigation/gd_navigation_server.h
@@ -103,6 +103,11 @@ public:
virtual Vector<Vector3> map_get_path(RID p_map, Vector3 p_origin, Vector3 p_destination, bool p_optimize) const;
+ virtual Vector3 map_get_closest_point_to_segment(RID p_map, const Vector3 &p_from, const Vector3 &p_to, const bool p_use_collision = false) const;
+ virtual Vector3 map_get_closest_point(RID p_map, const Vector3 &p_point) const;
+ virtual Vector3 map_get_closest_point_normal(RID p_map, const Vector3 &p_point) const;
+ virtual RID map_get_closest_point_owner(RID p_map, const Vector3 &p_point) const;
+
virtual RID region_create() const;
COMMAND_2(region_set_map, RID, p_region, RID, p_map);
COMMAND_2(region_set_transform, RID, p_region, Transform, p_transform);
@@ -126,7 +131,9 @@ public:
COMMAND_1(free, RID, p_object);
virtual void set_active(bool p_active) const;
- virtual void step(real_t p_delta_time);
+
+ void flush_queries();
+ virtual void process(real_t p_delta_time);
};
#undef COMMAND_1
diff --git a/modules/gdnavigation/nav_map.cpp b/modules/gdnavigation/nav_map.cpp
index d1765f4da9..c3880f89b6 100644
--- a/modules/gdnavigation/nav_map.cpp
+++ b/modules/gdnavigation/nav_map.cpp
@@ -401,14 +401,155 @@ Vector<Vector3> NavMap::get_path(Vector3 p_origin, Vector3 p_destination, bool p
return Vector<Vector3>();
}
+Vector3 NavMap::get_closest_point_to_segment(const Vector3 &p_from, const Vector3 &p_to, const bool p_use_collision) const {
+
+ bool use_collision = p_use_collision;
+ Vector3 closest_point;
+ real_t closest_point_d = 1e20;
+
+ // Find the initial poly and the end poly on this map.
+ for (size_t i(0); i < polygons.size(); i++) {
+ const gd::Polygon &p = polygons[i];
+
+ // For each point cast a face and check the distance to the segment
+ for (size_t point_id = 2; point_id < p.points.size(); point_id += 1) {
+
+ const Face3 f(p.points[point_id - 2].pos, p.points[point_id - 1].pos, p.points[point_id].pos);
+ Vector3 inters;
+ if (f.intersects_segment(p_from, p_to, &inters)) {
+ const real_t d = closest_point_d = p_from.distance_to(inters);
+ if (use_collision == false) {
+ closest_point = inters;
+ use_collision = true;
+ closest_point_d = d;
+ } else if (closest_point_d > d) {
+
+ closest_point = inters;
+ closest_point_d = d;
+ }
+ }
+ }
+
+ if (use_collision == false) {
+
+ for (size_t point_id = 0; point_id < p.points.size(); point_id += 1) {
+
+ Vector3 a, b;
+
+ Geometry::get_closest_points_between_segments(
+ p_from,
+ p_to,
+ p.points[point_id].pos,
+ p.points[(point_id + 1) % p.points.size()].pos,
+ a,
+ b);
+
+ const real_t d = a.distance_to(b);
+ if (d < closest_point_d) {
+
+ closest_point_d = d;
+ closest_point = b;
+ }
+ }
+ }
+ }
+
+ return closest_point;
+}
+
+Vector3 NavMap::get_closest_point(const Vector3 &p_point) const {
+ // TODO this is really not optimal, please redesign the API to directly return all this data
+
+ Vector3 closest_point;
+ real_t closest_point_d = 1e20;
+
+ // Find the initial poly and the end poly on this map.
+ for (size_t i(0); i < polygons.size(); i++) {
+ const gd::Polygon &p = polygons[i];
+
+ // For each point cast a face and check the distance to the point
+ for (size_t point_id = 2; point_id < p.points.size(); point_id += 1) {
+
+ const Face3 f(p.points[point_id - 2].pos, p.points[point_id - 1].pos, p.points[point_id].pos);
+ const Vector3 inters = f.get_closest_point_to(p_point);
+ const real_t d = inters.distance_to(p_point);
+ if (d < closest_point_d) {
+ closest_point = inters;
+ closest_point_d = d;
+ }
+ }
+ }
+
+ return closest_point;
+}
+
+Vector3 NavMap::get_closest_point_normal(const Vector3 &p_point) const {
+ // TODO this is really not optimal, please redesign the API to directly return all this data
+
+ Vector3 closest_point;
+ Vector3 closest_point_normal;
+ real_t closest_point_d = 1e20;
+
+ // Find the initial poly and the end poly on this map.
+ for (size_t i(0); i < polygons.size(); i++) {
+ const gd::Polygon &p = polygons[i];
+
+ // For each point cast a face and check the distance to the point
+ for (size_t point_id = 2; point_id < p.points.size(); point_id += 1) {
+
+ const Face3 f(p.points[point_id - 2].pos, p.points[point_id - 1].pos, p.points[point_id].pos);
+ const Vector3 inters = f.get_closest_point_to(p_point);
+ const real_t d = inters.distance_to(p_point);
+ if (d < closest_point_d) {
+ closest_point = inters;
+ closest_point_normal = f.get_plane().normal;
+ closest_point_d = d;
+ }
+ }
+ }
+
+ return closest_point_normal;
+}
+
+RID NavMap::get_closest_point_owner(const Vector3 &p_point) const {
+ // TODO this is really not optimal, please redesign the API to directly return all this data
+
+ Vector3 closest_point;
+ RID closest_point_owner;
+ real_t closest_point_d = 1e20;
+
+ // Find the initial poly and the end poly on this map.
+ for (size_t i(0); i < polygons.size(); i++) {
+ const gd::Polygon &p = polygons[i];
+
+ // For each point cast a face and check the distance to the point
+ for (size_t point_id = 2; point_id < p.points.size(); point_id += 1) {
+
+ const Face3 f(p.points[point_id - 2].pos, p.points[point_id - 1].pos, p.points[point_id].pos);
+ const Vector3 inters = f.get_closest_point_to(p_point);
+ const real_t d = inters.distance_to(p_point);
+ if (d < closest_point_d) {
+ closest_point = inters;
+ closest_point_owner = p.owner->get_self();
+ closest_point_d = d;
+ }
+ }
+ }
+
+ return closest_point_owner;
+}
+
void NavMap::add_region(NavRegion *p_region) {
regions.push_back(p_region);
regenerate_links = true;
}
void NavMap::remove_region(NavRegion *p_region) {
- regions.push_back(p_region);
- regenerate_links = true;
+ std::vector<NavRegion *>::iterator it = std::find(regions.begin(), regions.end(), p_region);
+ if (it != regions.end()) {
+ regions.erase(it);
+ regenerate_links = true;
+ }
}
bool NavMap::has_agent(RvoAgent *agent) const {
diff --git a/modules/gdnavigation/nav_map.h b/modules/gdnavigation/nav_map.h
index 128a82580c..4543f00926 100644
--- a/modules/gdnavigation/nav_map.h
+++ b/modules/gdnavigation/nav_map.h
@@ -104,6 +104,10 @@ public:
gd::PointKey get_point_key(const Vector3 &p_pos) const;
Vector<Vector3> get_path(Vector3 p_origin, Vector3 p_destination, bool p_optimize) const;
+ Vector3 get_closest_point_to_segment(const Vector3 &p_from, const Vector3 &p_to, const bool p_use_collision) const;
+ Vector3 get_closest_point(const Vector3 &p_point) const;
+ Vector3 get_closest_point_normal(const Vector3 &p_point) const;
+ RID get_closest_point_owner(const Vector3 &p_point) const;
void add_region(NavRegion *p_region);
void remove_region(NavRegion *p_region);
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_editor_plugin.cpp b/modules/gdnavigation/navigation_mesh_editor_plugin.cpp
index 13c74d5706..28fe0bfd06 100644
--- a/modules/gdnavigation/navigation_mesh_editor_plugin.cpp
+++ b/modules/gdnavigation/navigation_mesh_editor_plugin.cpp
@@ -107,13 +107,13 @@ NavigationMeshEditor::NavigationMeshEditor() {
bake_hbox->add_child(button_bake);
button_bake->set_toggle_mode(true);
button_bake->set_text(TTR("Bake NavMesh"));
- button_bake->connect("pressed", this, "_bake_pressed");
+ button_bake->connect_compat("pressed", this, "_bake_pressed");
button_reset = memnew(ToolButton);
bake_hbox->add_child(button_reset);
// No button text, we only use a revert icon which is set when entering the tree.
button_reset->set_tooltip(TTR("Clear the navigation mesh."));
- button_reset->connect("pressed", this, "_clear_pressed");
+ button_reset->connect_compat("pressed", this, "_clear_pressed");
bake_info = memnew(Label);
bake_hbox->add_child(bake_info);
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/gdnavigation/rvo_agent.cpp b/modules/gdnavigation/rvo_agent.cpp
index 4d19bc15af..677e525bbf 100644
--- a/modules/gdnavigation/rvo_agent.cpp
+++ b/modules/gdnavigation/rvo_agent.cpp
@@ -74,7 +74,7 @@ void RvoAgent::dispatch_callback() {
callback.id = ObjectID();
}
- Variant::CallError responseCallError;
+ Callable::CallError responseCallError;
callback.new_velocity = Vector3(agent.newVelocity_.x(), agent.newVelocity_.y(), agent.newVelocity_.z());
diff --git a/modules/gdscript/doc_classes/@GDScript.xml b/modules/gdscript/doc_classes/@GDScript.xml
index 9fc8ad5573..cf76c09294 100644
--- a/modules/gdscript/doc_classes/@GDScript.xml
+++ b/modules/gdscript/doc_classes/@GDScript.xml
@@ -131,7 +131,7 @@
<method name="bytes2var">
<return type="Variant">
</return>
- <argument index="0" name="bytes" type="PoolByteArray">
+ <argument index="0" name="bytes" type="PackedByteArray">
</argument>
<argument index="1" name="allow_objects" type="bool" default="false">
</argument>
@@ -1245,7 +1245,7 @@
</description>
</method>
<method name="var2bytes">
- <return type="PoolByteArray">
+ <return type="PackedByteArray">
</return>
<argument index="0" name="var" type="Variant">
</argument>
diff --git a/modules/gdscript/doc_classes/GDScript.xml b/modules/gdscript/doc_classes/GDScript.xml
index 5d0e93e117..62ccb93901 100644
--- a/modules/gdscript/doc_classes/GDScript.xml
+++ b/modules/gdscript/doc_classes/GDScript.xml
@@ -12,7 +12,7 @@
</tutorials>
<methods>
<method name="get_as_byte_code" qualifiers="const">
- <return type="PoolByteArray">
+ <return type="PackedByteArray">
</return>
<description>
Returns byte code for the script source code.
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp
index 07c74a2e26..a72bb7ba49 100644
--- a/modules/gdscript/gdscript.cpp
+++ b/modules/gdscript/gdscript.cpp
@@ -84,7 +84,7 @@ Object *GDScriptNativeClass::instance() {
return ClassDB::instance(name);
}
-GDScriptInstance *GDScript::_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, bool p_isref, Variant::CallError &r_error) {
+GDScriptInstance *GDScript::_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, bool p_isref, Callable::CallError &r_error) {
/* STEP 1, CREATE */
@@ -116,7 +116,7 @@ GDScriptInstance *GDScript::_create_instance(const Variant **p_args, int p_argco
initializer->call(instance, p_args, p_argcount, r_error);
- if (r_error.error != Variant::CallError::CALL_OK) {
+ if (r_error.error != Callable::CallError::CALL_OK) {
instance->script = Ref<GDScript>();
instance->owner->set_script_instance(NULL);
#ifndef NO_THREADS
@@ -127,23 +127,23 @@ GDScriptInstance *GDScript::_create_instance(const Variant **p_args, int p_argco
GDScriptLanguage::singleton->lock->unlock();
#endif
- ERR_FAIL_COND_V(r_error.error != Variant::CallError::CALL_OK, NULL); //error constructing
+ ERR_FAIL_COND_V(r_error.error != Callable::CallError::CALL_OK, NULL); //error constructing
}
//@TODO make thread safe
return instance;
}
-Variant GDScript::_new(const Variant **p_args, int p_argcount, Variant::CallError &r_error) {
+Variant GDScript::_new(const Variant **p_args, int p_argcount, Callable::CallError &r_error) {
/* STEP 1, CREATE */
if (!valid) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
return Variant();
}
- r_error.error = Variant::CallError::CALL_OK;
+ r_error.error = Callable::CallError::CALL_OK;
REF ref;
Object *owner = NULL;
@@ -329,7 +329,7 @@ ScriptInstance *GDScript::instance_create(Object *p_this) {
}
}
- Variant::CallError unchecked_error;
+ Callable::CallError unchecked_error;
return _create_instance(NULL, 0, p_this, Object::cast_to<Reference>(p_this) != NULL, unchecked_error);
}
@@ -739,7 +739,7 @@ MultiplayerAPI::RPCMode GDScript::get_rset_mode(const StringName &p_variable) co
return get_rset_mode_by_id(get_rset_property_id(p_variable));
}
-Variant GDScript::call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error) {
+Variant GDScript::call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) {
GDScript *top = this;
while (top) {
@@ -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.");
}
@@ -995,7 +995,6 @@ void GDScript::get_script_signal_list(List<MethodInfo> *r_signals) const {
GDScript::GDScript() :
script_list(this) {
- _static_ref = this;
valid = false;
subclass_count = 0;
initializer = NULL;
@@ -1082,18 +1081,18 @@ bool GDScriptInstance::set(const StringName &p_name, const Variant &p_value) {
const GDScript::MemberInfo *member = &E->get();
if (member->setter) {
const Variant *val = &p_value;
- Variant::CallError err;
+ Callable::CallError err;
call(member->setter, &val, 1, err);
- if (err.error == Variant::CallError::CALL_OK) {
+ if (err.error == Callable::CallError::CALL_OK) {
return true; //function exists, call was successful
}
} else {
if (!member->data_type.is_type(p_value)) {
// Try conversion
- Variant::CallError ce;
+ Callable::CallError ce;
const Variant *value = &p_value;
Variant converted = Variant::construct(member->data_type.builtin_type, &value, 1, ce);
- if (ce.error == Variant::CallError::CALL_OK) {
+ if (ce.error == Callable::CallError::CALL_OK) {
members.write[member->index] = converted;
return true;
} else {
@@ -1116,9 +1115,9 @@ bool GDScriptInstance::set(const StringName &p_name, const Variant &p_value) {
Variant name = p_name;
const Variant *args[2] = { &name, &p_value };
- Variant::CallError err;
+ Callable::CallError err;
Variant ret = E->get()->call(this, (const Variant **)args, 2, err);
- if (err.error == Variant::CallError::CALL_OK && ret.get_type() == Variant::BOOL && ret.operator bool())
+ if (err.error == Callable::CallError::CALL_OK && ret.get_type() == Variant::BOOL && ret.operator bool())
return true;
}
sptr = sptr->_base;
@@ -1136,9 +1135,9 @@ bool GDScriptInstance::get(const StringName &p_name, Variant &r_ret) const {
const Map<StringName, GDScript::MemberInfo>::Element *E = script->member_indices.find(p_name);
if (E) {
if (E->get().getter) {
- Variant::CallError err;
+ Callable::CallError err;
r_ret = const_cast<GDScriptInstance *>(this)->call(E->get().getter, NULL, 0, err);
- if (err.error == Variant::CallError::CALL_OK) {
+ if (err.error == Callable::CallError::CALL_OK) {
return true;
}
}
@@ -1167,9 +1166,9 @@ bool GDScriptInstance::get(const StringName &p_name, Variant &r_ret) const {
Variant name = p_name;
const Variant *args[1] = { &name };
- Variant::CallError err;
+ Callable::CallError err;
Variant ret = const_cast<GDScriptFunction *>(E->get())->call(const_cast<GDScriptInstance *>(this), (const Variant **)args, 1, err);
- if (err.error == Variant::CallError::CALL_OK && ret.get_type() != Variant::NIL) {
+ if (err.error == Callable::CallError::CALL_OK && ret.get_type() != Variant::NIL) {
r_ret = ret;
return true;
}
@@ -1210,9 +1209,9 @@ void GDScriptInstance::get_property_list(List<PropertyInfo> *p_properties) const
const Map<StringName, GDScriptFunction *>::Element *E = sptr->member_functions.find(GDScriptLanguage::get_singleton()->strings._get_property_list);
if (E) {
- Variant::CallError err;
+ Callable::CallError err;
Variant ret = const_cast<GDScriptFunction *>(E->get())->call(const_cast<GDScriptInstance *>(this), NULL, 0, err);
- if (err.error == Variant::CallError::CALL_OK) {
+ if (err.error == Callable::CallError::CALL_OK) {
ERR_FAIL_COND_MSG(ret.get_type() != Variant::ARRAY, "Wrong type for _get_property_list, must be an array of dictionaries.");
@@ -1297,7 +1296,7 @@ bool GDScriptInstance::has_method(const StringName &p_method) const {
return false;
}
-Variant GDScriptInstance::call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error) {
+Variant GDScriptInstance::call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) {
GDScript *sptr = script.ptr();
while (sptr) {
@@ -1307,14 +1306,14 @@ Variant GDScriptInstance::call(const StringName &p_method, const Variant **p_arg
}
sptr = sptr->_base;
}
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
return Variant();
}
void GDScriptInstance::call_multilevel(const StringName &p_method, const Variant **p_args, int p_argcount) {
GDScript *sptr = script.ptr();
- Variant::CallError ce;
+ Callable::CallError ce;
while (sptr) {
Map<StringName, GDScriptFunction *>::Element *E = sptr->member_functions.find(p_method);
@@ -1330,7 +1329,7 @@ void GDScriptInstance::_ml_call_reversed(GDScript *sptr, const StringName &p_met
if (sptr->_base)
_ml_call_reversed(sptr->_base, p_method, p_args, p_argcount);
- Variant::CallError ce;
+ Callable::CallError ce;
Map<StringName, GDScriptFunction *>::Element *E = sptr->member_functions.find(p_method);
if (E) {
@@ -1355,9 +1354,9 @@ void GDScriptInstance::notification(int p_notification) {
while (sptr) {
Map<StringName, GDScriptFunction *>::Element *E = sptr->member_functions.find(GDScriptLanguage::get_singleton()->strings._notification);
if (E) {
- Variant::CallError err;
+ Callable::CallError err;
E->get()->call(this, args, 1, err);
- if (err.error != Variant::CallError::CALL_OK) {
+ if (err.error != Callable::CallError::CALL_OK) {
//print error about notification call
}
}
@@ -1367,9 +1366,9 @@ void GDScriptInstance::notification(int p_notification) {
String GDScriptInstance::to_string(bool *r_valid) {
if (has_method(CoreStringNames::get_singleton()->_to_string)) {
- Variant::CallError ce;
+ Callable::CallError ce;
Variant ret = call(CoreStringNames::get_singleton()->_to_string, NULL, 0, ce);
- if (ce.error == Variant::CallError::CALL_OK) {
+ if (ce.error == Callable::CallError::CALL_OK) {
if (ret.get_type() != Variant::STRING) {
if (r_valid)
*r_valid = false;
@@ -1986,7 +1985,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..6598a0023b 100644
--- a/modules/gdscript/gdscript.h
+++ b/modules/gdscript/gdscript.h
@@ -73,7 +73,6 @@ class GDScript : public Script {
friend class GDScriptFunctions;
friend class GDScriptLanguage;
- Variant _static_ref; //used for static call
Ref<GDScriptNativeClass> native;
Ref<GDScript> base;
GDScript *_base; //fast pointer access
@@ -116,7 +115,7 @@ class GDScript : public Script {
String fully_qualified_name;
SelfList<GDScript> script_list;
- GDScriptInstance *_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, bool p_isref, Variant::CallError &r_error);
+ GDScriptInstance *_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, bool p_isref, Callable::CallError &r_error);
void _set_subclass_path(Ref<GDScript> &p_sc, const String &p_path);
@@ -141,7 +140,7 @@ protected:
bool _set(const StringName &p_name, const Variant &p_value);
void _get_property_list(List<PropertyInfo> *p_properties) const;
- Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error);
+ Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error);
//void call_multilevel(const StringName& p_method,const Variant** p_args,int p_argcount);
static void _bind_methods();
@@ -170,7 +169,7 @@ public:
const Map<StringName, GDScriptFunction *> &debug_get_member_functions() const; //this is debug only
StringName debug_get_member_by_index(int p_idx) const;
- Variant _new(const Variant **p_args, int p_argcount, Variant::CallError &r_error);
+ Variant _new(const Variant **p_args, int p_argcount, Callable::CallError &r_error);
virtual bool can_instance() const;
virtual Ref<Script> get_base_script() const;
@@ -262,7 +261,7 @@ public:
virtual void get_method_list(List<MethodInfo> *p_list) const;
virtual bool has_method(const StringName &p_method) const;
- virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error);
+ virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error);
virtual void call_multilevel(const StringName &p_method, const Variant **p_args, int p_argcount);
virtual void call_multilevel_reversed(const StringName &p_method, const Variant **p_args, int p_argcount);
@@ -487,7 +486,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_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp
index fba1b992ec..4bd425f999 100644
--- a/modules/gdscript/gdscript_compiler.cpp
+++ b/modules/gdscript/gdscript_compiler.cpp
@@ -2076,10 +2076,10 @@ Error GDScriptCompiler::_parse_class_blocks(GDScript *p_script, const GDScriptPa
/* STEP 2, INITIALIZE AND CONSTRUCT */
- Variant::CallError ce;
+ Callable::CallError ce;
p_script->initializer->call(instance, NULL, 0, ce);
- if (ce.error != Variant::CallError::CALL_OK) {
+ if (ce.error != Callable::CallError::CALL_OK) {
//well, tough luck, not goinna do anything here
}
}
diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp
index c2c8ff5b99..1bc1aae0d2 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");
@@ -905,10 +905,10 @@ static bool _guess_expression_type(GDScriptCompletionContext &p_context, const G
argptr.push_back(&args[i]);
}
- Variant::CallError ce;
+ Callable::CallError ce;
Variant ret = mb->call(baseptr, (const Variant **)argptr.ptr(), argptr.size(), ce);
- if (ce.error == Variant::CallError::CALL_OK && ret.get_type() != Variant::NIL) {
+ if (ce.error == Callable::CallError::CALL_OK && ret.get_type() != Variant::NIL) {
if (ret.get_type() != Variant::OBJECT || ret.operator Object *() != NULL) {
r_type = _type_from_variant(ret);
found = true;
@@ -1060,7 +1060,7 @@ static bool _guess_expression_type(GDScriptCompletionContext &p_context, const G
StringName id = index.value;
found = _guess_identifier_type_from_base(c, base, id, r_type);
} else if (!found && index.type.kind == GDScriptParser::DataType::BUILTIN) {
- Variant::CallError err;
+ Callable::CallError err;
Variant base_val = Variant::construct(base.type.builtin_type, NULL, 0, err);
bool valid = false;
Variant res = base_val.get(index.value, &valid);
@@ -1114,7 +1114,7 @@ static bool _guess_expression_type(GDScriptCompletionContext &p_context, const G
break;
}
- Variant::CallError ce;
+ Callable::CallError ce;
bool v1_use_value = p1.value.get_type() != Variant::NIL && p1.value.get_type() != Variant::OBJECT;
Variant v1 = (v1_use_value) ? p1.value : Variant::construct(p1.type.builtin_type, NULL, 0, ce);
bool v2_use_value = p2.value.get_type() != Variant::NIL && p2.value.get_type() != Variant::OBJECT;
@@ -1124,7 +1124,7 @@ static bool _guess_expression_type(GDScriptCompletionContext &p_context, const G
v2 = 1;
v2_use_value = false;
}
- if (vop == Variant::OP_DIVIDE && v2.get_type() == Variant::REAL) {
+ if (vop == Variant::OP_DIVIDE && v2.get_type() == Variant::FLOAT) {
v2 = 1.0;
v2_use_value = false;
}
@@ -1533,10 +1533,10 @@ static bool _guess_identifier_type_from_base(GDScriptCompletionContext &p_contex
return false;
} break;
case GDScriptParser::DataType::BUILTIN: {
- Variant::CallError err;
+ Callable::CallError err;
Variant tmp = Variant::construct(base_type.builtin_type, NULL, 0, err);
- if (err.error != Variant::CallError::CALL_OK) {
+ if (err.error != Callable::CallError::CALL_OK) {
return false;
}
bool valid = false;
@@ -1703,9 +1703,9 @@ static bool _guess_method_return_type_from_base(GDScriptCompletionContext &p_con
return false;
} break;
case GDScriptParser::DataType::BUILTIN: {
- Variant::CallError err;
+ Callable::CallError err;
Variant tmp = Variant::construct(base_type.builtin_type, NULL, 0, err);
- if (err.error != Variant::CallError::CALL_OK) {
+ if (err.error != Callable::CallError::CALL_OK) {
return false;
}
@@ -2088,9 +2088,9 @@ static void _find_identifiers_in_base(const GDScriptCompletionContext &p_context
return;
} break;
case GDScriptParser::DataType::BUILTIN: {
- Variant::CallError err;
+ Callable::CallError err;
Variant tmp = Variant::construct(base_type.builtin_type, NULL, 0, err);
- if (err.error != Variant::CallError::CALL_OK) {
+ if (err.error != Callable::CallError::CALL_OK) {
return;
}
@@ -2172,9 +2172,9 @@ 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"
+ "null", "bool", "int", "float", "String", "Vector2", "Vector2i", "Rect2", "Rect2i", "Vector3", "Vector3i", "Transform2D", "Plane", "Quat", "AABB", "Basis", "Transform",
+ "Color", "StringName", "NodePath", "RID", "Object", "Callable", "Signal", "Dictionary", "Array", "PackedByteArray", "PackedInt32Array", "PackedInt64Array", "PackedFloat32Array", "PackedFloat64Array", "PackedStringArray",
+ "PackedVector2Array", "PackedVector3Array", "PackedColorArray"
};
for (int i = 0; i < Variant::VARIANT_MAX; i++) {
@@ -2372,9 +2372,9 @@ static void _find_call_arguments(const GDScriptCompletionContext &p_context, con
} break;
case GDScriptParser::DataType::BUILTIN: {
if (base.get_type() == Variant::NIL) {
- Variant::CallError err;
+ Callable::CallError err;
base = Variant::construct(base_type.builtin_type, NULL, 0, err);
- if (err.error != Variant::CallError::CALL_OK) {
+ if (err.error != Callable::CallError::CALL_OK) {
return;
}
}
@@ -2565,7 +2565,7 @@ Error GDScriptLanguage::complete_code(const String &p_code, const String &p_path
} break;
case GDScriptParser::COMPLETION_FUNCTION: {
is_function = true;
- FALLTHROUGH;
+ [[fallthrough]];
}
case GDScriptParser::COMPLETION_IDENTIFIER: {
_find_identifiers(context, is_function, options);
@@ -2608,7 +2608,7 @@ Error GDScriptLanguage::complete_code(const String &p_code, const String &p_path
} break;
case GDScriptParser::COMPLETION_METHOD: {
is_function = true;
- FALLTHROUGH;
+ [[fallthrough]];
}
case GDScriptParser::COMPLETION_INDEX: {
const GDScriptParser::Node *node = parser.get_completion_node();
@@ -3219,9 +3219,9 @@ static Error _lookup_symbol_from_base(const GDScriptParser::DataType &p_base, co
v_ref.instance();
v = v_ref;
} else {
- Variant::CallError err;
+ Callable::CallError err;
v = Variant::construct(base_type.builtin_type, NULL, 0, err);
- if (err.error != Variant::CallError::CALL_OK) {
+ if (err.error != Callable::CallError::CALL_OK) {
break;
}
}
@@ -3330,7 +3330,7 @@ Error GDScriptLanguage::lookup_code(const String &p_code, const String &p_symbol
case GDScriptParser::COMPLETION_PARENT_FUNCTION:
case GDScriptParser::COMPLETION_FUNCTION: {
is_function = true;
- FALLTHROUGH;
+ [[fallthrough]];
}
case GDScriptParser::COMPLETION_IDENTIFIER: {
@@ -3462,7 +3462,7 @@ Error GDScriptLanguage::lookup_code(const String &p_code, const String &p_symbol
} break;
case GDScriptParser::COMPLETION_METHOD: {
is_function = true;
- FALLTHROUGH;
+ [[fallthrough]];
}
case GDScriptParser::COMPLETION_INDEX: {
const GDScriptParser::Node *node = parser.get_completion_node();
diff --git a/modules/gdscript/gdscript_function.cpp b/modules/gdscript/gdscript_function.cpp
index cbf7d81a61..27857ea91f 100644
--- a/modules/gdscript/gdscript_function.cpp
+++ b/modules/gdscript/gdscript_function.cpp
@@ -34,7 +34,7 @@
#include "gdscript.h"
#include "gdscript_functions.h"
-Variant *GDScriptFunction::_get_variant(int p_address, GDScriptInstance *p_instance, GDScript *p_script, Variant &self, Variant *p_stack, String &r_error) const {
+Variant *GDScriptFunction::_get_variant(int p_address, GDScriptInstance *p_instance, GDScript *p_script, Variant &self, Variant &static_ref, Variant *p_stack, String &r_error) const {
int address = p_address & ADDR_MASK;
@@ -52,7 +52,7 @@ Variant *GDScriptFunction::_get_variant(int p_address, GDScriptInstance *p_insta
} break;
case ADDR_TYPE_CLASS: {
- return &p_script->_static_ref;
+ return &static_ref;
} break;
case ADDR_TYPE_MEMBER: {
#ifdef DEBUG_ENABLED
@@ -160,11 +160,11 @@ static String _get_var_type(const Variant *p_var) {
}
#endif // DEBUG_ENABLED
-String GDScriptFunction::_get_call_error(const Variant::CallError &p_err, const String &p_where, const Variant **argptrs) const {
+String GDScriptFunction::_get_call_error(const Callable::CallError &p_err, const String &p_where, const Variant **argptrs) const {
String err_text;
- if (p_err.error == Variant::CallError::CALL_ERROR_INVALID_ARGUMENT) {
+ if (p_err.error == Callable::CallError::CALL_ERROR_INVALID_ARGUMENT) {
int errorarg = p_err.argument;
// Handle the Object to Object case separately as we don't have further class details.
#ifdef DEBUG_ENABLED
@@ -173,15 +173,15 @@ String GDScriptFunction::_get_call_error(const Variant::CallError &p_err, const
} else
#endif // DEBUG_ENABLED
{
- err_text = "Invalid type in " + p_where + ". Cannot convert argument " + itos(errorarg + 1) + " from " + Variant::get_type_name(argptrs[errorarg]->get_type()) + " to " + Variant::get_type_name(p_err.expected) + ".";
+ err_text = "Invalid type in " + p_where + ". Cannot convert argument " + itos(errorarg + 1) + " from " + Variant::get_type_name(argptrs[errorarg]->get_type()) + " to " + Variant::get_type_name(Variant::Type(p_err.expected)) + ".";
}
- } else if (p_err.error == Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS) {
+ } else if (p_err.error == Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS) {
err_text = "Invalid call to " + p_where + ". Expected " + itos(p_err.argument) + " arguments.";
- } else if (p_err.error == Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS) {
+ } else if (p_err.error == Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS) {
err_text = "Invalid call to " + p_where + ". Expected " + itos(p_err.argument) + " arguments.";
- } else if (p_err.error == Variant::CallError::CALL_ERROR_INVALID_METHOD) {
+ } else if (p_err.error == Callable::CallError::CALL_ERROR_INVALID_METHOD) {
err_text = "Invalid call. Nonexistent " + p_where + ".";
- } else if (p_err.error == Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL) {
+ } else if (p_err.error == Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL) {
err_text = "Attempt to call " + p_where + " on a null instance.";
} else {
err_text = "Bug, call error: #" + itos(p_err.error);
@@ -258,7 +258,7 @@ String GDScriptFunction::_get_call_error(const Variant::CallError &p_err, const
#define OPCODE_OUT break
#endif
-Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_args, int p_argcount, Variant::CallError &r_err, CallState *p_state) {
+Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_args, int p_argcount, Callable::CallError &r_err, CallState *p_state) {
OPCODES_TABLE;
@@ -267,9 +267,10 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
return Variant();
}
- r_err.error = Variant::CallError::CALL_OK;
+ r_err.error = Callable::CallError::CALL_OK;
Variant self;
+ Variant static_ref;
Variant retvalue;
Variant *stack = NULL;
Variant **call_args;
@@ -305,13 +306,13 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
if (p_argcount > _argument_count) {
- r_err.error = Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS;
+ r_err.error = Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS;
r_err.argument = _argument_count;
return Variant();
} else if (p_argcount < _argument_count - _default_arg_count) {
- r_err.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS;
+ r_err.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS;
r_err.argument = _argument_count - _default_arg_count;
return Variant();
} else {
@@ -340,7 +341,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
memnew_placement(&stack[i], Variant);
continue;
} else {
- r_err.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_err.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_err.argument = i;
r_err.expected = argument_types[i].kind == GDScriptDataType::BUILTIN ? argument_types[i].builtin_type : Variant::OBJECT;
return Variant();
@@ -404,10 +405,10 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
#define CHECK_SPACE(m_space) \
GD_ERR_BREAK((ip + m_space) > _code_size)
-#define GET_VARIANT_PTR(m_v, m_code_ofs) \
- Variant *m_v; \
- m_v = _get_variant(_code_ptr[ip + m_code_ofs], p_instance, script, self, stack, err_text); \
- if (unlikely(!m_v)) \
+#define GET_VARIANT_PTR(m_v, m_code_ofs) \
+ Variant *m_v; \
+ m_v = _get_variant(_code_ptr[ip + m_code_ofs], p_instance, script, self, static_ref, stack, err_text); \
+ if (unlikely(!m_v)) \
OPCODE_BREAK;
#else
@@ -415,7 +416,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
#define CHECK_SPACE(m_space)
#define GET_VARIANT_PTR(m_v, m_code_ofs) \
Variant *m_v; \
- m_v = _get_variant(_code_ptr[ip + m_code_ofs], p_instance, script, self, stack, err_text);
+ m_v = _get_variant(_code_ptr[ip + m_code_ofs], p_instance, script, self, static_ref, stack, err_text);
#endif
@@ -791,7 +792,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
#ifdef DEBUG_ENABLED
if (Variant::can_convert_strict(src->get_type(), var_type)) {
#endif // DEBUG_ENABLED
- Variant::CallError ce;
+ Callable::CallError ce;
*dst = Variant::construct(var_type, const_cast<const Variant **>(&src), 1, ce);
} else {
#ifdef DEBUG_ENABLED
@@ -897,11 +898,11 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
GD_ERR_BREAK(to_type < 0 || to_type >= Variant::VARIANT_MAX);
- Variant::CallError err;
+ Callable::CallError err;
*dst = Variant::construct(to_type, (const Variant **)&src, 1, err);
#ifdef DEBUG_ENABLED
- if (err.error != Variant::CallError::CALL_OK) {
+ if (err.error != Callable::CallError::CALL_OK) {
err_text = "Invalid cast: could not convert value to '" + Variant::get_type_name(to_type) + "'.";
OPCODE_BREAK;
}
@@ -1000,11 +1001,11 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
}
GET_VARIANT_PTR(dst, 3 + argc);
- Variant::CallError err;
+ Callable::CallError err;
*dst = Variant::construct(t, (const Variant **)argptrs, argc, err);
#ifdef DEBUG_ENABLED
- if (err.error != Variant::CallError::CALL_OK) {
+ if (err.error != Callable::CallError::CALL_OK) {
err_text = _get_call_error(err, "'" + Variant::get_type_name(t) + "' constructor", (const Variant **)argptrs);
OPCODE_BREAK;
@@ -1091,7 +1092,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
}
#endif
- Variant::CallError err;
+ Callable::CallError err;
if (call_ret) {
GET_VARIANT_PTR(ret, argc);
@@ -1105,7 +1106,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
function_call_time += OS::get_singleton()->get_ticks_usec() - call_time;
}
- if (err.error != Variant::CallError::CALL_OK) {
+ if (err.error != Callable::CallError::CALL_OK) {
String methodstr = *methodname;
String basestr = _get_var_type(base);
@@ -1113,13 +1114,13 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
if (methodstr == "call") {
if (argc >= 1) {
methodstr = String(*argptrs[0]) + " (via call)";
- if (err.error == Variant::CallError::CALL_ERROR_INVALID_ARGUMENT) {
+ if (err.error == Callable::CallError::CALL_ERROR_INVALID_ARGUMENT) {
err.argument += 1;
}
}
} else if (methodstr == "free") {
- if (err.error == Variant::CallError::CALL_ERROR_INVALID_METHOD) {
+ if (err.error == Callable::CallError::CALL_ERROR_INVALID_METHOD) {
if (base->is_ref()) {
err_text = "Attempted to free a reference.";
@@ -1160,12 +1161,12 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
GET_VARIANT_PTR(dst, argc);
- Variant::CallError err;
+ Callable::CallError err;
GDScriptFunctions::call(func, (const Variant **)argptrs, argc, *dst, err);
#ifdef DEBUG_ENABLED
- if (err.error != Variant::CallError::CALL_OK) {
+ if (err.error != Callable::CallError::CALL_OK) {
String methodstr = GDScriptFunctions::get_func_name(func);
if (dst->get_type() == Variant::STRING) {
@@ -1223,7 +1224,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
break;
}
- Variant::CallError err;
+ Callable::CallError err;
if (E) {
@@ -1234,23 +1235,23 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
MethodBind *mb = ClassDB::get_method(gds->native->get_name(), *methodname);
if (!mb) {
- err.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ err.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
} else {
*dst = mb->call(p_instance->owner, (const Variant **)argptrs, argc, err);
}
} else {
- err.error = Variant::CallError::CALL_OK;
+ err.error = Callable::CallError::CALL_OK;
}
} else {
if (*methodname != GDScriptLanguage::get_singleton()->strings._init) {
- err.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ err.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
} else {
- err.error = Variant::CallError::CALL_OK;
+ err.error = Callable::CallError::CALL_OK;
}
}
- if (err.error != Variant::CallError::CALL_OK) {
+ if (err.error != Callable::CallError::CALL_OK) {
String methodstr = *methodname;
err_text = _get_call_error(err, "function '" + methodstr + "'", (const Variant **)argptrs);
@@ -1331,7 +1332,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
OPCODE_BREAK;
}
- Error err = obj->connect(signal, gdfs.ptr(), "_signal_callback", varray(gdfs), Object::CONNECT_ONESHOT);
+ Error err = obj->connect_compat(signal, gdfs.ptr(), "_signal_callback", varray(gdfs), Object::CONNECT_ONESHOT);
if (err != OK) {
err_text = "Error connecting to signal: " + signal + " during yield().";
OPCODE_BREAK;
@@ -1340,7 +1341,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
Object *obj = argobj->operator Object *();
String signal = argname->operator String();
- obj->connect(signal, gdfs.ptr(), "_signal_callback", varray(gdfs), Object::CONNECT_ONESHOT);
+ obj->connect_compat(signal, gdfs.ptr(), "_signal_callback", varray(gdfs), Object::CONNECT_ONESHOT);
#endif
}
@@ -1805,13 +1806,13 @@ GDScriptFunction::~GDScriptFunction() {
/////////////////////
-Variant GDScriptFunctionState::_signal_callback(const Variant **p_args, int p_argcount, Variant::CallError &r_error) {
+Variant GDScriptFunctionState::_signal_callback(const Variant **p_args, int p_argcount, Callable::CallError &r_error) {
Variant arg;
- r_error.error = Variant::CallError::CALL_OK;
+ r_error.error = Callable::CallError::CALL_OK;
if (p_argcount == 0) {
- r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS;
+ r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS;
r_error.argument = 1;
return Variant();
} else if (p_argcount == 1) {
@@ -1829,7 +1830,7 @@ Variant GDScriptFunctionState::_signal_callback(const Variant **p_args, int p_ar
Ref<GDScriptFunctionState> self = *p_args[p_argcount - 1];
if (self.is_null()) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = p_argcount - 1;
r_error.expected = Variant::OBJECT;
return Variant();
@@ -1864,7 +1865,7 @@ Variant GDScriptFunctionState::resume(const Variant &p_arg) {
}
state.result = p_arg;
- Variant::CallError err;
+ Callable::CallError err;
Variant ret = function->call(NULL, NULL, 0, err, &state);
bool completed = true;
diff --git a/modules/gdscript/gdscript_function.h b/modules/gdscript/gdscript_function.h
index 7b7bcbaac9..34019e563d 100644
--- a/modules/gdscript/gdscript_function.h
+++ b/modules/gdscript/gdscript_function.h
@@ -265,8 +265,8 @@ private:
List<StackDebug> stack_debug;
- _FORCE_INLINE_ Variant *_get_variant(int p_address, GDScriptInstance *p_instance, GDScript *p_script, Variant &self, Variant *p_stack, String &r_error) const;
- _FORCE_INLINE_ String _get_call_error(const Variant::CallError &p_err, const String &p_where, const Variant **argptrs) const;
+ _FORCE_INLINE_ Variant *_get_variant(int p_address, GDScriptInstance *p_instance, GDScript *p_script, Variant &self, Variant &static_ref, Variant *p_stack, String &r_error) const;
+ _FORCE_INLINE_ String _get_call_error(const Callable::CallError &p_err, const String &p_where, const Variant **argptrs) const;
friend class GDScriptLanguage;
@@ -339,7 +339,7 @@ public:
return default_arguments[p_idx];
}
- Variant call(GDScriptInstance *p_instance, const Variant **p_args, int p_argcount, Variant::CallError &r_err, CallState *p_state = NULL);
+ Variant call(GDScriptInstance *p_instance, const Variant **p_args, int p_argcount, Callable::CallError &r_err, CallState *p_state = NULL);
_FORCE_INLINE_ MultiplayerAPI::RPCMode get_rpc_mode() const { return rpc_mode; }
GDScriptFunction();
@@ -352,7 +352,7 @@ class GDScriptFunctionState : public Reference {
friend class GDScriptFunction;
GDScriptFunction *function;
GDScriptFunction::CallState state;
- Variant _signal_callback(const Variant **p_args, int p_argcount, Variant::CallError &r_error);
+ Variant _signal_callback(const Variant **p_args, int p_argcount, Callable::CallError &r_error);
Ref<GDScriptFunctionState> first_state;
protected:
diff --git a/modules/gdscript/gdscript_functions.cpp b/modules/gdscript/gdscript_functions.cpp
index a46337d7dd..aaa308f40f 100644
--- a/modules/gdscript/gdscript_functions.cpp
+++ b/modules/gdscript/gdscript_functions.cpp
@@ -139,32 +139,32 @@ const char *GDScriptFunctions::get_func_name(Function p_func) {
return _names[p_func];
}
-void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_count, Variant &r_ret, Variant::CallError &r_error) {
+void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_count, Variant &r_ret, Callable::CallError &r_error) {
- r_error.error = Variant::CallError::CALL_OK;
+ r_error.error = Callable::CallError::CALL_OK;
#ifdef DEBUG_ENABLED
-#define VALIDATE_ARG_COUNT(m_count) \
- if (p_arg_count < m_count) { \
- r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; \
- r_error.argument = m_count; \
- r_ret = Variant(); \
- return; \
- } \
- if (p_arg_count > m_count) { \
- r_error.error = Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; \
- r_error.argument = m_count; \
- r_ret = Variant(); \
- return; \
+#define VALIDATE_ARG_COUNT(m_count) \
+ if (p_arg_count < m_count) { \
+ r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; \
+ r_error.argument = m_count; \
+ r_ret = Variant(); \
+ return; \
+ } \
+ if (p_arg_count > m_count) { \
+ r_error.error = Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; \
+ r_error.argument = m_count; \
+ r_ret = Variant(); \
+ return; \
}
-#define VALIDATE_ARG_NUM(m_arg) \
- if (!p_args[m_arg]->is_num()) { \
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; \
- r_error.argument = m_arg; \
- r_error.expected = Variant::REAL; \
- r_ret = Variant(); \
- return; \
+#define VALIDATE_ARG_NUM(m_arg) \
+ if (!p_args[m_arg]->is_num()) { \
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; \
+ r_error.argument = m_arg; \
+ r_error.expected = Variant::FLOAT; \
+ r_ret = Variant(); \
+ return; \
}
#else
@@ -272,15 +272,15 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
int64_t i = *p_args[0];
r_ret = ABS(i);
- } else if (p_args[0]->get_type() == Variant::REAL) {
+ } else if (p_args[0]->get_type() == Variant::FLOAT) {
double r = *p_args[0];
r_ret = Math::abs(r);
} else {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
- r_error.expected = Variant::REAL;
+ r_error.expected = Variant::FLOAT;
r_ret = Variant();
}
} break;
@@ -290,15 +290,15 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
int64_t i = *p_args[0];
r_ret = i < 0 ? -1 : (i > 0 ? +1 : 0);
- } else if (p_args[0]->get_type() == Variant::REAL) {
+ } else if (p_args[0]->get_type() == Variant::FLOAT) {
real_t r = *p_args[0];
r_ret = r < 0.0 ? -1.0 : (r > 0.0 ? +1.0 : 0.0);
} else {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
- r_error.expected = Variant::REAL;
+ r_error.expected = Variant::FLOAT;
r_ret = Variant();
}
} break;
@@ -360,12 +360,12 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
VALIDATE_ARG_COUNT(3);
VALIDATE_ARG_NUM(2);
const double t = (double)*p_args[2];
- switch (p_args[0]->get_type() == p_args[1]->get_type() ? p_args[0]->get_type() : Variant::REAL) {
+ switch (p_args[0]->get_type() == p_args[1]->get_type() ? p_args[0]->get_type() : Variant::FLOAT) {
case Variant::VECTOR2: {
r_ret = ((Vector2)*p_args[0]).linear_interpolate((Vector2)*p_args[1], t);
} break;
case Variant::VECTOR3: {
- r_ret = ((Vector3)*p_args[0]).linear_interpolate((Vector3)*p_args[1], t);
+ r_ret = (p_args[0]->operator Vector3()).linear_interpolate(p_args[1]->operator Vector3(), t);
} break;
case Variant::COLOR: {
r_ret = ((Color)*p_args[0]).linear_interpolate((Color)*p_args[1], t);
@@ -585,7 +585,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
Ref<WeakRef> wref = memnew(WeakRef);
r_ret = wref;
} else {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
r_error.expected = Variant::OBJECT;
r_ret = Variant();
@@ -596,7 +596,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
VALIDATE_ARG_COUNT(2);
if (p_args[0]->get_type() != Variant::OBJECT) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
r_error.expected = Variant::OBJECT;
r_ret = Variant();
@@ -604,7 +604,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
}
if (p_args[1]->get_type() != Variant::STRING && p_args[1]->get_type() != Variant::NODE_PATH) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 1;
r_error.expected = Variant::STRING;
r_ret = Variant();
@@ -626,7 +626,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
if (type < 0 || type >= Variant::VARIANT_MAX) {
r_ret = RTR("Invalid type argument to convert(), use TYPE_* constants.");
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
r_error.expected = Variant::INT;
return;
@@ -660,7 +660,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
if (p_args[0]->get_type() != Variant::STRING) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
r_error.expected = Variant::STRING;
r_ret = Variant();
@@ -671,7 +671,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
if (str.length() != 1) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
r_error.expected = Variant::STRING;
r_ret = RTR("Expected a string of length 1 (a character).");
@@ -683,7 +683,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
} break;
case TEXT_STR: {
if (p_arg_count < 1) {
- r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS;
+ r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS;
r_error.argument = 1;
r_ret = Variant();
@@ -785,7 +785,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
case PUSH_ERROR: {
VALIDATE_ARG_COUNT(1);
if (p_args[0]->get_type() != Variant::STRING) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
r_error.expected = Variant::STRING;
r_ret = Variant();
@@ -799,7 +799,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
case PUSH_WARNING: {
VALIDATE_ARG_COUNT(1);
if (p_args[0]->get_type() != Variant::STRING) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
r_error.expected = Variant::STRING;
r_ret = Variant();
@@ -819,7 +819,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
case STR_TO_VAR: {
VALIDATE_ARG_COUNT(1);
if (p_args[0]->get_type() != Variant::STRING) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
r_error.expected = Variant::STRING;
r_ret = Variant();
@@ -837,17 +837,17 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
case VAR_TO_BYTES: {
bool full_objects = false;
if (p_arg_count < 1) {
- r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS;
+ r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS;
r_error.argument = 1;
r_ret = Variant();
return;
} else if (p_arg_count > 2) {
- r_error.error = Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS;
+ r_error.error = Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS;
r_error.argument = 2;
r_ret = Variant();
} else if (p_arg_count == 2) {
if (p_args[1]->get_type() != Variant::BOOL) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 1;
r_error.expected = Variant::BOOL;
r_ret = Variant();
@@ -856,11 +856,11 @@ 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) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
r_error.expected = Variant::NIL;
r_ret = "Unexpected error encoding variable to bytes, likely unserializable type found (Object or RID).";
@@ -869,25 +869,25 @@ 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;
case BYTES_TO_VAR: {
bool allow_objects = false;
if (p_arg_count < 1) {
- r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS;
+ r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS;
r_error.argument = 1;
r_ret = Variant();
return;
} else if (p_arg_count > 2) {
- r_error.error = Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS;
+ r_error.error = Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS;
r_error.argument = 2;
r_ret = Variant();
} else if (p_arg_count == 2) {
if (p_args[1]->get_type() != Variant::BOOL) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 1;
r_error.expected = Variant::BOOL;
r_ret = Variant();
@@ -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) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ if (p_args[0]->get_type() != Variant::PACKED_BYTE_ARRAY) {
+ r_error.error = Callable::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.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
- r_error.expected = Variant::POOL_BYTE_ARRAY;
+ r_error.expected = Variant::PACKED_BYTE_ARRAY;
return;
}
}
@@ -927,7 +927,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
case 0: {
- r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS;
+ r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS;
r_error.argument = 1;
r_ret = Variant();
@@ -943,7 +943,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
}
Error err = arr.resize(count);
if (err != OK) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
r_ret = Variant();
return;
}
@@ -969,7 +969,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
}
Error err = arr.resize(to - from);
if (err != OK) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
r_ret = Variant();
return;
}
@@ -989,7 +989,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
if (incr == 0) {
r_ret = RTR("Step argument is zero!");
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
return;
}
@@ -1016,7 +1016,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
Error err = arr.resize(count);
if (err != OK) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
r_ret = Variant();
return;
}
@@ -1038,7 +1038,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
} break;
default: {
- r_error.error = Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS;
+ r_error.error = Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS;
r_error.argument = 3;
r_ret = Variant();
@@ -1049,7 +1049,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
case RESOURCE_LOAD: {
VALIDATE_ARG_COUNT(1);
if (p_args[0]->get_type() != Variant::STRING) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
r_error.expected = Variant::STRING;
r_ret = Variant();
@@ -1065,7 +1065,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
if (p_args[0]->get_type() == Variant::NIL) {
r_ret = Variant();
} else if (p_args[0]->get_type() != Variant::OBJECT) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
r_ret = Variant();
} else {
@@ -1076,7 +1076,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
} else if (!obj->get_script_instance() || obj->get_script_instance()->get_language() != GDScriptLanguage::get_singleton()) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
r_error.expected = Variant::DICTIONARY;
r_ret = RTR("Not a script with an instance");
@@ -1087,7 +1087,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
Ref<GDScript> base = ins->get_script();
if (base.is_null()) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
r_error.expected = Variant::DICTIONARY;
r_ret = RTR("Not based on a script");
@@ -1105,7 +1105,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
sname.invert();
if (!p->path.is_resource_file()) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
r_error.expected = Variant::DICTIONARY;
r_ret = Variant();
@@ -1137,7 +1137,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
if (p_args[0]->get_type() != Variant::DICTIONARY) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
r_error.expected = Variant::DICTIONARY;
r_ret = Variant();
@@ -1149,7 +1149,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
if (!d.has("@path")) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
r_error.expected = Variant::OBJECT;
r_ret = RTR("Invalid instance dictionary format (missing @path)");
@@ -1160,7 +1160,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
Ref<Script> scr = ResourceLoader::load(d["@path"]);
if (!scr.is_valid()) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
r_error.expected = Variant::OBJECT;
r_ret = RTR("Invalid instance dictionary format (can't load script at @path)");
@@ -1171,7 +1171,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
if (!gdscr.is_valid()) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
r_error.expected = Variant::OBJECT;
r_ret = Variant();
@@ -1189,7 +1189,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
gdscr = gdscr->subclasses[sub.get_name(i)];
if (!gdscr.is_valid()) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
r_error.expected = Variant::OBJECT;
r_ret = Variant();
@@ -1215,7 +1215,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
VALIDATE_ARG_COUNT(1);
if (p_args[0]->get_type() != Variant::STRING) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
r_error.expected = Variant::STRING;
r_ret = Variant();
@@ -1239,7 +1239,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
VALIDATE_ARG_COUNT(1);
if (p_args[0]->get_type() != Variant::STRING) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
r_error.expected = Variant::STRING;
r_ret = Variant();
@@ -1271,14 +1271,14 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
case COLOR8: {
if (p_arg_count < 3) {
- r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS;
+ r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS;
r_error.argument = 3;
r_ret = Variant();
return;
}
if (p_arg_count > 4) {
- r_error.error = Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS;
+ r_error.error = Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS;
r_error.argument = 4;
r_ret = Variant();
@@ -1302,21 +1302,21 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
case COLORN: {
if (p_arg_count < 1) {
- r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS;
+ r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS;
r_error.argument = 1;
r_ret = Variant();
return;
}
if (p_arg_count > 2) {
- r_error.error = Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS;
+ r_error.error = Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS;
r_error.argument = 2;
r_ret = Variant();
return;
}
if (p_args[0]->get_type() != Variant::STRING) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
r_ret = Variant();
} else {
@@ -1359,8 +1359,8 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
case INSTANCE_FROM_ID: {
VALIDATE_ARG_COUNT(1);
- if (p_args[0]->get_type() != Variant::INT && p_args[0]->get_type() != Variant::REAL) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ if (p_args[0]->get_type() != Variant::INT && p_args[0]->get_type() != Variant::FLOAT) {
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
r_error.expected = Variant::INT;
r_ret = Variant();
@@ -1390,43 +1390,53 @@ 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_INT32_ARRAY: {
- PoolVector<int> d = *p_args[0];
+ Vector<int32_t> d = *p_args[0];
r_ret = d.size();
} break;
- case Variant::POOL_REAL_ARRAY: {
+ case Variant::PACKED_INT64_ARRAY: {
- PoolVector<real_t> d = *p_args[0];
+ Vector<int64_t> d = *p_args[0];
r_ret = d.size();
} break;
- case Variant::POOL_STRING_ARRAY: {
+ case Variant::PACKED_FLOAT32_ARRAY: {
- PoolVector<String> d = *p_args[0];
+ Vector<float> d = *p_args[0];
r_ret = d.size();
} break;
- case Variant::POOL_VECTOR2_ARRAY: {
+ case Variant::PACKED_FLOAT64_ARRAY: {
- PoolVector<Vector2> d = *p_args[0];
+ Vector<double> d = *p_args[0];
r_ret = d.size();
} break;
- case Variant::POOL_VECTOR3_ARRAY: {
+ case Variant::PACKED_STRING_ARRAY: {
- PoolVector<Vector3> d = *p_args[0];
+ Vector<String> d = *p_args[0];
r_ret = d.size();
} break;
- case Variant::POOL_COLOR_ARRAY: {
+ case Variant::PACKED_VECTOR2_ARRAY: {
- PoolVector<Color> d = *p_args[0];
+ Vector<Vector2> d = *p_args[0];
+ r_ret = d.size();
+ } break;
+ case Variant::PACKED_VECTOR3_ARRAY: {
+
+ Vector<Vector3> d = *p_args[0];
+ r_ret = d.size();
+ } break;
+ case Variant::PACKED_COLOR_ARRAY: {
+
+ Vector<Color> d = *p_args[0];
r_ret = d.size();
} break;
default: {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
r_error.expected = Variant::OBJECT;
r_ret = Variant();
@@ -1530,69 +1540,69 @@ MethodInfo GDScriptFunctions::get_info(Function p_func) {
switch (p_func) {
case MATH_SIN: {
- MethodInfo mi("sin", PropertyInfo(Variant::REAL, "s"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("sin", PropertyInfo(Variant::FLOAT, "s"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case MATH_COS: {
- MethodInfo mi("cos", PropertyInfo(Variant::REAL, "s"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("cos", PropertyInfo(Variant::FLOAT, "s"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case MATH_TAN: {
- MethodInfo mi("tan", PropertyInfo(Variant::REAL, "s"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("tan", PropertyInfo(Variant::FLOAT, "s"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case MATH_SINH: {
- MethodInfo mi("sinh", PropertyInfo(Variant::REAL, "s"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("sinh", PropertyInfo(Variant::FLOAT, "s"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case MATH_COSH: {
- MethodInfo mi("cosh", PropertyInfo(Variant::REAL, "s"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("cosh", PropertyInfo(Variant::FLOAT, "s"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case MATH_TANH: {
- MethodInfo mi("tanh", PropertyInfo(Variant::REAL, "s"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("tanh", PropertyInfo(Variant::FLOAT, "s"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case MATH_ASIN: {
- MethodInfo mi("asin", PropertyInfo(Variant::REAL, "s"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("asin", PropertyInfo(Variant::FLOAT, "s"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case MATH_ACOS: {
- MethodInfo mi("acos", PropertyInfo(Variant::REAL, "s"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("acos", PropertyInfo(Variant::FLOAT, "s"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case MATH_ATAN: {
- MethodInfo mi("atan", PropertyInfo(Variant::REAL, "s"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("atan", PropertyInfo(Variant::FLOAT, "s"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case MATH_ATAN2: {
- MethodInfo mi("atan2", PropertyInfo(Variant::REAL, "y"), PropertyInfo(Variant::REAL, "x"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("atan2", PropertyInfo(Variant::FLOAT, "y"), PropertyInfo(Variant::FLOAT, "x"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case MATH_SQRT: {
- MethodInfo mi("sqrt", PropertyInfo(Variant::REAL, "s"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("sqrt", PropertyInfo(Variant::FLOAT, "s"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case MATH_FMOD: {
- MethodInfo mi("fmod", PropertyInfo(Variant::REAL, "a"), PropertyInfo(Variant::REAL, "b"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("fmod", PropertyInfo(Variant::FLOAT, "a"), PropertyInfo(Variant::FLOAT, "b"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case MATH_FPOSMOD: {
- MethodInfo mi("fposmod", PropertyInfo(Variant::REAL, "a"), PropertyInfo(Variant::REAL, "b"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("fposmod", PropertyInfo(Variant::FLOAT, "a"), PropertyInfo(Variant::FLOAT, "b"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case MATH_POSMOD: {
@@ -1601,114 +1611,114 @@ MethodInfo GDScriptFunctions::get_info(Function p_func) {
return mi;
} break;
case MATH_FLOOR: {
- MethodInfo mi("floor", PropertyInfo(Variant::REAL, "s"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("floor", PropertyInfo(Variant::FLOAT, "s"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case MATH_CEIL: {
- MethodInfo mi("ceil", PropertyInfo(Variant::REAL, "s"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("ceil", PropertyInfo(Variant::FLOAT, "s"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case MATH_ROUND: {
- MethodInfo mi("round", PropertyInfo(Variant::REAL, "s"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("round", PropertyInfo(Variant::FLOAT, "s"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case MATH_ABS: {
- MethodInfo mi("abs", PropertyInfo(Variant::REAL, "s"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("abs", PropertyInfo(Variant::FLOAT, "s"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case MATH_SIGN: {
- MethodInfo mi("sign", PropertyInfo(Variant::REAL, "s"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("sign", PropertyInfo(Variant::FLOAT, "s"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case MATH_POW: {
- MethodInfo mi("pow", PropertyInfo(Variant::REAL, "base"), PropertyInfo(Variant::REAL, "exp"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("pow", PropertyInfo(Variant::FLOAT, "base"), PropertyInfo(Variant::FLOAT, "exp"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case MATH_LOG: {
- MethodInfo mi("log", PropertyInfo(Variant::REAL, "s"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("log", PropertyInfo(Variant::FLOAT, "s"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case MATH_EXP: {
- MethodInfo mi("exp", PropertyInfo(Variant::REAL, "s"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("exp", PropertyInfo(Variant::FLOAT, "s"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case MATH_ISNAN: {
- MethodInfo mi("is_nan", PropertyInfo(Variant::REAL, "s"));
+ MethodInfo mi("is_nan", PropertyInfo(Variant::FLOAT, "s"));
mi.return_val.type = Variant::BOOL;
return mi;
} break;
case MATH_ISINF: {
- MethodInfo mi("is_inf", PropertyInfo(Variant::REAL, "s"));
+ MethodInfo mi("is_inf", PropertyInfo(Variant::FLOAT, "s"));
mi.return_val.type = Variant::BOOL;
return mi;
} break;
case MATH_ISEQUALAPPROX: {
- MethodInfo mi("is_equal_approx", PropertyInfo(Variant::REAL, "a"), PropertyInfo(Variant::REAL, "b"));
+ MethodInfo mi("is_equal_approx", PropertyInfo(Variant::FLOAT, "a"), PropertyInfo(Variant::FLOAT, "b"));
mi.return_val.type = Variant::BOOL;
return mi;
} break;
case MATH_ISZEROAPPROX: {
- MethodInfo mi("is_zero_approx", PropertyInfo(Variant::REAL, "s"));
+ MethodInfo mi("is_zero_approx", PropertyInfo(Variant::FLOAT, "s"));
mi.return_val.type = Variant::BOOL;
return mi;
} break;
case MATH_EASE: {
- MethodInfo mi("ease", PropertyInfo(Variant::REAL, "s"), PropertyInfo(Variant::REAL, "curve"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("ease", PropertyInfo(Variant::FLOAT, "s"), PropertyInfo(Variant::FLOAT, "curve"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case MATH_STEP_DECIMALS: {
- MethodInfo mi("step_decimals", PropertyInfo(Variant::REAL, "step"));
+ MethodInfo mi("step_decimals", PropertyInfo(Variant::FLOAT, "step"));
mi.return_val.type = Variant::INT;
return mi;
} break;
case MATH_STEPIFY: {
- MethodInfo mi("stepify", PropertyInfo(Variant::REAL, "s"), PropertyInfo(Variant::REAL, "step"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("stepify", PropertyInfo(Variant::FLOAT, "s"), PropertyInfo(Variant::FLOAT, "step"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case MATH_LERP: {
- MethodInfo mi("lerp", PropertyInfo(Variant::NIL, "from"), PropertyInfo(Variant::NIL, "to"), PropertyInfo(Variant::REAL, "weight"));
+ MethodInfo mi("lerp", PropertyInfo(Variant::NIL, "from"), PropertyInfo(Variant::NIL, "to"), PropertyInfo(Variant::FLOAT, "weight"));
mi.return_val.type = Variant::NIL;
mi.return_val.usage |= PROPERTY_USAGE_NIL_IS_VARIANT;
return mi;
} break;
case MATH_LERP_ANGLE: {
- MethodInfo mi("lerp_angle", PropertyInfo(Variant::REAL, "from"), PropertyInfo(Variant::REAL, "to"), PropertyInfo(Variant::REAL, "weight"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("lerp_angle", PropertyInfo(Variant::FLOAT, "from"), PropertyInfo(Variant::FLOAT, "to"), PropertyInfo(Variant::FLOAT, "weight"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case MATH_INVERSE_LERP: {
- MethodInfo mi("inverse_lerp", PropertyInfo(Variant::REAL, "from"), PropertyInfo(Variant::REAL, "to"), PropertyInfo(Variant::REAL, "weight"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("inverse_lerp", PropertyInfo(Variant::FLOAT, "from"), PropertyInfo(Variant::FLOAT, "to"), PropertyInfo(Variant::FLOAT, "weight"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case MATH_RANGE_LERP: {
- MethodInfo mi("range_lerp", PropertyInfo(Variant::REAL, "value"), PropertyInfo(Variant::REAL, "istart"), PropertyInfo(Variant::REAL, "istop"), PropertyInfo(Variant::REAL, "ostart"), PropertyInfo(Variant::REAL, "ostop"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("range_lerp", PropertyInfo(Variant::FLOAT, "value"), PropertyInfo(Variant::FLOAT, "istart"), PropertyInfo(Variant::FLOAT, "istop"), PropertyInfo(Variant::FLOAT, "ostart"), PropertyInfo(Variant::FLOAT, "ostop"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case MATH_SMOOTHSTEP: {
- MethodInfo mi("smoothstep", PropertyInfo(Variant::REAL, "from"), PropertyInfo(Variant::REAL, "to"), PropertyInfo(Variant::REAL, "weight"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("smoothstep", PropertyInfo(Variant::FLOAT, "from"), PropertyInfo(Variant::FLOAT, "to"), PropertyInfo(Variant::FLOAT, "weight"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case MATH_MOVE_TOWARD: {
- MethodInfo mi("move_toward", PropertyInfo(Variant::REAL, "from"), PropertyInfo(Variant::REAL, "to"), PropertyInfo(Variant::REAL, "delta"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("move_toward", PropertyInfo(Variant::FLOAT, "from"), PropertyInfo(Variant::FLOAT, "to"), PropertyInfo(Variant::FLOAT, "delta"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case MATH_DECTIME: {
- MethodInfo mi("dectime", PropertyInfo(Variant::REAL, "value"), PropertyInfo(Variant::REAL, "amount"), PropertyInfo(Variant::REAL, "step"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("dectime", PropertyInfo(Variant::FLOAT, "value"), PropertyInfo(Variant::FLOAT, "amount"), PropertyInfo(Variant::FLOAT, "step"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case MATH_RANDOMIZE: {
@@ -1723,12 +1733,12 @@ MethodInfo GDScriptFunctions::get_info(Function p_func) {
} break;
case MATH_RANDF: {
MethodInfo mi("randf");
- mi.return_val.type = Variant::REAL;
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case MATH_RANDOM: {
- MethodInfo mi("rand_range", PropertyInfo(Variant::REAL, "from"), PropertyInfo(Variant::REAL, "to"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("rand_range", PropertyInfo(Variant::FLOAT, "from"), PropertyInfo(Variant::FLOAT, "to"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case MATH_SEED: {
@@ -1742,32 +1752,32 @@ MethodInfo GDScriptFunctions::get_info(Function p_func) {
return mi;
} break;
case MATH_DEG2RAD: {
- MethodInfo mi("deg2rad", PropertyInfo(Variant::REAL, "deg"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("deg2rad", PropertyInfo(Variant::FLOAT, "deg"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case MATH_RAD2DEG: {
- MethodInfo mi("rad2deg", PropertyInfo(Variant::REAL, "rad"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("rad2deg", PropertyInfo(Variant::FLOAT, "rad"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case MATH_LINEAR2DB: {
- MethodInfo mi("linear2db", PropertyInfo(Variant::REAL, "nrg"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("linear2db", PropertyInfo(Variant::FLOAT, "nrg"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case MATH_DB2LINEAR: {
- MethodInfo mi("db2linear", PropertyInfo(Variant::REAL, "db"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("db2linear", PropertyInfo(Variant::FLOAT, "db"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case MATH_POLAR2CARTESIAN: {
- MethodInfo mi("polar2cartesian", PropertyInfo(Variant::REAL, "r"), PropertyInfo(Variant::REAL, "th"));
+ MethodInfo mi("polar2cartesian", PropertyInfo(Variant::FLOAT, "r"), PropertyInfo(Variant::FLOAT, "th"));
mi.return_val.type = Variant::VECTOR2;
return mi;
} break;
case MATH_CARTESIAN2POLAR: {
- MethodInfo mi("cartesian2polar", PropertyInfo(Variant::REAL, "x"), PropertyInfo(Variant::REAL, "y"));
+ MethodInfo mi("cartesian2polar", PropertyInfo(Variant::FLOAT, "x"), PropertyInfo(Variant::FLOAT, "y"));
mi.return_val.type = Variant::VECTOR2;
return mi;
} break;
@@ -1777,24 +1787,24 @@ MethodInfo GDScriptFunctions::get_info(Function p_func) {
return mi;
} break;
case MATH_WRAPF: {
- MethodInfo mi("wrapf", PropertyInfo(Variant::REAL, "value"), PropertyInfo(Variant::REAL, "min"), PropertyInfo(Variant::REAL, "max"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("wrapf", PropertyInfo(Variant::FLOAT, "value"), PropertyInfo(Variant::FLOAT, "min"), PropertyInfo(Variant::FLOAT, "max"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case LOGIC_MAX: {
- MethodInfo mi("max", PropertyInfo(Variant::REAL, "a"), PropertyInfo(Variant::REAL, "b"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("max", PropertyInfo(Variant::FLOAT, "a"), PropertyInfo(Variant::FLOAT, "b"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case LOGIC_MIN: {
- MethodInfo mi("min", PropertyInfo(Variant::REAL, "a"), PropertyInfo(Variant::REAL, "b"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("min", PropertyInfo(Variant::FLOAT, "a"), PropertyInfo(Variant::FLOAT, "b"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case LOGIC_CLAMP: {
- MethodInfo mi("clamp", PropertyInfo(Variant::REAL, "value"), PropertyInfo(Variant::REAL, "min"), PropertyInfo(Variant::REAL, "max"));
- mi.return_val.type = Variant::REAL;
+ MethodInfo mi("clamp", PropertyInfo(Variant::FLOAT, "value"), PropertyInfo(Variant::FLOAT, "min"), PropertyInfo(Variant::FLOAT, "max"));
+ mi.return_val.type = Variant::FLOAT;
return mi;
} break;
case LOGIC_NEAREST_PO2: {
@@ -1941,12 +1951,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;
@@ -2012,7 +2022,7 @@ MethodInfo GDScriptFunctions::get_info(Function p_func) {
} break;
case COLORN: {
- MethodInfo mi("ColorN", PropertyInfo(Variant::STRING, "name"), PropertyInfo(Variant::REAL, "alpha"));
+ MethodInfo mi("ColorN", PropertyInfo(Variant::STRING, "name"), PropertyInfo(Variant::FLOAT, "alpha"));
mi.default_arguments.push_back(1.0f);
mi.return_val.type = Variant::COLOR;
return mi;
diff --git a/modules/gdscript/gdscript_functions.h b/modules/gdscript/gdscript_functions.h
index 8b97194ed6..2c6dc02913 100644
--- a/modules/gdscript/gdscript_functions.h
+++ b/modules/gdscript/gdscript_functions.h
@@ -129,7 +129,7 @@ public:
};
static const char *get_func_name(Function p_func);
- static void call(Function p_func, const Variant **p_args, int p_arg_count, Variant &r_ret, Variant::CallError &r_error);
+ static void call(Function p_func, const Variant **p_args, int p_arg_count, Variant &r_ret, Callable::CallError &r_error);
static bool is_deterministic(Function p_func);
static MethodInfo get_info(Function p_func);
};
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp
index fae6fbbb0c..0382944efd 100644
--- a/modules/gdscript/gdscript_parser.cpp
+++ b/modules/gdscript/gdscript_parser.cpp
@@ -793,7 +793,7 @@ GDScriptParser::Node *GDScriptParser::_parse_expression(Node *p_parent, bool p_s
}
_add_warning(GDScriptWarning::UNASSIGNED_VARIABLE_OP_ASSIGN, -1, identifier.operator String());
}
- FALLTHROUGH;
+ [[fallthrough]];
}
case GDScriptTokenizer::TK_OP_ASSIGN: {
lv->assignments += 1;
@@ -1739,7 +1739,7 @@ GDScriptParser::Node *GDScriptParser::_reduce_expression(Node *p_node, bool p_to
vptr = (const Variant **)&ptrs[0];
}
- Variant::CallError ce;
+ Callable::CallError ce;
Variant v;
if (op->arguments[0]->type == Node::TYPE_TYPE) {
@@ -1751,7 +1751,7 @@ GDScriptParser::Node *GDScriptParser::_reduce_expression(Node *p_node, bool p_to
GDScriptFunctions::call(func, vptr, ptrs.size(), v, ce);
}
- if (ce.error != Variant::CallError::CALL_OK) {
+ if (ce.error != Callable::CallError::CALL_OK) {
String errwhere;
if (op->arguments[0]->type == Node::TYPE_TYPE) {
@@ -1765,16 +1765,16 @@ GDScriptParser::Node *GDScriptParser::_reduce_expression(Node *p_node, bool p_to
switch (ce.error) {
- case Variant::CallError::CALL_ERROR_INVALID_ARGUMENT: {
+ case Callable::CallError::CALL_ERROR_INVALID_ARGUMENT: {
_set_error("Invalid argument (#" + itos(ce.argument + 1) + ") for " + errwhere + ".");
} break;
- case Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS: {
+ case Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS: {
_set_error("Too many arguments for " + errwhere + ".");
} break;
- case Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS: {
+ case Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS: {
_set_error("Too few arguments for " + errwhere + ".");
} break;
@@ -2766,13 +2766,12 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) {
}
#endif // DEBUG_ENABLED
switch (token) {
- case GDScriptTokenizer::TK_EOF:
+ case GDScriptTokenizer::TK_EOF: {
p_block->end_line = tokenizer->get_token_line();
+ return; // End of file!
+ } break;
case GDScriptTokenizer::TK_ERROR: {
- return; //go back
-
- //end of file!
-
+ return;
} break;
case GDScriptTokenizer::TK_NEWLINE: {
@@ -3109,7 +3108,7 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) {
args.push_back(op->arguments[i]);
if (constant && op->arguments[i]->type == Node::TYPE_CONSTANT) {
ConstantNode *c = static_cast<ConstantNode *>(op->arguments[i]);
- if (c->value.get_type() == Variant::REAL || c->value.get_type() == Variant::INT) {
+ if (c->value.get_type() == Variant::FLOAT || c->value.get_type() == Variant::INT) {
constants.push_back(c->value);
constant = true;
}
@@ -3525,11 +3524,12 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
case GDScriptTokenizer::TK_CURSOR: {
tokenizer->advance();
} break;
- case GDScriptTokenizer::TK_EOF:
+ case GDScriptTokenizer::TK_EOF: {
p_class->end_line = tokenizer->get_token_line();
+ return; // End of file!
+ } break;
case GDScriptTokenizer::TK_ERROR: {
- return; //go back
- //end of file!
+ return; // Go back.
} break;
case GDScriptTokenizer::TK_NEWLINE: {
if (!_parse_newline()) {
@@ -3719,7 +3719,7 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
return;
}
- FALLTHROUGH;
+ [[fallthrough]];
}
case GDScriptTokenizer::TK_PR_FUNCTION: {
@@ -4220,9 +4220,9 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
break;
}
- FALLTHROUGH;
+ [[fallthrough]];
}
- case Variant::REAL: {
+ case Variant::FLOAT: {
if (tokenizer->get_token() == GDScriptTokenizer::TK_IDENTIFIER && tokenizer->get_token_identifier() == "EASE") {
current_export.hint = PROPERTY_HINT_EXP_EASING;
@@ -4809,7 +4809,7 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
}
#ifdef TOOLS_ENABLED
- Variant::CallError ce;
+ Callable::CallError ce;
member.default_value = Variant::construct(member._export.type, NULL, 0, ce);
#endif
@@ -4878,7 +4878,7 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
if (cn->value.get_type() != Variant::NIL) {
if (member._export.type != Variant::NIL && cn->value.get_type() != member._export.type) {
if (Variant::can_convert(cn->value.get_type(), member._export.type)) {
- Variant::CallError err;
+ Callable::CallError err;
const Variant *args = &cn->value;
cn->value = Variant::construct(member._export.type, &args, 1, err);
} else {
@@ -5489,7 +5489,7 @@ String GDScriptParser::DataType::to_string() const {
if (!gds_class.empty()) {
return gds_class;
}
- FALLTHROUGH;
+ [[fallthrough]];
}
case SCRIPT: {
if (is_meta_type) {
@@ -5933,9 +5933,9 @@ GDScriptParser::DataType GDScriptParser::_get_operation_type(const Variant::Oper
a_ref.instance();
a = a_ref;
} else {
- Variant::CallError err;
+ Callable::CallError err;
a = Variant::construct(a_type, NULL, 0, err);
- if (err.error != Variant::CallError::CALL_OK) {
+ if (err.error != Callable::CallError::CALL_OK) {
r_valid = false;
return DataType();
}
@@ -5946,19 +5946,19 @@ GDScriptParser::DataType GDScriptParser::_get_operation_type(const Variant::Oper
b_ref.instance();
b = b_ref;
} else {
- Variant::CallError err;
+ Callable::CallError err;
b = Variant::construct(b_type, NULL, 0, err);
- if (err.error != Variant::CallError::CALL_OK) {
+ if (err.error != Callable::CallError::CALL_OK) {
r_valid = false;
return DataType();
}
}
// Avoid division by zero
- if (a_type == Variant::INT || a_type == Variant::REAL) {
+ if (a_type == Variant::INT || a_type == Variant::FLOAT) {
Variant::evaluate(Variant::OP_ADD, a, 1, a, r_valid);
}
- if (b_type == Variant::INT || b_type == Variant::REAL) {
+ if (b_type == Variant::INT || b_type == Variant::FLOAT) {
Variant::evaluate(Variant::OP_ADD, b, 1, b, r_valid);
}
if (a_type == Variant::STRING && b_type != Variant::ARRAY) {
@@ -6218,7 +6218,7 @@ GDScriptParser::Node *GDScriptParser::_get_default_value_for_type(const DataType
result = alloc_node<DictionaryNode>();
} else {
ConstantNode *c = alloc_node<ConstantNode>();
- Variant::CallError err;
+ Callable::CallError err;
c->value = Variant::construct(p_type.builtin_type, NULL, 0, err);
result = c;
}
@@ -6531,7 +6531,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) {
result.has_type = false;
} break;
default: {
- Variant::CallError err;
+ Callable::CallError err;
Variant temp = Variant::construct(base_type.builtin_type, NULL, 0, err);
bool valid = false;
@@ -6596,16 +6596,18 @@ 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_INT32_ARRAY:
+ case Variant::PACKED_INT64_ARRAY:
+ case Variant::PACKED_FLOAT32_ARRAY:
+ case Variant::PACKED_FLOAT64_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;
+ error = index_type.builtin_type != Variant::INT && index_type.builtin_type != Variant::FLOAT;
} break;
// Expect String only
case Variant::RECT2:
@@ -6621,7 +6623,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) {
case Variant::TRANSFORM2D:
case Variant::BASIS:
case Variant::TRANSFORM: {
- error = index_type.builtin_type != Variant::INT && index_type.builtin_type != Variant::REAL &&
+ error = index_type.builtin_type != Variant::INT && index_type.builtin_type != Variant::FLOAT &&
index_type.builtin_type != Variant::STRING;
} break;
// Expect String or int
@@ -6646,17 +6648,19 @@ 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_INT32_ARRAY:
+ case Variant::PACKED_INT64_ARRAY:
+ case Variant::PACKED_FLOAT32_ARRAY:
+ case Variant::PACKED_FLOAT64_ARRAY:
+ case Variant::PACKED_STRING_ARRAY:
+ case Variant::PACKED_VECTOR2_ARRAY:
+ case Variant::PACKED_VECTOR3_ARRAY: {
break;
}
default: {
- Variant::CallError err;
+ Callable::CallError err;
Variant temp = Variant::construct(base_type.builtin_type, NULL, 0, err);
bool valid = false;
@@ -6691,41 +6695,43 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) {
case Variant::NIL:
case Variant::BOOL:
case Variant::INT:
- case Variant::REAL:
+ case Variant::FLOAT:
case Variant::NODE_PATH:
case Variant::_RID: {
_set_error("Can't index on a value of type \"" + base_type.to_string() + "\".", op->line);
return DataType();
} break;
// Return int
- case Variant::POOL_BYTE_ARRAY:
- case Variant::POOL_INT_ARRAY: {
+ case Variant::PACKED_BYTE_ARRAY:
+ case Variant::PACKED_INT32_ARRAY:
+ case Variant::PACKED_INT64_ARRAY: {
result.builtin_type = Variant::INT;
} break;
// Return real
- case Variant::POOL_REAL_ARRAY:
+ case Variant::PACKED_FLOAT32_ARRAY:
+ case Variant::PACKED_FLOAT64_ARRAY:
case Variant::VECTOR2:
case Variant::VECTOR3:
case Variant::QUAT: {
- result.builtin_type = Variant::REAL;
+ result.builtin_type = Variant::FLOAT;
} 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;
@@ -7002,7 +7008,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_function_call_type(const Operat
break;
} else {
#ifdef DEBUG_ENABLED
- if (arg_type.kind == DataType::BUILTIN && arg_type.builtin_type == Variant::INT && par_types[i].kind == DataType::BUILTIN && par_types[i].builtin_type == Variant::REAL) {
+ if (arg_type.kind == DataType::BUILTIN && arg_type.builtin_type == Variant::INT && par_types[i].kind == DataType::BUILTIN && par_types[i].builtin_type == Variant::FLOAT) {
_add_warning(GDScriptWarning::NARROWING_CONVERSION, p_call->line, Variant::get_type_name(tn->vtype));
}
if (par_types[i].may_yield && p_call->arguments[i + 1]->type == Node::TYPE_OPERATOR) {
@@ -7095,7 +7101,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_function_call_type(const Operat
}
if (base_type.kind == DataType::BUILTIN) {
- Variant::CallError err;
+ Callable::CallError err;
Variant tmp = Variant::construct(base_type.builtin_type, NULL, 0, err);
if (check_types) {
@@ -7245,7 +7251,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_function_call_type(const Operat
_mark_line_as_unsafe(p_call->line);
}
} else {
- if (arg_type.kind == DataType::BUILTIN && arg_type.builtin_type == Variant::INT && par_type.kind == DataType::BUILTIN && par_type.builtin_type == Variant::REAL) {
+ if (arg_type.kind == DataType::BUILTIN && arg_type.builtin_type == Variant::INT && par_type.kind == DataType::BUILTIN && par_type.builtin_type == Variant::FLOAT) {
_add_warning(GDScriptWarning::NARROWING_CONVERSION, p_call->line, callee_name);
}
}
@@ -8103,7 +8109,7 @@ void GDScriptParser::_check_block_types(BlockNode *p_block) {
lv->assign = convert_call;
lv->assign_op->arguments.write[1] = convert_call;
#ifdef DEBUG_ENABLED
- if (lv->datatype.builtin_type == Variant::INT && assign_type.builtin_type == Variant::REAL) {
+ if (lv->datatype.builtin_type == Variant::INT && assign_type.builtin_type == Variant::FLOAT) {
_add_warning(GDScriptWarning::NARROWING_CONVERSION, lv->line);
}
#endif // DEBUG_ENABLED
@@ -8240,7 +8246,7 @@ void GDScriptParser::_check_block_types(BlockNode *p_block) {
type_match = true; // Since we are converting, the type is matching
}
#ifdef DEBUG_ENABLED
- if (lh_type.builtin_type == Variant::INT && rh_type.builtin_type == Variant::REAL) {
+ if (lh_type.builtin_type == Variant::INT && rh_type.builtin_type == Variant::FLOAT) {
_add_warning(GDScriptWarning::NARROWING_CONVERSION, op->line);
}
#endif // DEBUG_ENABLED
@@ -8345,7 +8351,7 @@ void GDScriptParser::_check_block_types(BlockNode *p_block) {
if (cn->value.get_type() == Variant::STRING) {
break;
}
- FALLTHROUGH;
+ [[fallthrough]];
}
default: {
_mark_line_as_safe(statement->line);
diff --git a/modules/gdscript/gdscript_tokenizer.cpp b/modules/gdscript/gdscript_tokenizer.cpp
index a0e0811c1f..9064998d32 100644
--- a/modules/gdscript/gdscript_tokenizer.cpp
+++ b/modules/gdscript/gdscript_tokenizer.cpp
@@ -146,12 +146,15 @@ static const _bit _type_list[] = {
//types
{ Variant::BOOL, "bool" },
{ Variant::INT, "int" },
- { Variant::REAL, "float" },
+ { Variant::FLOAT, "float" },
{ Variant::STRING, "String" },
{ Variant::VECTOR2, "Vector2" },
+ { Variant::VECTOR2I, "Vector2i" },
{ Variant::RECT2, "Rect2" },
+ { Variant::RECT2I, "Rect2i" },
{ Variant::TRANSFORM2D, "Transform2D" },
{ Variant::VECTOR3, "Vector3" },
+ { Variant::VECTOR3I, "Vector3i" },
{ Variant::AABB, "AABB" },
{ Variant::PLANE, "Plane" },
{ Variant::QUAT, "Quat" },
@@ -160,16 +163,21 @@ static const _bit _type_list[] = {
{ Variant::COLOR, "Color" },
{ Variant::_RID, "RID" },
{ Variant::OBJECT, "Object" },
+ { Variant::STRING_NAME, "StringName" },
{ Variant::NODE_PATH, "NodePath" },
{ Variant::DICTIONARY, "Dictionary" },
+ { Variant::CALLABLE, "Callable" },
+ { Variant::SIGNAL, "Signal" },
{ 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_INT32_ARRAY, "PackedInt32Array" },
+ { Variant::PACKED_INT64_ARRAY, "PackedInt64Array" },
+ { Variant::PACKED_FLOAT32_ARRAY, "PackedFloat32Array" },
+ { Variant::PACKED_FLOAT64_ARRAY, "PackedFloat64Array" },
+ { Variant::PACKED_STRING_ARRAY, "PackedStringArray" },
+ { Variant::PACKED_VECTOR2_ARRAY, "PackedVector2Array" },
+ { Variant::PACKED_VECTOR3_ARRAY, "PackedVector3Array" },
+ { Variant::PACKED_COLOR_ARRAY, "PackedColorArray" },
{ Variant::VARIANT_MAX, NULL },
};
@@ -337,7 +345,7 @@ StringName GDScriptTokenizer::get_token_literal(int p_offset) const {
default: {
}
}
- }
+ } break;
case TK_OP_AND:
case TK_OP_OR:
break; // Don't get into default, since they can be non-literal
@@ -475,7 +483,7 @@ void GDScriptTokenizerText::_advance() {
}
while (true) {
- bool is_node_path = false;
+ bool is_string_name = false;
StringMode string_mode = STRING_DOUBLE_QUOTE;
switch (GETCHAR(0)) {
@@ -533,7 +541,7 @@ void GDScriptTokenizerText::_advance() {
ignore_warnings = true;
}
#endif // DEBUG_ENABLED
- FALLTHROUGH;
+ [[fallthrough]];
}
case '\n': {
line++;
@@ -749,8 +757,8 @@ void GDScriptTokenizerText::_advance() {
return;
}
INCPOS(1);
- is_node_path = true;
- FALLTHROUGH;
+ is_string_name = true;
+ [[fallthrough]];
case '\'':
case '"': {
@@ -860,8 +868,8 @@ void GDScriptTokenizerText::_advance() {
}
INCPOS(i);
- if (is_node_path) {
- _make_constant(NodePath(str));
+ if (is_string_name) {
+ _make_constant(StringName(str));
} else {
_make_constant(str);
}
diff --git a/modules/gdscript/language_server/gdscript_language_protocol.cpp b/modules/gdscript/language_server/gdscript_language_protocol.cpp
index 7133c6b4be..2243a7b81d 100644
--- a/modules/gdscript/language_server/gdscript_language_protocol.cpp
+++ b/modules/gdscript/language_server/gdscript_language_protocol.cpp
@@ -32,32 +32,107 @@
#include "core/io/json.h"
#include "core/os/copymem.h"
#include "core/project_settings.h"
+#include "editor/editor_log.h"
#include "editor/editor_node.h"
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;
- if (OK == peer->get_packet_buffer(data)) {
- String message;
- message.parse_utf8((const char *)data.read().ptr(), data.size());
- if (message.begins_with("Content-Length:")) return;
- String output = process_message(message);
+Error GDScriptLanguageProtocol::LSPeer::handle_data() {
+ int read = 0;
+ // Read headers
+ if (!has_header) {
+ while (true) {
+ if (req_pos >= LSP_MAX_BUFFER_SIZE) {
+ req_pos = 0;
+ ERR_FAIL_COND_V_MSG(true, ERR_OUT_OF_MEMORY, "Response header too big");
+ }
+ Error err = connection->get_partial_data(&req_buf[req_pos], 1, read);
+ if (err != OK)
+ return FAILED;
+ else if (read != 1) // Busy, wait until next poll
+ return ERR_BUSY;
+ char *r = (char *)req_buf;
+ int l = req_pos;
+
+ // End of headers
+ if (l > 3 && r[l] == '\n' && r[l - 1] == '\r' && r[l - 2] == '\n' && r[l - 3] == '\r') {
+ r[l - 3] = '\0'; // Null terminate to read string
+ String header;
+ header.parse_utf8(r);
+ content_length = header.substr(16).to_int();
+ has_header = true;
+ req_pos = 0;
+ break;
+ }
+ req_pos++;
+ }
+ }
+ if (has_header) {
+ while (req_pos < content_length) {
+ if (req_pos >= LSP_MAX_BUFFER_SIZE) {
+ req_pos = 0;
+ has_header = false;
+ ERR_FAIL_COND_V_MSG(req_pos >= LSP_MAX_BUFFER_SIZE, ERR_OUT_OF_MEMORY, "Response content too big");
+ }
+ Error err = connection->get_partial_data(&req_buf[req_pos], 1, read);
+ if (err != OK)
+ return FAILED;
+ else if (read != 1)
+ return ERR_BUSY;
+ req_pos++;
+ }
+
+ // Parse data
+ String msg;
+ msg.parse_utf8((const char *)req_buf, req_pos);
+
+ // Reset to read again
+ req_pos = 0;
+ has_header = false;
+
+ // Response
+ String output = GDScriptLanguageProtocol::get_singleton()->process_message(msg);
if (!output.empty()) {
- CharString charstr = output.utf8();
- peer->put_packet((const uint8_t *)charstr.ptr(), charstr.length());
+ res_queue.push_back(output.utf8());
}
}
+ return OK;
}
-void GDScriptLanguageProtocol::on_client_connected(int p_id, const String &p_protocal) {
- clients.set(p_id, server->get_peer(p_id));
+Error GDScriptLanguageProtocol::LSPeer::send_data() {
+ int sent = 0;
+ if (!res_queue.empty()) {
+ CharString c_res = res_queue[0];
+ if (res_sent < c_res.size()) {
+ Error err = connection->put_partial_data((const uint8_t *)c_res.get_data() + res_sent, c_res.size() - res_sent - 1, sent);
+ if (err != OK) {
+ return err;
+ }
+ res_sent += sent;
+ }
+ // Response sent
+ if (res_sent >= c_res.size() - 1) {
+ res_sent = 0;
+ res_queue.remove(0);
+ }
+ }
+ return OK;
+}
+
+Error GDScriptLanguageProtocol::on_client_connected() {
+ Ref<StreamPeerTCP> tcp_peer = server->take_connection();
+ ERR_FAIL_COND_V_MSG(clients.size() >= LSP_MAX_CLIENTS, FAILED, "Max client limits reached");
+ Ref<LSPeer> peer = memnew(LSPeer);
+ peer->connection = tcp_peer;
+ clients.set(next_client_id, peer);
+ next_client_id++;
+ EditorNode::get_log()->add_message("Connection Taken", EditorLog::MSG_TYPE_EDITOR);
+ return OK;
}
-void GDScriptLanguageProtocol::on_client_disconnected(int p_id, bool p_was_clean_close) {
- clients.erase(p_id);
+void GDScriptLanguageProtocol::on_client_disconnected(const int &p_client_id) {
+ clients.erase(p_client_id);
+ EditorNode::get_log()->add_message("Disconnected", EditorLog::MSG_TYPE_EDITOR);
}
String GDScriptLanguageProtocol::process_message(const String &p_text) {
@@ -83,11 +158,9 @@ String GDScriptLanguageProtocol::format_output(const String &p_text) {
void GDScriptLanguageProtocol::_bind_methods() {
ClassDB::bind_method(D_METHOD("initialize", "params"), &GDScriptLanguageProtocol::initialize);
ClassDB::bind_method(D_METHOD("initialized", "params"), &GDScriptLanguageProtocol::initialized);
- ClassDB::bind_method(D_METHOD("on_data_received"), &GDScriptLanguageProtocol::on_data_received);
ClassDB::bind_method(D_METHOD("on_client_connected"), &GDScriptLanguageProtocol::on_client_connected);
ClassDB::bind_method(D_METHOD("on_client_disconnected"), &GDScriptLanguageProtocol::on_client_disconnected);
- ClassDB::bind_method(D_METHOD("notify_all_clients", "p_method", "p_params"), &GDScriptLanguageProtocol::notify_all_clients, DEFVAL(Variant()));
- ClassDB::bind_method(D_METHOD("notify_client", "p_method", "p_params", "p_client"), &GDScriptLanguageProtocol::notify_client, DEFVAL(Variant()), DEFVAL(-1));
+ ClassDB::bind_method(D_METHOD("notify_client", "p_method", "p_params"), &GDScriptLanguageProtocol::notify_client, DEFVAL(Variant()), DEFVAL(-1));
ClassDB::bind_method(D_METHOD("is_smart_resolve_enabled"), &GDScriptLanguageProtocol::is_smart_resolve_enabled);
ClassDB::bind_method(D_METHOD("get_text_document"), &GDScriptLanguageProtocol::get_text_document);
ClassDB::bind_method(D_METHOD("get_workspace"), &GDScriptLanguageProtocol::get_workspace);
@@ -116,11 +189,12 @@ Dictionary GDScriptLanguageProtocol::initialize(const Dictionary &p_params) {
Dictionary params;
params["path"] = workspace->root;
Dictionary request = make_notification("gdscrip_client/changeWorkspace", params);
- if (Ref<WebSocketPeer> *peer = clients.getptr(lastest_client_id)) {
+
+ Ref<LSPeer> peer = clients.get(latest_client_id);
+ if (peer != NULL) {
String msg = JSON::print(request);
msg = format_output(msg);
- CharString charstr = msg.utf8();
- (*peer)->put_packet((const uint8_t *)charstr.ptr(), charstr.length());
+ (*peer)->res_queue.push_back(msg.utf8());
}
}
@@ -153,61 +227,59 @@ void GDScriptLanguageProtocol::initialized(const Variant &p_params) {
}
void GDScriptLanguageProtocol::poll() {
- server->poll();
+ if (server->is_connection_available()) {
+ on_client_connected();
+ }
+ const int *id = NULL;
+ while ((id = clients.next(id))) {
+ Ref<LSPeer> peer = clients.get(*id);
+ StreamPeerTCP::Status status = peer->connection->get_status();
+ if (status == StreamPeerTCP::STATUS_NONE || status == StreamPeerTCP::STATUS_ERROR) {
+ on_client_disconnected(*id);
+ id = NULL;
+ } else {
+ if (peer->connection->get_available_bytes() > 0) {
+ latest_client_id = *id;
+ Error err = peer->handle_data();
+ if (err != OK && err != ERR_BUSY) {
+ on_client_disconnected(*id);
+ id = NULL;
+ }
+ }
+ Error err = peer->send_data();
+ if (err != OK && err != ERR_BUSY) {
+ on_client_disconnected(*id);
+ id = NULL;
+ }
+ }
+ }
}
Error GDScriptLanguageProtocol::start(int p_port, const IP_Address &p_bind_ip) {
- if (server == NULL) {
- server = dynamic_cast<WebSocketServer *>(ClassDB::instance("WebSocketServer"));
- ERR_FAIL_COND_V(!server, FAILED);
- server->set_buffers(8192, 1024, 8192, 1024); // 8mb should be way more than enough
- server->connect("data_received", this, "on_data_received");
- server->connect("client_connected", this, "on_client_connected");
- server->connect("client_disconnected", this, "on_client_disconnected");
- }
- server->set_bind_ip(p_bind_ip);
- return server->listen(p_port);
+ return server->listen(p_port, p_bind_ip);
}
void GDScriptLanguageProtocol::stop() {
- const int *ptr = clients.next(NULL);
- while (ptr) {
- clients.get(*ptr)->close();
- ptr = clients.next(ptr);
+ const int *id = NULL;
+ while ((id = clients.next(id))) {
+ Ref<LSPeer> peer = clients.get(*id);
+ peer->connection->disconnect_from_host();
}
- server->stop();
- clients.clear();
-}
-
-void GDScriptLanguageProtocol::notify_all_clients(const String &p_method, const Variant &p_params) {
- Dictionary message = make_notification(p_method, p_params);
- String msg = JSON::print(message);
- msg = format_output(msg);
- CharString charstr = msg.utf8();
- const int *p_id = clients.next(NULL);
- while (p_id != NULL) {
- Ref<WebSocketPeer> peer = clients.get(*p_id);
- (*peer)->put_packet((const uint8_t *)charstr.ptr(), charstr.length());
- p_id = clients.next(p_id);
- }
+ server->stop();
}
-void GDScriptLanguageProtocol::notify_client(const String &p_method, const Variant &p_params, int p_client) {
-
- if (p_client == -1) {
- p_client = lastest_client_id;
+void GDScriptLanguageProtocol::notify_client(const String &p_method, const Variant &p_params, int p_client_id) {
+ if (p_client_id == -1) {
+ p_client_id = latest_client_id;
}
-
- Ref<WebSocketPeer> *peer = clients.getptr(p_client);
+ Ref<LSPeer> peer = clients.get(p_client_id);
ERR_FAIL_COND(peer == NULL);
Dictionary message = make_notification(p_method, p_params);
String msg = JSON::print(message);
msg = format_output(msg);
- CharString charstr = msg.utf8();
-
- (*peer)->put_packet((const uint8_t *)charstr.ptr(), charstr.length());
+ peer->res_queue.push_back(msg.utf8());
}
bool GDScriptLanguageProtocol::is_smart_resolve_enabled() const {
@@ -219,7 +291,7 @@ bool GDScriptLanguageProtocol::is_goto_native_symbols_enabled() const {
}
GDScriptLanguageProtocol::GDScriptLanguageProtocol() {
- server = NULL;
+ server.instance();
singleton = this;
_initialized = false;
workspace.instance();
@@ -228,9 +300,6 @@ GDScriptLanguageProtocol::GDScriptLanguageProtocol() {
set_scope("completionItem", text_document.ptr());
set_scope("workspace", workspace.ptr());
workspace->root = ProjectSettings::get_singleton()->get_resource_path();
-}
-
-GDScriptLanguageProtocol::~GDScriptLanguageProtocol() {
- memdelete(server);
- server = NULL;
+ latest_client_id = 0;
+ next_client_id = 0;
}
diff --git a/modules/gdscript/language_server/gdscript_language_protocol.h b/modules/gdscript/language_server/gdscript_language_protocol.h
index 52c680ab19..3f0ae36af2 100644
--- a/modules/gdscript/language_server/gdscript_language_protocol.h
+++ b/modules/gdscript/language_server/gdscript_language_protocol.h
@@ -31,16 +31,36 @@
#ifndef GDSCRIPT_PROTOCAL_SERVER_H
#define GDSCRIPT_PROTOCAL_SERVER_H
+#include "core/io/stream_peer.h"
+#include "core/io/stream_peer_tcp.h"
+#include "core/io/tcp_server.h"
#include "gdscript_text_document.h"
#include "gdscript_workspace.h"
#include "lsp.hpp"
#include "modules/jsonrpc/jsonrpc.h"
-#include "modules/websocket/websocket_peer.h"
-#include "modules/websocket/websocket_server.h"
+
+#define LSP_MAX_BUFFER_SIZE 4194304
+#define LSP_MAX_CLIENTS 8
class GDScriptLanguageProtocol : public JSONRPC {
GDCLASS(GDScriptLanguageProtocol, JSONRPC)
+private:
+ struct LSPeer : Reference {
+ Ref<StreamPeerTCP> connection;
+
+ uint8_t req_buf[LSP_MAX_BUFFER_SIZE];
+ int req_pos = 0;
+ bool has_header = false;
+ bool has_content = false;
+ int content_length = 0;
+ Vector<CharString> res_queue;
+ int res_sent = 0;
+
+ Error handle_data();
+ Error send_data();
+ };
+
enum LSPErrorCode {
RequestCancelled = -32800,
ContentModified = -32801,
@@ -48,16 +68,16 @@ class GDScriptLanguageProtocol : public JSONRPC {
static GDScriptLanguageProtocol *singleton;
- HashMap<int, Ref<WebSocketPeer> > clients;
- WebSocketServer *server;
- int lastest_client_id;
+ HashMap<int, Ref<LSPeer> > clients;
+ Ref<TCP_Server> server;
+ int latest_client_id;
+ int next_client_id;
Ref<GDScriptTextDocument> text_document;
Ref<GDScriptWorkspace> workspace;
- void on_data_received(int p_id);
- void on_client_connected(int p_id, const String &p_protocal);
- void on_client_disconnected(int p_id, bool p_was_clean_close);
+ Error on_client_connected();
+ void on_client_disconnected(const int &p_client_id);
String process_message(const String &p_text);
String format_output(const String &p_text);
@@ -80,14 +100,12 @@ public:
Error start(int p_port, const IP_Address &p_bind_ip);
void stop();
- void notify_all_clients(const String &p_method, const Variant &p_params = Variant());
- void notify_client(const String &p_method, const Variant &p_params = Variant(), int p_client = -1);
+ void notify_client(const String &p_method, const Variant &p_params = Variant(), int p_client_id = -1);
bool is_smart_resolve_enabled() const;
bool is_goto_native_symbols_enabled() const;
GDScriptLanguageProtocol();
- ~GDScriptLanguageProtocol();
};
#endif
diff --git a/modules/gdscript/language_server/gdscript_workspace.cpp b/modules/gdscript/language_server/gdscript_workspace.cpp
index 1c0590cff1..ea54784f96 100644
--- a/modules/gdscript/language_server/gdscript_workspace.cpp
+++ b/modules/gdscript/language_server/gdscript_workspace.cpp
@@ -33,8 +33,11 @@
#include "../gdscript_parser.h"
#include "core/project_settings.h"
#include "core/script_language.h"
+#include "editor/editor_file_system.h"
#include "editor/editor_help.h"
+#include "editor/editor_node.h"
#include "gdscript_language_protocol.h"
+#include "scene/resources/packed_scene.h"
void GDScriptWorkspace::_bind_methods() {
ClassDB::bind_method(D_METHOD("symbol"), &GDScriptWorkspace::symbol);
@@ -373,6 +376,46 @@ void GDScriptWorkspace::publish_diagnostics(const String &p_path) {
GDScriptLanguageProtocol::get_singleton()->notify_client("textDocument/publishDiagnostics", params);
}
+void GDScriptWorkspace::_get_owners(EditorFileSystemDirectory *efsd, String p_path, List<String> &owners) {
+ if (!efsd)
+ return;
+
+ for (int i = 0; i < efsd->get_subdir_count(); i++) {
+ _get_owners(efsd->get_subdir(i), p_path, owners);
+ }
+
+ for (int i = 0; i < efsd->get_file_count(); i++) {
+
+ Vector<String> deps = efsd->get_file_deps(i);
+ bool found = false;
+ for (int j = 0; j < deps.size(); j++) {
+ if (deps[j] == p_path) {
+ found = true;
+ break;
+ }
+ }
+ if (!found)
+ continue;
+
+ owners.push_back(efsd->get_file_path(i));
+ }
+}
+
+Node *GDScriptWorkspace::_get_owner_node(String p_path) {
+ Node *owner_node = NULL;
+ List<String> owners;
+
+ _get_owners(EditorFileSystem::get_singleton()->get_filesystem(), p_path, owners);
+
+ if (owners.size() > 0) {
+ NodePath owner_path = owners[0];
+ Ref<PackedScene> owner_res = ResourceLoader::load(owner_path);
+ owner_node = owner_res->instance(PackedScene::GEN_EDIT_STATE_DISABLED);
+ }
+
+ return owner_node;
+}
+
void GDScriptWorkspace::completion(const lsp::CompletionParams &p_params, List<ScriptCodeCompletionOption> *r_options) {
String path = get_file_path(p_params.textDocument.uri);
@@ -380,8 +423,12 @@ void GDScriptWorkspace::completion(const lsp::CompletionParams &p_params, List<S
bool forced = false;
if (const ExtendGDScriptParser *parser = get_parse_result(path)) {
+ Node *owner_node = _get_owner_node(path);
String code = parser->get_text_for_completion(p_params.position);
- GDScriptLanguage::get_singleton()->complete_code(code, path, NULL, r_options, forced, call_hint);
+ GDScriptLanguage::get_singleton()->complete_code(code, path, owner_node, r_options, forced, call_hint);
+ if (owner_node) {
+ memdelete(owner_node);
+ }
}
}
diff --git a/modules/gdscript/language_server/gdscript_workspace.h b/modules/gdscript/language_server/gdscript_workspace.h
index 146a5cb7c9..8b46d345d9 100644
--- a/modules/gdscript/language_server/gdscript_workspace.h
+++ b/modules/gdscript/language_server/gdscript_workspace.h
@@ -33,12 +33,17 @@
#include "../gdscript_parser.h"
#include "core/variant.h"
+#include "editor/editor_file_system.h"
#include "gdscript_extend_parser.h"
#include "lsp.hpp"
class GDScriptWorkspace : public Reference {
GDCLASS(GDScriptWorkspace, Reference);
+private:
+ void _get_owners(EditorFileSystemDirectory *efsd, String p_path, List<String> &owners);
+ Node *_get_owner_node(String p_path);
+
protected:
static void _bind_methods();
void remove_cache_parser(const String &p_path);
diff --git a/modules/glslang/SCsub b/modules/glslang/SCsub
index 8c9445436e..ae102238f2 100644
--- a/modules/glslang/SCsub
+++ b/modules/glslang/SCsub
@@ -58,7 +58,11 @@ if env['builtin_glslang']:
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
- env_glslang.Prepend(CPPPATH=[thirdparty_dir])
+ # Treat glslang headers as system headers to avoid raising warnings. Not supported on MSVC.
+ if not env.msvc:
+ env_glslang.Append(CPPFLAGS=['-isystem', Dir(thirdparty_dir).path])
+ else:
+ env_glslang.Prepend(CPPPATH=[thirdparty_dir])
env_thirdparty = env_glslang.Clone()
env_thirdparty.disable_warnings()
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..84075f76fd 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,
@@ -874,7 +874,7 @@ void GridMap::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "cell_center_x"), "set_center_x", "get_center_x");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "cell_center_y"), "set_center_y", "get_center_y");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "cell_center_z"), "set_center_z", "get_center_z");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "cell_scale"), "set_cell_scale", "get_cell_scale");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "cell_scale"), "set_cell_scale", "get_cell_scale");
ADD_GROUP("Collision", "collision_");
ADD_PROPERTY(PropertyInfo(Variant::INT, "collision_layer", PROPERTY_HINT_LAYERS_3D_PHYSICS), "set_collision_layer", "get_collision_layer");
ADD_PROPERTY(PropertyInfo(Variant::INT, "collision_mask", PROPERTY_HINT_LAYERS_3D_PHYSICS), "set_collision_mask", "get_collision_mask");
diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp
index 2144ff264f..761771a02c 100644
--- a/modules/gridmap/grid_map_editor_plugin.cpp
+++ b/modules/gridmap/grid_map_editor_plugin.cpp
@@ -954,7 +954,7 @@ void GridMapEditor::update_palette() {
void GridMapEditor::edit(GridMap *p_gridmap) {
if (!p_gridmap && node)
- node->disconnect("cell_size_changed", this, "_draw_grids");
+ node->disconnect_compat("cell_size_changed", this, "_draw_grids");
node = p_gridmap;
@@ -988,7 +988,7 @@ void GridMapEditor::edit(GridMap *p_gridmap) {
update_grid();
_update_clip();
- node->connect("cell_size_changed", this, "_draw_grids");
+ node->connect_compat("cell_size_changed", this, "_draw_grids");
}
void GridMapEditor::_update_clip() {
@@ -1077,8 +1077,8 @@ void GridMapEditor::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_ENTER_TREE: {
- get_tree()->connect("node_removed", this, "_node_removed");
- mesh_library_palette->connect("item_selected", this, "_item_selected_cbk");
+ get_tree()->connect_compat("node_removed", this, "_node_removed");
+ mesh_library_palette->connect_compat("item_selected", this, "_item_selected_cbk");
for (int i = 0; i < 3; i++) {
grid[i] = VS::get_singleton()->mesh_create();
@@ -1094,7 +1094,7 @@ void GridMapEditor::_notification(int p_what) {
} break;
case NOTIFICATION_EXIT_TREE: {
- get_tree()->disconnect("node_removed", this, "_node_removed");
+ get_tree()->disconnect_compat("node_removed", this, "_node_removed");
_clear_clipboard_data();
for (int i = 0; i < 3; i++) {
@@ -1241,9 +1241,9 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) {
floor->get_line_edit()->add_constant_override("minimum_spaces", 16);
spatial_editor_hb->add_child(floor);
- floor->connect("value_changed", this, "_floor_changed");
- floor->connect("mouse_exited", this, "_floor_mouse_exited");
- floor->get_line_edit()->connect("mouse_exited", this, "_floor_mouse_exited");
+ floor->connect_compat("value_changed", this, "_floor_changed");
+ floor->connect_compat("mouse_exited", this, "_floor_mouse_exited");
+ floor->get_line_edit()->connect_compat("mouse_exited", this, "_floor_mouse_exited");
spatial_editor_hb->add_child(memnew(VSeparator));
@@ -1300,7 +1300,7 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) {
settings_vbc->add_margin_child(TTR("Pick Distance:"), settings_pick_distance);
clip_mode = CLIP_DISABLED;
- options->get_popup()->connect("id_pressed", this, "_menu_option");
+ options->get_popup()->connect_compat("id_pressed", this, "_menu_option");
HBoxContainer *hb = memnew(HBoxContainer);
add_child(hb);
@@ -1310,22 +1310,22 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) {
search_box->set_h_size_flags(SIZE_EXPAND_FILL);
search_box->set_placeholder(TTR("Filter meshes"));
hb->add_child(search_box);
- search_box->connect("text_changed", this, "_text_changed");
- search_box->connect("gui_input", this, "_sbox_input");
+ search_box->connect_compat("text_changed", this, "_text_changed");
+ search_box->connect_compat("gui_input", this, "_sbox_input");
mode_thumbnail = memnew(ToolButton);
mode_thumbnail->set_toggle_mode(true);
mode_thumbnail->set_pressed(true);
mode_thumbnail->set_icon(p_editor->get_gui_base()->get_icon("FileThumbnail", "EditorIcons"));
hb->add_child(mode_thumbnail);
- mode_thumbnail->connect("pressed", this, "_set_display_mode", varray(DISPLAY_THUMBNAIL));
+ mode_thumbnail->connect_compat("pressed", this, "_set_display_mode", varray(DISPLAY_THUMBNAIL));
mode_list = memnew(ToolButton);
mode_list->set_toggle_mode(true);
mode_list->set_pressed(false);
mode_list->set_icon(p_editor->get_gui_base()->get_icon("FileList", "EditorIcons"));
hb->add_child(mode_list);
- mode_list->connect("pressed", this, "_set_display_mode", varray(DISPLAY_LIST));
+ mode_list->connect_compat("pressed", this, "_set_display_mode", varray(DISPLAY_LIST));
size_slider = memnew(HSlider);
size_slider->set_h_size_flags(SIZE_EXPAND_FILL);
@@ -1333,7 +1333,7 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) {
size_slider->set_max(4.0f);
size_slider->set_step(0.1f);
size_slider->set_value(1.0f);
- size_slider->connect("value_changed", this, "_icon_size_changed");
+ size_slider->connect_compat("value_changed", this, "_icon_size_changed");
add_child(size_slider);
EDITOR_DEF("editors/grid_map/preview_size", 64);
@@ -1343,7 +1343,7 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) {
mesh_library_palette = memnew(ItemList);
add_child(mesh_library_palette);
mesh_library_palette->set_v_size_flags(SIZE_EXPAND_FILL);
- mesh_library_palette->connect("gui_input", this, "_mesh_library_palette_input");
+ mesh_library_palette->connect_compat("gui_input", this, "_mesh_library_palette_input");
info_message = memnew(Label);
info_message->set_text(TTR("Give a MeshLibrary resource to this GridMap to use its meshes."));
@@ -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/dtls_server_mbedtls.cpp b/modules/mbedtls/dtls_server_mbedtls.cpp
new file mode 100644
index 0000000000..215b511758
--- /dev/null
+++ b/modules/mbedtls/dtls_server_mbedtls.cpp
@@ -0,0 +1,78 @@
+/*************************************************************************/
+/* dtls_server_mbedtls.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+
+#include "dtls_server_mbedtls.h"
+#include "packet_peer_mbed_dtls.h"
+
+Error DTLSServerMbedTLS::setup(Ref<CryptoKey> p_key, Ref<X509Certificate> p_cert, Ref<X509Certificate> p_ca_chain) {
+ ERR_FAIL_COND_V(_cookies->setup() != OK, ERR_ALREADY_IN_USE);
+ _key = p_key;
+ _cert = p_cert;
+ _ca_chain = p_ca_chain;
+ return OK;
+}
+
+void DTLSServerMbedTLS::stop() {
+ _cookies->clear();
+}
+
+Ref<PacketPeerDTLS> DTLSServerMbedTLS::take_connection(Ref<PacketPeerUDP> p_udp_peer) {
+ Ref<PacketPeerMbedDTLS> out;
+ out.instance();
+
+ ERR_FAIL_COND_V(!out.is_valid(), out);
+ ERR_FAIL_COND_V(!p_udp_peer.is_valid(), out);
+ out->accept_peer(p_udp_peer, _key, _cert, _ca_chain, _cookies);
+ return out;
+}
+
+DTLSServer *DTLSServerMbedTLS::_create_func() {
+
+ return memnew(DTLSServerMbedTLS);
+}
+
+void DTLSServerMbedTLS::initialize() {
+
+ _create = _create_func;
+ available = true;
+}
+
+void DTLSServerMbedTLS::finalize() {
+ _create = NULL;
+ available = false;
+}
+
+DTLSServerMbedTLS::DTLSServerMbedTLS() {
+ _cookies.instance();
+}
+
+DTLSServerMbedTLS::~DTLSServerMbedTLS() {
+ stop();
+}
diff --git a/modules/mbedtls/dtls_server_mbedtls.h b/modules/mbedtls/dtls_server_mbedtls.h
new file mode 100644
index 0000000000..d61ab3179e
--- /dev/null
+++ b/modules/mbedtls/dtls_server_mbedtls.h
@@ -0,0 +1,58 @@
+/*************************************************************************/
+/* dtls_server_mbedtls.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+
+#ifndef MBED_DTLS_SERVER_H
+#define MBED_DTLS_SERVER_H
+
+#include "core/io/dtls_server.h"
+#include "ssl_context_mbedtls.h"
+
+class DTLSServerMbedTLS : public DTLSServer {
+
+private:
+ static DTLSServer *_create_func();
+ Ref<CryptoKey> _key;
+ Ref<X509Certificate> _cert;
+ Ref<X509Certificate> _ca_chain;
+ Ref<CookieContextMbedTLS> _cookies;
+
+public:
+ static void initialize();
+ static void finalize();
+
+ virtual Error setup(Ref<CryptoKey> p_key, Ref<X509Certificate> p_cert, Ref<X509Certificate> p_ca_chain = Ref<X509Certificate>());
+ virtual void stop();
+ virtual Ref<PacketPeerDTLS> take_connection(Ref<PacketPeerUDP> p_peer);
+
+ DTLSServerMbedTLS();
+ ~DTLSServerMbedTLS();
+};
+
+#endif // MBED_DTLS_SERVER_H
diff --git a/modules/mbedtls/packet_peer_mbed_dtls.cpp b/modules/mbedtls/packet_peer_mbed_dtls.cpp
new file mode 100755
index 0000000000..bdf36ad1b1
--- /dev/null
+++ b/modules/mbedtls/packet_peer_mbed_dtls.cpp
@@ -0,0 +1,297 @@
+/*************************************************************************/
+/* packet_peer_mbed_dtls.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+
+#include "packet_peer_mbed_dtls.h"
+#include "mbedtls/platform_util.h"
+
+#include "core/io/stream_peer_ssl.h"
+#include "core/os/file_access.h"
+
+int PacketPeerMbedDTLS::bio_send(void *ctx, const unsigned char *buf, size_t len) {
+
+ if (buf == NULL || len <= 0) return 0;
+
+ PacketPeerMbedDTLS *sp = (PacketPeerMbedDTLS *)ctx;
+
+ ERR_FAIL_COND_V(sp == NULL, 0);
+
+ Error err = sp->base->put_packet((const uint8_t *)buf, len);
+ if (err == ERR_BUSY) {
+ return MBEDTLS_ERR_SSL_WANT_WRITE;
+ } else if (err != OK) {
+ ERR_FAIL_V(MBEDTLS_ERR_SSL_INTERNAL_ERROR);
+ }
+ return len;
+}
+
+int PacketPeerMbedDTLS::bio_recv(void *ctx, unsigned char *buf, size_t len) {
+
+ if (buf == NULL || len <= 0) return 0;
+
+ PacketPeerMbedDTLS *sp = (PacketPeerMbedDTLS *)ctx;
+
+ ERR_FAIL_COND_V(sp == NULL, 0);
+
+ int pc = sp->base->get_available_packet_count();
+ if (pc == 0) {
+ return MBEDTLS_ERR_SSL_WANT_READ;
+ } else if (pc < 0) {
+ ERR_FAIL_V(MBEDTLS_ERR_SSL_INTERNAL_ERROR);
+ }
+
+ const uint8_t *buffer;
+ int buffer_size = 0;
+ Error err = sp->base->get_packet(&buffer, buffer_size);
+ if (err != OK) {
+ return MBEDTLS_ERR_SSL_INTERNAL_ERROR;
+ }
+ copymem(buf, buffer, buffer_size);
+ return buffer_size;
+}
+
+void PacketPeerMbedDTLS::_cleanup() {
+
+ ssl_ctx->clear();
+ base = Ref<PacketPeer>();
+ status = STATUS_DISCONNECTED;
+}
+
+int PacketPeerMbedDTLS::_set_cookie() {
+ // Setup DTLS session cookie for this client
+ uint8_t client_id[18];
+ IP_Address addr = base->get_packet_address();
+ uint16_t port = base->get_packet_port();
+ copymem(client_id, addr.get_ipv6(), 16);
+ copymem(&client_id[16], (uint8_t *)&port, 2);
+ return mbedtls_ssl_set_client_transport_id(ssl_ctx->get_context(), client_id, 18);
+}
+
+Error PacketPeerMbedDTLS::_do_handshake() {
+ int ret = 0;
+ while ((ret = mbedtls_ssl_handshake(ssl_ctx->get_context())) != 0) {
+ if (ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE) {
+ if (ret != MBEDTLS_ERR_SSL_HELLO_VERIFY_REQUIRED) {
+ ERR_PRINT("TLS handshake error: " + itos(ret));
+ SSLContextMbedTLS::print_mbedtls_error(ret);
+ }
+ _cleanup();
+ status = STATUS_ERROR;
+ return FAILED;
+ }
+ // Will retry via poll later
+ return OK;
+ }
+
+ status = STATUS_CONNECTED;
+ return OK;
+}
+
+Error PacketPeerMbedDTLS::connect_to_peer(Ref<PacketPeerUDP> p_base, bool p_validate_certs, const String &p_for_hostname, Ref<X509Certificate> p_ca_certs) {
+
+ ERR_FAIL_COND_V(!p_base.is_valid() || !p_base->is_connected_to_host(), ERR_INVALID_PARAMETER);
+
+ base = p_base;
+ int ret = 0;
+ int authmode = p_validate_certs ? MBEDTLS_SSL_VERIFY_REQUIRED : MBEDTLS_SSL_VERIFY_NONE;
+
+ Error err = ssl_ctx->init_client(MBEDTLS_SSL_TRANSPORT_DATAGRAM, authmode, p_ca_certs);
+ ERR_FAIL_COND_V(err != OK, err);
+
+ mbedtls_ssl_set_hostname(ssl_ctx->get_context(), p_for_hostname.utf8().get_data());
+ mbedtls_ssl_set_bio(ssl_ctx->get_context(), this, bio_send, bio_recv, NULL);
+ mbedtls_ssl_set_timer_cb(ssl_ctx->get_context(), &timer, mbedtls_timing_set_delay, mbedtls_timing_get_delay);
+
+ status = STATUS_HANDSHAKING;
+
+ if ((ret = _do_handshake()) != OK) {
+ status = STATUS_ERROR_HOSTNAME_MISMATCH;
+ return FAILED;
+ }
+
+ return OK;
+}
+
+Error PacketPeerMbedDTLS::accept_peer(Ref<PacketPeerUDP> p_base, Ref<CryptoKey> p_key, Ref<X509Certificate> p_cert, Ref<X509Certificate> p_ca_chain, Ref<CookieContextMbedTLS> p_cookies) {
+
+ Error err = ssl_ctx->init_server(MBEDTLS_SSL_TRANSPORT_DATAGRAM, MBEDTLS_SSL_VERIFY_NONE, p_key, p_cert, p_cookies);
+ ERR_FAIL_COND_V(err != OK, err);
+
+ base = p_base;
+ base->set_blocking_mode(false);
+
+ mbedtls_ssl_session_reset(ssl_ctx->get_context());
+
+ int ret = _set_cookie();
+ if (ret != 0) {
+ _cleanup();
+ ERR_FAIL_V_MSG(FAILED, "Error setting DTLS client cookie");
+ }
+
+ mbedtls_ssl_set_bio(ssl_ctx->get_context(), this, bio_send, bio_recv, NULL);
+ mbedtls_ssl_set_timer_cb(ssl_ctx->get_context(), &timer, mbedtls_timing_set_delay, mbedtls_timing_get_delay);
+
+ status = STATUS_HANDSHAKING;
+
+ if ((ret = _do_handshake()) != OK) {
+ status = STATUS_ERROR;
+ return FAILED;
+ }
+
+ return OK;
+}
+
+Error PacketPeerMbedDTLS::put_packet(const uint8_t *p_buffer, int p_bytes) {
+
+ ERR_FAIL_COND_V(status != STATUS_CONNECTED, ERR_UNCONFIGURED);
+
+ if (p_bytes == 0)
+ return OK;
+
+ int ret = mbedtls_ssl_write(ssl_ctx->get_context(), p_buffer, p_bytes);
+ if (ret == MBEDTLS_ERR_SSL_WANT_READ || ret == MBEDTLS_ERR_SSL_WANT_WRITE) {
+ ret = 0; // non blocking io
+ } else if (ret <= 0) {
+ SSLContextMbedTLS::print_mbedtls_error(ret);
+ _cleanup();
+ return ERR_CONNECTION_ERROR;
+ }
+
+ return OK;
+}
+
+Error PacketPeerMbedDTLS::get_packet(const uint8_t **r_buffer, int &r_bytes) {
+
+ ERR_FAIL_COND_V(status != STATUS_CONNECTED, ERR_UNCONFIGURED);
+
+ r_bytes = 0;
+
+ int ret = mbedtls_ssl_read(ssl_ctx->get_context(), packet_buffer, PACKET_BUFFER_SIZE);
+ if (ret == MBEDTLS_ERR_SSL_WANT_READ || ret == MBEDTLS_ERR_SSL_WANT_WRITE) {
+ ret = 0; // non blocking io
+ } else if (ret <= 0) {
+ if (ret == MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY) {
+ // Also send close notify back
+ disconnect_from_peer();
+ } else {
+ _cleanup();
+ status = STATUS_ERROR;
+ SSLContextMbedTLS::print_mbedtls_error(ret);
+ }
+ return ERR_CONNECTION_ERROR;
+ }
+ *r_buffer = packet_buffer;
+ r_bytes = ret;
+
+ return OK;
+}
+
+void PacketPeerMbedDTLS::poll() {
+
+ if (status == STATUS_HANDSHAKING) {
+ _do_handshake();
+ return;
+ } else if (status != STATUS_CONNECTED) {
+ return;
+ }
+
+ ERR_FAIL_COND(!base.is_valid());
+
+ int ret = mbedtls_ssl_read(ssl_ctx->get_context(), NULL, 0);
+
+ if (ret < 0 && ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE) {
+ if (ret == MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY) {
+ // Also send close notify back
+ disconnect_from_peer();
+ } else {
+ _cleanup();
+ status = STATUS_ERROR;
+ SSLContextMbedTLS::print_mbedtls_error(ret);
+ }
+ }
+}
+
+int PacketPeerMbedDTLS::get_available_packet_count() const {
+
+ ERR_FAIL_COND_V(status != STATUS_CONNECTED, 0);
+
+ return mbedtls_ssl_get_bytes_avail(&(ssl_ctx->ssl)) > 0 ? 1 : 0;
+}
+
+int PacketPeerMbedDTLS::get_max_packet_size() const {
+
+ return 488; // 512 (UDP in Godot) - 24 (DTLS header)
+}
+
+PacketPeerMbedDTLS::PacketPeerMbedDTLS() {
+
+ ssl_ctx.instance();
+ status = STATUS_DISCONNECTED;
+}
+
+PacketPeerMbedDTLS::~PacketPeerMbedDTLS() {
+ disconnect_from_peer();
+}
+
+void PacketPeerMbedDTLS::disconnect_from_peer() {
+
+ if (status != STATUS_CONNECTED && status != STATUS_HANDSHAKING)
+ return;
+
+ if (status == STATUS_CONNECTED) {
+ int ret = 0;
+ // Send SSL close notification, blocking, but ignore other errors.
+ do
+ ret = mbedtls_ssl_close_notify(ssl_ctx->get_context());
+ while (ret == MBEDTLS_ERR_SSL_WANT_WRITE);
+ }
+
+ _cleanup();
+}
+
+PacketPeerMbedDTLS::Status PacketPeerMbedDTLS::get_status() const {
+
+ return status;
+}
+
+PacketPeerDTLS *PacketPeerMbedDTLS::_create_func() {
+
+ return memnew(PacketPeerMbedDTLS);
+}
+
+void PacketPeerMbedDTLS::initialize_dtls() {
+
+ _create = _create_func;
+ available = true;
+}
+
+void PacketPeerMbedDTLS::finalize_dtls() {
+ _create = NULL;
+ available = false;
+}
diff --git a/modules/mbedtls/packet_peer_mbed_dtls.h b/modules/mbedtls/packet_peer_mbed_dtls.h
new file mode 100755
index 0000000000..26c4543785
--- /dev/null
+++ b/modules/mbedtls/packet_peer_mbed_dtls.h
@@ -0,0 +1,88 @@
+/*************************************************************************/
+/* packet_peer_mbed_dtls.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+
+#ifndef PACKET_PEER_MBED_DTLS_H
+#define PACKET_PEER_MBED_DTLS_H
+
+#include "core/io/packet_peer_dtls.h"
+#include "ssl_context_mbedtls.h"
+
+#include <mbedtls/timing.h>
+
+class PacketPeerMbedDTLS : public PacketPeerDTLS {
+private:
+ enum {
+ PACKET_BUFFER_SIZE = 65536
+ };
+
+ uint8_t packet_buffer[PACKET_BUFFER_SIZE];
+
+ Status status;
+ String hostname;
+
+ Ref<PacketPeerUDP> base;
+
+ static PacketPeerDTLS *_create_func();
+
+ static int bio_recv(void *ctx, unsigned char *buf, size_t len);
+ static int bio_send(void *ctx, const unsigned char *buf, size_t len);
+ void _cleanup();
+
+protected:
+ Ref<SSLContextMbedTLS> ssl_ctx;
+ mbedtls_timing_delay_context timer;
+
+ static void _bind_methods();
+
+ Error _do_handshake();
+ int _set_cookie();
+
+public:
+ virtual void poll();
+ virtual Error accept_peer(Ref<PacketPeerUDP> p_base, Ref<CryptoKey> p_key, Ref<X509Certificate> p_cert = Ref<X509Certificate>(), Ref<X509Certificate> p_ca_chain = Ref<X509Certificate>(), Ref<CookieContextMbedTLS> p_cookies = Ref<CookieContextMbedTLS>());
+ virtual Error connect_to_peer(Ref<PacketPeerUDP> p_base, bool p_validate_certs = false, const String &p_for_hostname = String(), Ref<X509Certificate> p_ca_certs = Ref<X509Certificate>());
+ virtual Status get_status() const;
+
+ virtual void disconnect_from_peer();
+
+ virtual Error get_packet(const uint8_t **r_buffer, int &r_buffer_size);
+ virtual Error put_packet(const uint8_t *p_buffer, int p_buffer_size);
+
+ virtual int get_available_packet_count() const;
+ virtual int get_max_packet_size() const;
+
+ static void initialize_dtls();
+ static void finalize_dtls();
+
+ PacketPeerMbedDTLS();
+ ~PacketPeerMbedDTLS();
+};
+
+#endif // PACKET_PEER_MBED_DTLS_H
diff --git a/modules/mbedtls/register_types.cpp b/modules/mbedtls/register_types.cpp
index 8f9e2c370b..d39af7fe87 100755
--- a/modules/mbedtls/register_types.cpp
+++ b/modules/mbedtls/register_types.cpp
@@ -31,16 +31,22 @@
#include "register_types.h"
#include "crypto_mbedtls.h"
+#include "dtls_server_mbedtls.h"
+#include "packet_peer_mbed_dtls.h"
#include "stream_peer_mbedtls.h"
void register_mbedtls_types() {
CryptoMbedTLS::initialize_crypto();
StreamPeerMbedTLS::initialize_ssl();
+ PacketPeerMbedDTLS::initialize_dtls();
+ DTLSServerMbedTLS::initialize();
}
void unregister_mbedtls_types() {
+ DTLSServerMbedTLS::finalize();
+ PacketPeerMbedDTLS::finalize_dtls();
StreamPeerMbedTLS::finalize_ssl();
CryptoMbedTLS::finalize_crypto();
}
diff --git a/modules/mbedtls/ssl_context_mbedtls.cpp b/modules/mbedtls/ssl_context_mbedtls.cpp
index 82584e3494..52630bd98c 100644
--- a/modules/mbedtls/ssl_context_mbedtls.cpp
+++ b/modules/mbedtls/ssl_context_mbedtls.cpp
@@ -38,6 +38,53 @@ static void my_debug(void *ctx, int level,
fflush(stdout);
}
+void SSLContextMbedTLS::print_mbedtls_error(int p_ret) {
+ printf("mbedtls error: returned -0x%x\n\n", -p_ret);
+ fflush(stdout);
+}
+
+/// CookieContextMbedTLS
+
+Error CookieContextMbedTLS::setup() {
+ ERR_FAIL_COND_V_MSG(inited, ERR_ALREADY_IN_USE, "This cookie context is already in use");
+
+ mbedtls_ctr_drbg_init(&ctr_drbg);
+ mbedtls_entropy_init(&entropy);
+ mbedtls_ssl_cookie_init(&cookie_ctx);
+ inited = true;
+
+ int ret = mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func, &entropy, NULL, 0);
+ if (ret != 0) {
+ clear(); // Never leave unusable resources around.
+ ERR_FAIL_V_MSG(FAILED, "mbedtls_ctr_drbg_seed returned an error " + itos(ret));
+ }
+
+ ret = mbedtls_ssl_cookie_setup(&cookie_ctx, mbedtls_ctr_drbg_random, &ctr_drbg);
+ if (ret != 0) {
+ clear();
+ ERR_FAIL_V_MSG(FAILED, "mbedtls_ssl_cookie_setup returned an error " + itos(ret));
+ }
+ return OK;
+}
+
+void CookieContextMbedTLS::clear() {
+ if (!inited)
+ return;
+ mbedtls_ctr_drbg_free(&ctr_drbg);
+ mbedtls_entropy_free(&entropy);
+ mbedtls_ssl_cookie_free(&cookie_ctx);
+}
+
+CookieContextMbedTLS::CookieContextMbedTLS() {
+ inited = false;
+}
+
+CookieContextMbedTLS::~CookieContextMbedTLS() {
+ clear();
+}
+
+/// SSLContextMbedTLS
+
Error SSLContextMbedTLS::_setup(int p_endpoint, int p_transport, int p_authmode) {
ERR_FAIL_COND_V_MSG(inited, ERR_ALREADY_IN_USE, "This SSL context is already active");
@@ -50,7 +97,7 @@ Error SSLContextMbedTLS::_setup(int p_endpoint, int p_transport, int p_authmode)
int ret = mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func, &entropy, NULL, 0);
if (ret != 0) {
clear(); // Never leave unusable resources around.
- ERR_FAIL_V_MSG(FAILED, "mbedtls_ctr_drbg_seed returned an error" + itos(ret));
+ ERR_FAIL_V_MSG(FAILED, "mbedtls_ctr_drbg_seed returned an error " + itos(ret));
}
ret = mbedtls_ssl_config_defaults(&conf, p_endpoint, p_transport, MBEDTLS_SSL_PRESET_DEFAULT);
@@ -64,7 +111,7 @@ Error SSLContextMbedTLS::_setup(int p_endpoint, int p_transport, int p_authmode)
return OK;
}
-Error SSLContextMbedTLS::init_server(int p_transport, int p_authmode, Ref<CryptoKeyMbedTLS> p_pkey, Ref<X509CertificateMbedTLS> p_cert) {
+Error SSLContextMbedTLS::init_server(int p_transport, int p_authmode, Ref<CryptoKeyMbedTLS> p_pkey, Ref<X509CertificateMbedTLS> p_cert, Ref<CookieContextMbedTLS> p_cookies) {
ERR_FAIL_COND_V(!p_pkey.is_valid(), ERR_INVALID_PARAMETER);
ERR_FAIL_COND_V(!p_cert.is_valid(), ERR_INVALID_PARAMETER);
@@ -89,6 +136,15 @@ Error SSLContextMbedTLS::init_server(int p_transport, int p_authmode, Ref<Crypto
if (certs->cert.next) {
mbedtls_ssl_conf_ca_chain(&conf, certs->cert.next, NULL);
}
+ // DTLS Cookies
+ if (p_transport == MBEDTLS_SSL_TRANSPORT_DATAGRAM) {
+ if (p_cookies.is_null() || !p_cookies->inited) {
+ clear();
+ ERR_FAIL_V(ERR_BUG);
+ }
+ cookies = p_cookies;
+ mbedtls_ssl_conf_dtls_cookies(&conf, mbedtls_ssl_cookie_write, mbedtls_ssl_cookie_check, &(cookies->cookie_ctx));
+ }
mbedtls_ssl_setup(&ssl, &conf);
return OK;
}
@@ -134,6 +190,7 @@ void SSLContextMbedTLS::clear() {
if (pkey.is_valid())
pkey->unlock();
pkey = Ref<CryptoKeyMbedTLS>();
+ cookies = Ref<CookieContextMbedTLS>();
inited = false;
}
diff --git a/modules/mbedtls/ssl_context_mbedtls.h b/modules/mbedtls/ssl_context_mbedtls.h
index 9145e0fd72..d3e1f87a8e 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>
@@ -42,25 +42,49 @@
#include <mbedtls/debug.h>
#include <mbedtls/entropy.h>
#include <mbedtls/ssl.h>
+#include <mbedtls/ssl_cookie.h>
+
+class SSLContextMbedTLS;
+
+class CookieContextMbedTLS : public Reference {
+
+ friend class SSLContextMbedTLS;
+
+protected:
+ bool inited;
+ mbedtls_entropy_context entropy;
+ mbedtls_ctr_drbg_context ctr_drbg;
+ mbedtls_ssl_cookie_ctx cookie_ctx;
+
+public:
+ Error setup();
+ void clear();
+
+ CookieContextMbedTLS();
+ ~CookieContextMbedTLS();
+};
class SSLContextMbedTLS : public Reference {
protected:
bool inited;
- static PoolByteArray _read_file(String p_path);
+ static PackedByteArray _read_file(String p_path);
public:
+ static void print_mbedtls_error(int p_ret);
+
Ref<X509CertificateMbedTLS> certs;
mbedtls_entropy_context entropy;
mbedtls_ctr_drbg_context ctr_drbg;
mbedtls_ssl_context ssl;
mbedtls_ssl_config conf;
+ Ref<CookieContextMbedTLS> cookies;
Ref<CryptoKeyMbedTLS> pkey;
Error _setup(int p_endpoint, int p_transport, int p_authmode);
- Error init_server(int p_transport, int p_authmode, Ref<CryptoKeyMbedTLS> p_pkey, Ref<X509CertificateMbedTLS> p_cert);
+ Error init_server(int p_transport, int p_authmode, Ref<CryptoKeyMbedTLS> p_pkey, Ref<X509CertificateMbedTLS> p_cert, Ref<CookieContextMbedTLS> p_cookies = Ref<CookieContextMbedTLS>());
Error init_client(int p_transport, int p_authmode, Ref<X509CertificateMbedTLS> p_valid_cas);
void clear();
diff --git a/modules/mbedtls/stream_peer_mbedtls.cpp b/modules/mbedtls/stream_peer_mbedtls.cpp
index f06327e0d5..03c5922267 100755
--- a/modules/mbedtls/stream_peer_mbedtls.cpp
+++ b/modules/mbedtls/stream_peer_mbedtls.cpp
@@ -33,11 +33,6 @@
#include "core/io/stream_peer_tcp.h"
#include "core/os/file_access.h"
-void _print_error(int ret) {
- printf("mbedtls error: returned -0x%x\n\n", -ret);
- fflush(stdout);
-}
-
int StreamPeerMbedTLS::bio_send(void *ctx, const unsigned char *buf, size_t len) {
if (buf == NULL || len <= 0) return 0;
@@ -89,7 +84,7 @@ Error StreamPeerMbedTLS::_do_handshake() {
if (ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE) {
// An error occurred.
ERR_PRINT("TLS handshake error: " + itos(ret));
- _print_error(ret);
+ SSLContextMbedTLS::print_mbedtls_error(ret);
disconnect_from_stream();
status = STATUS_ERROR;
return FAILED;
@@ -188,7 +183,7 @@ Error StreamPeerMbedTLS::put_partial_data(const uint8_t *p_data, int p_bytes, in
disconnect_from_stream();
return ERR_FILE_EOF;
} else if (ret <= 0) {
- _print_error(ret);
+ SSLContextMbedTLS::print_mbedtls_error(ret);
disconnect_from_stream();
return ERR_CONNECTION_ERROR;
}
@@ -233,7 +228,7 @@ Error StreamPeerMbedTLS::get_partial_data(uint8_t *p_buffer, int p_bytes, int &r
disconnect_from_stream();
return ERR_FILE_EOF;
} else if (ret <= 0) {
- _print_error(ret);
+ SSLContextMbedTLS::print_mbedtls_error(ret);
disconnect_from_stream();
return ERR_CONNECTION_ERROR;
}
@@ -264,7 +259,7 @@ void StreamPeerMbedTLS::poll() {
disconnect_from_stream();
return;
} else if (ret < 0) {
- _print_error(ret);
+ SSLContextMbedTLS::print_mbedtls_error(ret);
disconnect_from_stream();
return;
}
diff --git a/modules/mobile_vr/mobile_vr_interface.cpp b/modules/mobile_vr/mobile_vr_interface.cpp
index afa8766bce..2f1d95cd42 100644
--- a/modules/mobile_vr/mobile_vr_interface.cpp
+++ b/modules/mobile_vr/mobile_vr_interface.cpp
@@ -221,13 +221,13 @@ void MobileVRInterface::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_k2", "k"), &MobileVRInterface::set_k2);
ClassDB::bind_method(D_METHOD("get_k2"), &MobileVRInterface::get_k2);
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "eye_height", PROPERTY_HINT_RANGE, "0.0,3.0,0.1"), "set_eye_height", "get_eye_height");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "iod", PROPERTY_HINT_RANGE, "4.0,10.0,0.1"), "set_iod", "get_iod");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "display_width", PROPERTY_HINT_RANGE, "5.0,25.0,0.1"), "set_display_width", "get_display_width");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "display_to_lens", PROPERTY_HINT_RANGE, "5.0,25.0,0.1"), "set_display_to_lens", "get_display_to_lens");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "oversample", PROPERTY_HINT_RANGE, "1.0,2.0,0.1"), "set_oversample", "get_oversample");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "k1", PROPERTY_HINT_RANGE, "0.1,10.0,0.0001"), "set_k1", "get_k1");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "k2", PROPERTY_HINT_RANGE, "0.1,10.0,0.0001"), "set_k2", "get_k2");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "eye_height", PROPERTY_HINT_RANGE, "0.0,3.0,0.1"), "set_eye_height", "get_eye_height");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "iod", PROPERTY_HINT_RANGE, "4.0,10.0,0.1"), "set_iod", "get_iod");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "display_width", PROPERTY_HINT_RANGE, "5.0,25.0,0.1"), "set_display_width", "get_display_width");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "display_to_lens", PROPERTY_HINT_RANGE, "5.0,25.0,0.1"), "set_display_to_lens", "get_display_to_lens");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "oversample", PROPERTY_HINT_RANGE, "1.0,2.0,0.1"), "set_oversample", "get_oversample");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "k1", PROPERTY_HINT_RANGE, "0.1,10.0,0.0001"), "set_k1", "get_k1");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "k2", PROPERTY_HINT_RANGE, "0.1,10.0,0.0001"), "set_k2", "get_k2");
}
void MobileVRInterface::set_eye_height(const real_t p_eye_height) {
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..5c1c098e3e 100644
--- a/modules/mono/csharp_script.cpp
+++ b/modules/mono/csharp_script.cpp
@@ -411,7 +411,7 @@ static String variant_type_to_managed_name(const String &p_var_type_name) {
if (p_var_type_name == Variant::get_type_name(Variant::OBJECT))
return "Godot.Object";
- if (p_var_type_name == Variant::get_type_name(Variant::REAL)) {
+ if (p_var_type_name == Variant::get_type_name(Variant::FLOAT)) {
#ifdef REAL_T_IS_DOUBLE
return "double";
#else
@@ -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_INT32_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_FLOAT32_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
@@ -1720,7 +1720,7 @@ bool CSharpInstance::has_method(const StringName &p_method) const {
return false;
}
-Variant CSharpInstance::call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error) {
+Variant CSharpInstance::call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) {
ERR_FAIL_COND_V(!script.is_valid(), Variant());
@@ -1729,7 +1729,7 @@ Variant CSharpInstance::call(const StringName &p_method, const Variant **p_args,
MonoObject *mono_object = get_mono_object();
if (!mono_object) {
- r_error.error = Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL;
+ r_error.error = Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL;
ERR_FAIL_V(Variant());
}
@@ -1741,7 +1741,7 @@ Variant CSharpInstance::call(const StringName &p_method, const Variant **p_args,
if (method) {
MonoObject *return_value = method->invoke(mono_object, p_args);
- r_error.error = Variant::CallError::CALL_OK;
+ r_error.error = Callable::CallError::CALL_OK;
if (return_value) {
return GDMonoMarshal::mono_object_to_variant(return_value);
@@ -1753,7 +1753,7 @@ Variant CSharpInstance::call(const StringName &p_method, const Variant **p_args,
top = top->get_parent_class();
}
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
return Variant();
}
@@ -2704,11 +2704,11 @@ void CSharpScript::_clear() {
script_class = NULL;
}
-Variant CSharpScript::call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error) {
+Variant CSharpScript::call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) {
if (unlikely(GDMono::get_singleton() == NULL)) {
// Probably not the best error but eh.
- r_error.error = Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL;
+ r_error.error = Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL;
return Variant();
}
@@ -2904,7 +2904,7 @@ StringName CSharpScript::get_instance_base_type() const {
return StringName();
}
-CSharpInstance *CSharpScript::_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, bool p_isref, Variant::CallError &r_error) {
+CSharpInstance *CSharpScript::_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, bool p_isref, Callable::CallError &r_error) {
GD_MONO_ASSERT_THREAD_ATTACHED;
@@ -2968,7 +2968,7 @@ CSharpInstance *CSharpScript::_create_instance(const Variant **p_args, int p_arg
CRASH_COND(die == true);
p_owner->set_script_instance(NULL);
- r_error.error = Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL;
+ r_error.error = Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL;
ERR_FAIL_V_MSG(NULL, "Failed to allocate memory for the object.");
}
@@ -2994,14 +2994,14 @@ CSharpInstance *CSharpScript::_create_instance(const Variant **p_args, int p_arg
return instance;
}
-Variant CSharpScript::_new(const Variant **p_args, int p_argcount, Variant::CallError &r_error) {
+Variant CSharpScript::_new(const Variant **p_args, int p_argcount, Callable::CallError &r_error) {
if (!valid) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
return Variant();
}
- r_error.error = Variant::CallError::CALL_OK;
+ r_error.error = Callable::CallError::CALL_OK;
ERR_FAIL_NULL_V(native, Variant());
@@ -3049,7 +3049,7 @@ ScriptInstance *CSharpScript::instance_create(Object *p_this) {
GD_MONO_SCOPE_THREAD_ATTACH;
- Variant::CallError unchecked_error;
+ Callable::CallError unchecked_error;
return _create_instance(NULL, 0, p_this, Object::cast_to<Reference>(p_this) != NULL, unchecked_error);
}
diff --git a/modules/mono/csharp_script.h b/modules/mono/csharp_script.h
index 32a5b30c18..627218eaf5 100644
--- a/modules/mono/csharp_script.h
+++ b/modules/mono/csharp_script.h
@@ -141,8 +141,8 @@ class CSharpScript : public Script {
static int _try_get_member_export_hint(IMonoClassMember *p_member, ManagedType p_type, Variant::Type p_variant_type, bool p_allow_generics, PropertyHint &r_hint, String &r_hint_string);
#endif
- CSharpInstance *_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, bool p_isref, Variant::CallError &r_error);
- Variant _new(const Variant **p_args, int p_argcount, Variant::CallError &r_error);
+ CSharpInstance *_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, bool p_isref, Callable::CallError &r_error);
+ Variant _new(const Variant **p_args, int p_argcount, Callable::CallError &r_error);
// Do not use unless you know what you are doing
friend void GDMonoInternals::tie_managed_to_unmanaged(MonoObject *, Object *);
@@ -154,7 +154,7 @@ class CSharpScript : public Script {
protected:
static void _bind_methods();
- Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error);
+ Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error);
virtual void _resource_path_changed();
bool _get(const StringName &p_name, Variant &r_ret) const;
bool _set(const StringName &p_name, const Variant &p_value);
@@ -265,7 +265,7 @@ public:
/* TODO */ virtual void get_method_list(List<MethodInfo> *p_list) const {}
virtual bool has_method(const StringName &p_method) const;
- virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error);
+ virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error);
virtual void call_multilevel(const StringName &p_method, const Variant **p_args, int p_argcount);
virtual void call_multilevel_reversed(const StringName &p_method, const Variant **p_args, int p_argcount);
@@ -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/doc_classes/@C#.xml b/modules/mono/doc_classes/@C#.xml
index 826c106d7e..83a7fbf02c 100644
--- a/modules/mono/doc_classes/@C#.xml
+++ b/modules/mono/doc_classes/@C#.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="@C#" category="Core" version="3.2">
+<class name="@C#" version="4.0">
<brief_description>
</brief_description>
<description>
diff --git a/modules/mono/doc_classes/CSharpScript.xml b/modules/mono/doc_classes/CSharpScript.xml
index de2e246ea9..1eb3404f9e 100644
--- a/modules/mono/doc_classes/CSharpScript.xml
+++ b/modules/mono/doc_classes/CSharpScript.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="CSharpScript" inherits="Script" category="Core" version="3.2">
+<class name="CSharpScript" inherits="Script" version="4.0">
<brief_description>
</brief_description>
<description>
@@ -8,7 +8,7 @@
</tutorials>
<methods>
<method name="new" qualifiers="vararg">
- <return type="Object">
+ <return type="Variant">
</return>
<description>
</description>
diff --git a/modules/mono/doc_classes/GodotSharp.xml b/modules/mono/doc_classes/GodotSharp.xml
index 18556a84ba..19a08d2036 100644
--- a/modules/mono/doc_classes/GodotSharp.xml
+++ b/modules/mono/doc_classes/GodotSharp.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="GodotSharp" inherits="Object" category="Core" version="3.2">
+<class name="GodotSharp" inherits="Object" version="4.0">
<brief_description>
</brief_description>
<description>
diff --git a/modules/mono/editor/GodotTools/GodotTools/BottomPanel.cs b/modules/mono/editor/GodotTools/GodotTools/BottomPanel.cs
index 4c76d2abf1..bd7eb59913 100644
--- a/modules/mono/editor/GodotTools/GodotTools/BottomPanel.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/BottomPanel.cs
@@ -172,7 +172,7 @@ namespace GodotTools
return;
// Notify running game for hot-reload
- Internal.ScriptEditorDebuggerReloadScripts();
+ Internal.EditorDebuggerNodeReloadScripts();
// Hot-reload in the editor
GodotSharpEditor.Instance.GetNode<HotReloadAssemblyWatcher>("HotReloadAssemblyWatcher").RestartTimer();
diff --git a/modules/mono/editor/GodotTools/GodotTools/Build/MsBuildFinder.cs b/modules/mono/editor/GodotTools/GodotTools/Build/MsBuildFinder.cs
index c3db52aa9e..af8d070cbd 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Build/MsBuildFinder.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Build/MsBuildFinder.cs
@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using System.IO;
using Godot;
+using GodotTools.Ides.Rider;
using GodotTools.Internals;
using Directory = System.IO.Directory;
using Environment = System.Environment;
@@ -54,6 +55,12 @@ namespace GodotTools.Build
return msbuildPath;
}
+ case BuildManager.BuildTool.JetBrainsMsBuild:
+ var editorPath = (string)editorSettings.GetSetting(RiderPathManager.EditorPathSettingName);
+ if (!File.Exists(editorPath))
+ throw new FileNotFoundException($"Cannot find Rider executable. Tried with path: {editorPath}");
+ var riderDir = new FileInfo(editorPath).Directory.Parent;
+ return Path.Combine(riderDir.FullName, @"tools\MSBuild\Current\Bin\MSBuild.exe");
default:
throw new IndexOutOfRangeException("Invalid build tool in editor settings");
}
diff --git a/modules/mono/editor/GodotTools/GodotTools/BuildManager.cs b/modules/mono/editor/GodotTools/GodotTools/BuildManager.cs
index fa6bf4dafd..69a8c9cf4a 100644
--- a/modules/mono/editor/GodotTools/GodotTools/BuildManager.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/BuildManager.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using GodotTools.Build;
+using GodotTools.Ides.Rider;
using GodotTools.Internals;
using GodotTools.Utils;
using static GodotTools.Internals.Globals;
@@ -16,6 +17,7 @@ namespace GodotTools
public const string PropNameMsbuildMono = "MSBuild (Mono)";
public const string PropNameMsbuildVs = "MSBuild (VS Build Tools)";
+ public const string PropNameMsbuildJetBrains = "MSBuild (JetBrains Rider)";
public const string MsBuildIssuesFileName = "msbuild_issues.csv";
public const string MsBuildLogFileName = "msbuild_log.txt";
@@ -23,7 +25,8 @@ namespace GodotTools
public enum BuildTool
{
MsBuildMono,
- MsBuildVs
+ MsBuildVs,
+ JetBrainsMsBuild
}
private static void RemoveOldIssuesFile(BuildInfo buildInfo)
@@ -181,7 +184,7 @@ namespace GodotTools
var buildInfo = new BuildInfo(GodotSharpDirs.ProjectSlnPath, config);
// Add Godot defines
- string constants = buildTool == BuildTool.MsBuildVs ? "GodotDefineConstants=\"" : "GodotDefineConstants=\\\"";
+ string constants = buildTool != BuildTool.MsBuildMono ? "GodotDefineConstants=\"" : "GodotDefineConstants=\\\"";
foreach (var godotDefine in godotDefines)
constants += $"GODOT_{godotDefine.ToUpper().Replace("-", "_").Replace(" ", "_").Replace(";", "_")};";
@@ -189,7 +192,7 @@ namespace GodotTools
if (Internal.GodotIsRealTDouble())
constants += "GODOT_REAL_T_IS_DOUBLE;";
- constants += buildTool == BuildTool.MsBuildVs ? "\"" : "\\\"";
+ constants += buildTool != BuildTool.MsBuildMono ? "\"" : "\\\"";
buildInfo.CustomProperties.Add(constants);
@@ -245,18 +248,22 @@ namespace GodotTools
public static void Initialize()
{
// Build tool settings
-
- EditorDef("mono/builds/build_tool", OS.IsWindows ? BuildTool.MsBuildVs : BuildTool.MsBuildMono);
-
var editorSettings = GodotSharpEditor.Instance.GetEditorInterface().GetEditorSettings();
-
+ var msbuild = BuildTool.MsBuildMono;
+ if (OS.IsWindows)
+ msbuild = RiderPathManager.IsRider((string) editorSettings.GetSetting(RiderPathManager.EditorPathSettingName))
+ ? BuildTool.JetBrainsMsBuild
+ : BuildTool.MsBuildVs;
+
+ EditorDef("mono/builds/build_tool", msbuild);
+
editorSettings.AddPropertyInfo(new Godot.Collections.Dictionary
{
["type"] = Godot.Variant.Type.Int,
["name"] = "mono/builds/build_tool",
["hint"] = Godot.PropertyHint.Enum,
["hint_string"] = OS.IsWindows ?
- $"{PropNameMsbuildMono},{PropNameMsbuildVs}" :
+ $"{PropNameMsbuildMono},{PropNameMsbuildVs},{PropNameMsbuildJetBrains}" :
$"{PropNameMsbuildMono}"
});
diff --git a/modules/mono/editor/GodotTools/GodotTools/BuildTab.cs b/modules/mono/editor/GodotTools/GodotTools/BuildTab.cs
index 727581daab..f75fe239e3 100644
--- a/modules/mono/editor/GodotTools/GodotTools/BuildTab.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/BuildTab.cs
@@ -41,7 +41,7 @@ namespace GodotTools
public bool ErrorsVisible { get; set; } = true;
public bool WarningsVisible { get; set; } = true;
- public Texture IconTexture
+ public Texture2D IconTexture
{
get
{
diff --git a/modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathLocator.cs b/modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathLocator.cs
index 9038333d38..5965e0fbcf 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathLocator.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathLocator.cs
@@ -11,6 +11,10 @@ using Environment = System.Environment;
using File = System.IO.File;
using Path = System.IO.Path;
using OS = GodotTools.Utils.OS;
+// ReSharper disable UnassignedField.Local
+// ReSharper disable InconsistentNaming
+// ReSharper disable UnassignedField.Global
+// ReSharper disable MemberHidesStaticFromOuterClass
namespace GodotTools.Ides.Rider
{
@@ -131,28 +135,45 @@ namespace GodotTools.Ides.Rider
if (OS.IsWindows)
{
var localAppData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
- return Path.Combine(localAppData, @"JetBrains\Toolbox\apps\Rider");
+ return GetToolboxRiderRootPath(localAppData);
}
if (OS.IsOSX)
{
var home = Environment.GetEnvironmentVariable("HOME");
- if (!string.IsNullOrEmpty(home))
- {
- return Path.Combine(home, @"Library/Application Support/JetBrains/Toolbox/apps/Rider");
- }
+ if (string.IsNullOrEmpty(home))
+ return string.Empty;
+ var localAppData = Path.Combine(home, @"Library/Application Support");
+ return GetToolboxRiderRootPath(localAppData);
}
if (OS.IsUnixLike())
{
var home = Environment.GetEnvironmentVariable("HOME");
- if (!string.IsNullOrEmpty(home))
- {
- return Path.Combine(home, @".local/share/JetBrains/Toolbox/apps/Rider");
- }
+ if (string.IsNullOrEmpty(home))
+ return string.Empty;
+ var localAppData = Path.Combine(home, @".local/share");
+ return GetToolboxRiderRootPath(localAppData);
+ }
+
+ return string.Empty;
+ }
+
+
+ private static string GetToolboxRiderRootPath(string localAppData)
+ {
+ var toolboxPath = Path.Combine(localAppData, @"JetBrains\Toolbox");
+ var settingsJson = Path.Combine(toolboxPath, ".settings.json");
+
+ if (File.Exists(settingsJson))
+ {
+ var path = SettingsJson.GetInstallLocationFromJson(File.ReadAllText(settingsJson));
+ if (!string.IsNullOrEmpty(path))
+ toolboxPath = path;
}
- throw new Exception("Unexpected OS.");
+ var toolboxRiderRootPath = Path.Combine(toolboxPath, @"apps\Rider");
+ return toolboxRiderRootPath;
}
internal static ProductInfo GetBuildVersion(string path)
@@ -226,8 +247,8 @@ namespace GodotTools.Ides.Rider
{
try
{
- // use history.json - last entry stands for the active build https://jetbrains.slack.com/archives/C07KNP99D/p1547807024066500?thread_ts=1547731708.057700&cid=C07KNP99D
- var historyFile = Path.Combine(channelDir, ".history.json");
+ // use history.json - last entry stands for the active build https://jetbrains.slack.com/archives/C07KNP99D/p1547807024066500?thread_ts=1547731708.057700&cid=C07KNP99D
+ var historyFile = Path.Combine(channelDir, ".history.json");
if (File.Exists(historyFile))
{
var json = File.ReadAllText(historyFile);
@@ -255,14 +276,14 @@ namespace GodotTools.Ides.Rider
}
}
- // changes in toolbox json files format may brake the logic above, so return all found Rider installations
- return Directory.GetDirectories(channelDir)
- .SelectMany(buildDir => GetExecutablePaths(dirName, searchPattern, isMac, buildDir));
+ // changes in toolbox json files format may brake the logic above, so return all found Rider installations
+ return Directory.GetDirectories(channelDir)
+ .SelectMany(buildDir => GetExecutablePaths(dirName, searchPattern, isMac, buildDir));
}
catch (Exception e)
{
- // do not write to Debug.Log, just log it.
- Logger.Warn($"Failed to get RiderPath from {channelDir}", e);
+ // do not write to Debug.Log, just log it.
+ Logger.Warn($"Failed to get RiderPath from {channelDir}", e);
}
return new string[0];
@@ -289,6 +310,27 @@ namespace GodotTools.Ides.Rider
#pragma warning disable 0649
[Serializable]
+ class SettingsJson
+ {
+ public string install_location;
+
+ [CanBeNull]
+ public static string GetInstallLocationFromJson(string json)
+ {
+ try
+ {
+ return JsonConvert.DeserializeObject<SettingsJson>(json).install_location;
+ }
+ catch (Exception)
+ {
+ Logger.Warn($"Failed to get install_location from json {json}");
+ }
+
+ return null;
+ }
+ }
+
+ [Serializable]
class ToolboxHistory
{
public List<ItemNode> history;
@@ -372,7 +414,6 @@ namespace GodotTools.Ides.Rider
[Serializable]
class ActiveApplication
{
- // ReSharper disable once InconsistentNaming
public List<string> builds;
}
@@ -380,6 +421,7 @@ namespace GodotTools.Ides.Rider
public struct RiderInfo
{
+ // ReSharper disable once NotAccessedField.Global
public bool IsToolbox;
public string Presentation;
public Version BuildNumber;
diff --git a/modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathManager.cs b/modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathManager.cs
index 558a242bf9..ee5677a6a8 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathManager.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathManager.cs
@@ -9,13 +9,13 @@ namespace GodotTools.Ides.Rider
{
public static class RiderPathManager
{
- private static readonly string editorPathSettingName = "mono/editor/editor_path_optional";
+ public static readonly string EditorPathSettingName = "mono/editor/editor_path_optional";
private static string GetRiderPathFromSettings()
{
var editorSettings = GodotSharpEditor.Instance.GetEditorInterface().GetEditorSettings();
- if (editorSettings.HasSetting(editorPathSettingName))
- return (string)editorSettings.GetSetting(editorPathSettingName);
+ if (editorSettings.HasSetting(EditorPathSettingName))
+ return (string)editorSettings.GetSetting(EditorPathSettingName);
return null;
}
@@ -25,22 +25,22 @@ namespace GodotTools.Ides.Rider
var editor = (ExternalEditorId)editorSettings.GetSetting("mono/editor/external_editor");
if (editor == ExternalEditorId.Rider)
{
- if (!editorSettings.HasSetting(editorPathSettingName))
+ if (!editorSettings.HasSetting(EditorPathSettingName))
{
- Globals.EditorDef(editorPathSettingName, "Optional");
+ Globals.EditorDef(EditorPathSettingName, "Optional");
editorSettings.AddPropertyInfo(new Godot.Collections.Dictionary
{
["type"] = Variant.Type.String,
- ["name"] = editorPathSettingName,
+ ["name"] = EditorPathSettingName,
["hint"] = PropertyHint.File,
["hint_string"] = ""
});
}
- var riderPath = (string)editorSettings.GetSetting(editorPathSettingName);
+ var riderPath = (string)editorSettings.GetSetting(EditorPathSettingName);
if (IsRiderAndExists(riderPath))
{
- Globals.EditorDef(editorPathSettingName, riderPath);
+ Globals.EditorDef(EditorPathSettingName, riderPath);
return;
}
@@ -50,17 +50,15 @@ namespace GodotTools.Ides.Rider
return;
var newPath = paths.Last().Path;
- Globals.EditorDef(editorPathSettingName, newPath);
- editorSettings.SetSetting(editorPathSettingName, newPath);
+ Globals.EditorDef(EditorPathSettingName, newPath);
+ editorSettings.SetSetting(EditorPathSettingName, newPath);
}
}
- private static bool IsRider(string path)
+ public static bool IsRider(string path)
{
if (string.IsNullOrEmpty(path))
- {
return false;
- }
var fileInfo = new FileInfo(path);
var filename = fileInfo.Name.ToLowerInvariant();
@@ -81,8 +79,8 @@ namespace GodotTools.Ides.Rider
return null;
var newPath = paths.Last().Path;
- editorSettings.SetSetting(editorPathSettingName, newPath);
- Globals.EditorDef(editorPathSettingName, newPath);
+ editorSettings.SetSetting(EditorPathSettingName, newPath);
+ Globals.EditorDef(EditorPathSettingName, newPath);
return newPath;
}
diff --git a/modules/mono/editor/GodotTools/GodotTools/Internals/Internal.cs b/modules/mono/editor/GodotTools/GodotTools/Internals/Internal.cs
index de361ba844..2e121ba879 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Internals/Internal.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Internals/Internal.cs
@@ -34,7 +34,7 @@ namespace GodotTools.Internals
public static void ReloadAssemblies(bool softReload) => internal_ReloadAssemblies(softReload);
- public static void ScriptEditorDebuggerReloadScripts() => internal_ScriptEditorDebuggerReloadScripts();
+ public static void EditorDebuggerNodeReloadScripts() => internal_EditorDebuggerNodeReloadScripts();
public static bool ScriptEditorEdit(Resource resource, int line, int col, bool grabFocus = true) =>
internal_ScriptEditorEdit(resource, line, col, grabFocus);
@@ -88,7 +88,7 @@ namespace GodotTools.Internals
private static extern void internal_ReloadAssemblies(bool softReload);
[MethodImpl(MethodImplOptions.InternalCall)]
- private static extern void internal_ScriptEditorDebuggerReloadScripts();
+ private static extern void internal_EditorDebuggerNodeReloadScripts();
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern bool internal_ScriptEditorEdit(Resource resource, int line, int col, bool grabFocus);
diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp
index 34f01ce3c6..908c72c591 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 == "PackedInt32Array") {
xml_output.append("<see cref=\"int\"/>");
- } else if (tag == "PoolRealArray") {
+ } else if (tag == "PackedFloat32Array") {
#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));
@@ -2054,7 +2054,7 @@ Error BindingsGenerator::_generate_glue_method(const BindingsGenerator::TypeInte
}
if (p_imethod.is_vararg) {
- p_output.append("\tVariant::CallError vcall_error;\n\t");
+ p_output.append("\tCallable::CallError vcall_error;\n\t");
if (!ret_void) {
// See the comment on the C_LOCAL_VARARG_RET declaration
@@ -2383,7 +2383,7 @@ bool BindingsGenerator::_populate_object_type_interfaces() {
} else {
if (return_info.type == Variant::INT) {
imethod.return_type.cname = _get_int_type_name_from_meta(m ? m->get_argument_meta(-1) : GodotTypeInfo::METADATA_NONE);
- } else if (return_info.type == Variant::REAL) {
+ } else if (return_info.type == Variant::FLOAT) {
imethod.return_type.cname = _get_float_type_name_from_meta(m ? m->get_argument_meta(-1) : GodotTypeInfo::METADATA_NONE);
} else {
imethod.return_type.cname = Variant::get_type_name(return_info.type);
@@ -2410,7 +2410,7 @@ bool BindingsGenerator::_populate_object_type_interfaces() {
} else {
if (arginfo.type == Variant::INT) {
iarg.type.cname = _get_int_type_name_from_meta(m ? m->get_argument_meta(i) : GodotTypeInfo::METADATA_NONE);
- } else if (arginfo.type == Variant::REAL) {
+ } else if (arginfo.type == Variant::FLOAT) {
iarg.type.cname = _get_float_type_name_from_meta(m ? m->get_argument_meta(i) : GodotTypeInfo::METADATA_NONE);
} else {
iarg.type.cname = Variant::get_type_name(arginfo.type);
@@ -2581,7 +2581,7 @@ bool BindingsGenerator::_arg_default_value_from_variant(const Variant &p_val, Ar
r_iarg.default_argument = "(%s)" + r_iarg.default_argument;
}
break;
- case Variant::REAL:
+ case Variant::FLOAT:
#ifndef REAL_T_IS_DOUBLE
r_iarg.default_argument += "f";
#endif
@@ -2628,13 +2628,15 @@ 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_INT32_ARRAY:
+ case Variant::PACKED_FLOAT32_ARRAY:
+ case Variant::PACKED_INT64_ARRAY:
+ case Variant::PACKED_FLOAT64_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 +2916,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(PackedInt32Array, int);
+ INSERT_ARRAY_FULL(PackedByteArray, PackedByteArray, byte);
#ifdef REAL_T_IS_DOUBLE
- INSERT_ARRAY(PoolRealArray, double);
+ INSERT_ARRAY(PackedFloat32Array, double);
#else
- INSERT_ARRAY(PoolRealArray, float);
+ INSERT_ARRAY(PackedFloat32Array, 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/editor/editor_internal_calls.cpp b/modules/mono/editor/editor_internal_calls.cpp
index c8d20e80be..31996a03d0 100644
--- a/modules/mono/editor/editor_internal_calls.cpp
+++ b/modules/mono/editor/editor_internal_calls.cpp
@@ -36,10 +36,10 @@
#include "core/os/os.h"
#include "core/version.h"
+#include "editor/debugger/editor_debugger_node.h"
#include "editor/editor_node.h"
#include "editor/editor_scale.h"
#include "editor/plugins/script_editor_plugin.h"
-#include "editor/script_editor_debugger.h"
#include "main/main.h"
#include "../csharp_script.h"
@@ -305,8 +305,8 @@ void godot_icall_Internal_ReloadAssemblies(MonoBoolean p_soft_reload) {
#endif
}
-void godot_icall_Internal_ScriptEditorDebuggerReloadScripts() {
- ScriptEditor::get_singleton()->get_debugger()->reload_scripts();
+void godot_icall_Internal_EditorDebuggerNodeReloadScripts() {
+ EditorDebuggerNode::get_singleton()->reload_scripts();
}
MonoBoolean godot_icall_Internal_ScriptEditorEdit(MonoObject *p_resource, int32_t p_line, int32_t p_col, MonoBoolean p_grab_focus) {
@@ -348,9 +348,9 @@ void godot_icall_Internal_EditorRunStop() {
}
void godot_icall_Internal_ScriptEditorDebugger_ReloadScripts() {
- ScriptEditorDebugger *sed = ScriptEditor::get_singleton()->get_debugger();
- if (sed) {
- sed->reload_scripts();
+ EditorDebuggerNode *ed = EditorDebuggerNode::get_singleton();
+ if (ed) {
+ ed->reload_scripts();
}
}
@@ -446,7 +446,7 @@ void register_editor_internal_calls() {
mono_add_internal_call("GodotTools.Internals.Internal::internal_GetEditorApiHash", (void *)godot_icall_Internal_GetEditorApiHash);
mono_add_internal_call("GodotTools.Internals.Internal::internal_IsAssembliesReloadingNeeded", (void *)godot_icall_Internal_IsAssembliesReloadingNeeded);
mono_add_internal_call("GodotTools.Internals.Internal::internal_ReloadAssemblies", (void *)godot_icall_Internal_ReloadAssemblies);
- mono_add_internal_call("GodotTools.Internals.Internal::internal_ScriptEditorDebuggerReloadScripts", (void *)godot_icall_Internal_ScriptEditorDebuggerReloadScripts);
+ mono_add_internal_call("GodotTools.Internals.Internal::internal_EditorDebuggerNodeReloadScripts", (void *)godot_icall_Internal_EditorDebuggerNodeReloadScripts);
mono_add_internal_call("GodotTools.Internals.Internal::internal_ScriptEditorEdit", (void *)godot_icall_Internal_ScriptEditorEdit);
mono_add_internal_call("GodotTools.Internals.Internal::internal_EditorNodeShowScriptScreen", (void *)godot_icall_Internal_EditorNodeShowScriptScreen);
mono_add_internal_call("GodotTools.Internals.Internal::internal_GetScriptsMetadataOrNothing", (void *)godot_icall_Internal_GetScriptsMetadataOrNothing);
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/StringExtensions.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/StringExtensions.cs
index b85a00d869..099eacd7dd 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/StringExtensions.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/StringExtensions.cs
@@ -981,7 +981,7 @@ namespace Godot
}
// <summary>
- // Convert the String (which is a character array) to PoolByteArray (which is an array of bytes). The conversion is speeded up in comparison to to_utf8() with the assumption that all the characters the String contains are only ASCII characters.
+ // Convert the String (which is a character array) to PackedByteArray (which is an array of bytes). The conversion is speeded up in comparison to to_utf8() with the assumption that all the characters the String contains are only ASCII characters.
// </summary>
public static byte[] ToAscii(this string instance)
{
@@ -1021,7 +1021,7 @@ namespace Godot
}
// <summary>
- // Convert the String (which is an array of characters) to PoolByteArray (which is an array of bytes). The conversion is a bit slower than to_ascii(), but supports all UTF-8 characters. Therefore, you should prefer this function over to_ascii().
+ // Convert the String (which is an array of characters) to PackedByteArray (which is an array of bytes). The conversion is a bit slower than to_ascii(), but supports all UTF-8 characters. Therefore, you should prefer this function over to_ascii().
// </summary>
public static byte[] ToUTF8(this string instance)
{
diff --git a/modules/mono/glue/base_object_glue.cpp b/modules/mono/glue/base_object_glue.cpp
index 02246b2f2f..8c77220b85 100644
--- a/modules/mono/glue/base_object_glue.cpp
+++ b/modules/mono/glue/base_object_glue.cpp
@@ -189,12 +189,12 @@ MonoBoolean godot_icall_DynamicGodotObject_InvokeMember(Object *p_ptr, MonoStrin
args.set(i, &arg_store.get(i));
}
- Variant::CallError error;
+ Callable::CallError error;
Variant result = p_ptr->call(StringName(name), args.ptr(), argc, error);
*r_result = GDMonoMarshal::variant_to_mono_object(result);
- return error.error == Variant::CallError::CALL_OK;
+ return error.error == Callable::CallError::CALL_OK;
}
MonoBoolean godot_icall_DynamicGodotObject_GetMember(Object *p_ptr, MonoString *p_name, MonoObject **r_result) {
@@ -224,14 +224,9 @@ MonoString *godot_icall_Object_ToString(Object *p_ptr) {
#ifdef DEBUG_ENABLED
// Cannot happen in C#; would get an ObjectDisposedException instead.
CRASH_COND(p_ptr == NULL);
-
- if (ScriptDebugger::get_singleton() && !Object::cast_to<Reference>(p_ptr)) { // Only if debugging!
- // Cannot happen either in C#; the handle is nullified when the object is destroyed
- CRASH_COND(!ObjectDB::instance_validate(p_ptr));
- }
#endif
- String result = "[" + p_ptr->get_class() + ":" + itos(p_ptr->get_instance_id()) + "]";
+ String result = p_ptr->to_string();
return GDMonoMarshal::mono_string_from_godot(result);
}
diff --git a/modules/mono/glue/gd_glue.cpp b/modules/mono/glue/gd_glue.cpp
index 17483c4457..cdacd90538 100644
--- a/modules/mono/glue/gd_glue.cpp
+++ b/modules/mono/glue/gd_glue.cpp
@@ -44,9 +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();
- Error err = decode_variant(ret, r.ptr(), varr.size(), NULL, p_allow_objects);
+ PackedByteArray varr = GDMonoMarshal::mono_array_to_PackedByteArray(p_bytes);
+ Error err = decode_variant(ret, varr.ptr(), varr.size(), NULL, p_allow_objects);
if (err != OK) {
ret = RTR("Not enough bytes for decoding bytes, or invalid format.");
}
@@ -56,9 +55,9 @@ MonoObject *godot_icall_GD_bytes2var(MonoArray *p_bytes, MonoBoolean p_allow_obj
MonoObject *godot_icall_GD_convert(MonoObject *p_what, int32_t p_type) {
Variant what = GDMonoMarshal::mono_object_to_variant(p_what);
const Variant *args[1] = { &what };
- Variant::CallError ce;
+ Callable::CallError ce;
Variant ret = Variant::construct(Variant::Type(p_type), args, 1, ce);
- ERR_FAIL_COND_V(ce.error != Variant::CallError::CALL_OK, NULL);
+ ERR_FAIL_COND_V(ce.error != Callable::CallError::CALL_OK, NULL);
return GDMonoMarshal::variant_to_mono_object(ret);
}
@@ -67,7 +66,7 @@ int godot_icall_GD_hash(MonoObject *p_var) {
}
MonoObject *godot_icall_GD_instance_from_id(uint64_t p_instance_id) {
- return GDMonoUtils::unmanaged_get_managed(ObjectDB::get_instance(p_instance_id));
+ return GDMonoUtils::unmanaged_get_managed(ObjectDB::get_instance(ObjectID(p_instance_id)));
}
void godot_icall_GD_print(MonoArray *p_what) {
@@ -257,18 +256,15 @@ 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();
- encode_variant(var, w.ptr(), len, p_full_objects);
- }
+ encode_variant(var, barr.ptrw(), 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..03b56c9949 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(PackedInt32Array);
break;
}
if (array_type->eklass == REAL_T_MONOCLASS) {
- SET_FROM_ARRAY(PoolRealArray);
+ SET_FROM_ARRAY(PackedFloat32Array);
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;
}
@@ -370,7 +370,7 @@ void GDMonoField::set_value_from_variant(MonoObject *p_object, const Variant &p_
int32_t val = p_value.operator signed int();
mono_field_set_value(p_object, mono_field, &val);
} break;
- case Variant::REAL: {
+ case Variant::FLOAT: {
#ifdef REAL_T_IS_DOUBLE
double val = p_value.operator double();
mono_field_set_value(p_object, mono_field, &val);
@@ -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_INT32_ARRAY: {
+ SET_FROM_ARRAY(PackedInt32Array);
} break;
- case Variant::POOL_REAL_ARRAY: {
- SET_FROM_ARRAY(PoolRealArray);
+ case Variant::PACKED_FLOAT32_ARRAY: {
+ SET_FROM_ARRAY(PackedFloat32Array);
} 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..695be64d6e 100644
--- a/modules/mono/mono_gd/gd_mono_marshal.cpp
+++ b/modules/mono/mono_gd/gd_mono_marshal.cpp
@@ -60,9 +60,9 @@ Variant::Type managed_to_variant_type(const ManagedType &p_type) {
return Variant::INT;
case MONO_TYPE_R4:
- return Variant::REAL;
+ return Variant::FLOAT;
case MONO_TYPE_R8:
- return Variant::REAL;
+ return Variant::FLOAT;
case MONO_TYPE_STRING: {
return Variant::STRING;
@@ -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_INT32_ARRAY;
if (array_type->eklass == REAL_T_MONOCLASS)
- return Variant::POOL_REAL_ARRAY;
+ return Variant::PACKED_FLOAT32_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 *)PackedInt32Array_to_mono_array(p_var->operator PackedInt32Array());
if (array_type->eklass == REAL_T_MONOCLASS)
- return (MonoObject *)PoolRealArray_to_mono_array(p_var->operator PoolRealArray());
+ return (MonoObject *)PackedFloat32Array_to_mono_array(p_var->operator PackedFloat32Array());
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;
@@ -577,7 +577,7 @@ MonoObject *variant_to_mono_object(const Variant *p_var, const ManagedType &p_ty
int32_t val = p_var->operator signed int();
return BOX_INT32(val);
}
- case Variant::REAL: {
+ case Variant::FLOAT: {
#ifdef REAL_T_IS_DOUBLE
double val = p_var->operator double();
return BOX_DOUBLE(val);
@@ -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_INT32_ARRAY:
+ return (MonoObject *)PackedInt32Array_to_mono_array(p_var->operator PackedInt32Array());
+ case Variant::PACKED_FLOAT32_ARRAY:
+ return (MonoObject *)PackedFloat32Array_to_mono_array(p_var->operator PackedFloat32Array());
+ 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_PackedInt32Array((MonoArray *)p_obj);
if (array_type->eklass == REAL_T_MONOCLASS)
- return mono_array_to_PoolRealArray((MonoArray *)p_obj);
+ return mono_array_to_PackedFloat32Array((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 *PackedInt32Array_to_mono_array(const PackedInt32Array &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;
+PackedInt32Array mono_array_to_PackedInt32Array(MonoArray *p_array) {
+ PackedInt32Array 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 *PackedFloat32Array_to_mono_array(const PackedFloat32Array &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;
+PackedFloat32Array mono_array_to_PackedFloat32Array(MonoArray *p_array) {
+ PackedFloat32Array 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..5db59522ce 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
+// PackedInt32Array
-MonoArray *PoolIntArray_to_mono_array(const PoolIntArray &p_array);
-PoolIntArray mono_array_to_PoolIntArray(MonoArray *p_array);
+MonoArray *PackedInt32Array_to_mono_array(const PackedInt32Array &p_array);
+PackedInt32Array mono_array_to_PackedInt32Array(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
+// PackedFloat32Array
-MonoArray *PoolRealArray_to_mono_array(const PoolRealArray &p_array);
-PoolRealArray mono_array_to_PoolRealArray(MonoArray *p_array);
+MonoArray *PackedFloat32Array_to_mono_array(const PackedFloat32Array &p_array);
+PackedFloat32Array mono_array_to_PackedFloat32Array(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/mono_gd/gd_mono_utils.cpp b/modules/mono/mono_gd/gd_mono_utils.cpp
index 05077a00c4..ae6625a6c6 100644
--- a/modules/mono/mono_gd/gd_mono_utils.cpp
+++ b/modules/mono/mono_gd/gd_mono_utils.cpp
@@ -38,7 +38,7 @@
#include "core/reference.h"
#ifdef TOOLS_ENABLED
-#include "editor/script_editor_debugger.h"
+#include "editor/debugger/script_editor_debugger.h"
#endif
#include "../csharp_script.h"
diff --git a/modules/mono/signal_awaiter_utils.cpp b/modules/mono/signal_awaiter_utils.cpp
index b85d5f2fd9..718bc2bb93 100644
--- a/modules/mono/signal_awaiter_utils.cpp
+++ b/modules/mono/signal_awaiter_utils.cpp
@@ -51,7 +51,7 @@ Error connect_signal_awaiter(Object *p_source, const String &p_signal, Object *p
Vector<Variant> binds;
binds.push_back(sa_con);
- Error err = p_source->connect(p_signal, sa_con.ptr(),
+ Error err = p_source->connect_compat(p_signal, sa_con.ptr(),
CSharpLanguage::get_singleton()->get_string_names()._signal_callback,
binds, Object::CONNECT_ONESHOT);
@@ -65,7 +65,7 @@ Error connect_signal_awaiter(Object *p_source, const String &p_signal, Object *p
}
} // namespace SignalAwaiterUtils
-Variant SignalAwaiterHandle::_signal_callback(const Variant **p_args, int p_argcount, Variant::CallError &r_error) {
+Variant SignalAwaiterHandle::_signal_callback(const Variant **p_args, int p_argcount, Callable::CallError &r_error) {
#ifdef DEBUG_ENABLED
ERR_FAIL_COND_V_MSG(conn_target_id.is_valid() && !ObjectDB::get_instance(conn_target_id), Variant(),
@@ -73,7 +73,7 @@ Variant SignalAwaiterHandle::_signal_callback(const Variant **p_args, int p_argc
#endif
if (p_argcount < 1) {
- r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS;
+ r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS;
r_error.argument = 1;
return Variant();
}
@@ -81,7 +81,7 @@ Variant SignalAwaiterHandle::_signal_callback(const Variant **p_args, int p_argc
Ref<SignalAwaiterHandle> self = *p_args[p_argcount - 1];
if (self.is_null()) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = p_argcount - 1;
r_error.expected = Variant::OBJECT;
return Variant();
diff --git a/modules/mono/signal_awaiter_utils.h b/modules/mono/signal_awaiter_utils.h
index a9956ad5ba..012f6e5bb3 100644
--- a/modules/mono/signal_awaiter_utils.h
+++ b/modules/mono/signal_awaiter_utils.h
@@ -49,7 +49,7 @@ class SignalAwaiterHandle : public MonoGCHandle {
ObjectID conn_target_id;
#endif
- Variant _signal_callback(const Variant **p_args, int p_argcount, Variant::CallError &r_error);
+ Variant _signal_callback(const Variant **p_args, int p_argcount, Callable::CallError &r_error);
protected:
static void _bind_methods();
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/noise_texture.cpp b/modules/opensimplex/noise_texture.cpp
index 19aa281a72..d60099e676 100644
--- a/modules/opensimplex/noise_texture.cpp
+++ b/modules/opensimplex/noise_texture.cpp
@@ -84,7 +84,7 @@ void NoiseTexture::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::INT, "height", PROPERTY_HINT_RANGE, "1,2048,1,or_greater"), "set_height", "get_height");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "seamless"), "set_seamless", "get_seamless");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "as_normalmap"), "set_as_normalmap", "is_normalmap");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "bump_strength", PROPERTY_HINT_RANGE, "0,32,0.1,or_greater"), "set_bump_strength", "get_bump_strength");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "bump_strength", PROPERTY_HINT_RANGE, "0,32,0.1,or_greater"), "set_bump_strength", "get_bump_strength");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "noise", PROPERTY_HINT_RESOURCE_TYPE, "OpenSimplexNoise"), "set_noise", "get_noise");
}
@@ -184,11 +184,11 @@ void NoiseTexture::set_noise(Ref<OpenSimplexNoise> p_noise) {
if (p_noise == noise)
return;
if (noise.is_valid()) {
- noise->disconnect(CoreStringNames::get_singleton()->changed, this, "_queue_update");
+ noise->disconnect_compat(CoreStringNames::get_singleton()->changed, this, "_queue_update");
}
noise = p_noise;
if (noise.is_valid()) {
- noise->connect(CoreStringNames::get_singleton()->changed, this, "_queue_update");
+ noise->connect_compat(CoreStringNames::get_singleton()->changed, this, "_queue_update");
}
_queue_update();
}
diff --git a/modules/opensimplex/open_simplex_noise.cpp b/modules/opensimplex/open_simplex_noise.cpp
index bd187e6b5b..238faa4130 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++) {
@@ -186,9 +186,9 @@ void OpenSimplexNoise::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::INT, "seed"), "set_seed", "get_seed");
ADD_PROPERTY(PropertyInfo(Variant::INT, "octaves", PROPERTY_HINT_RANGE, vformat("1,%d,1", MAX_OCTAVES)), "set_octaves", "get_octaves");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "period", PROPERTY_HINT_RANGE, "0.1,256.0,0.1"), "set_period", "get_period");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "persistence", PROPERTY_HINT_RANGE, "0.0,1.0,0.001"), "set_persistence", "get_persistence");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "lacunarity", PROPERTY_HINT_RANGE, "0.1,4.0,0.01"), "set_lacunarity", "get_lacunarity");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "period", PROPERTY_HINT_RANGE, "0.1,256.0,0.1"), "set_period", "get_period");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "persistence", PROPERTY_HINT_RANGE, "0.0,1.0,0.001"), "set_persistence", "get_persistence");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "lacunarity", PROPERTY_HINT_RANGE, "0.1,4.0,0.01"), "set_lacunarity", "get_lacunarity");
}
float OpenSimplexNoise::get_noise_1d(float x) {
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..054ed088df 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,9 +265,9 @@ 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");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "loop_offset"), "set_loop_offset", "get_loop_offset");
}
AudioStreamOGGVorbis::AudioStreamOGGVorbis() {
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/doc_classes/AudioStreamOGGVorbis.xml b/modules/stb_vorbis/doc_classes/AudioStreamOGGVorbis.xml
index 38d3bd5468..8a1bb62e24 100644
--- a/modules/stb_vorbis/doc_classes/AudioStreamOGGVorbis.xml
+++ b/modules/stb_vorbis/doc_classes/AudioStreamOGGVorbis.xml
@@ -11,7 +11,7 @@
<methods>
</methods>
<members>
- <member name="data" type="PoolByteArray" setter="set_data" getter="get_data" default="PoolByteArray( )">
+ <member name="data" type="PackedByteArray" setter="set_data" getter="get_data" default="PackedByteArray( )">
Contains the audio data in bytes.
</member>
<member name="loop" type="bool" setter="set_loop" getter="has_loop" default="false">
diff --git a/modules/stb_vorbis/resource_importer_ogg_vorbis.cpp b/modules/stb_vorbis/resource_importer_ogg_vorbis.cpp
index 06399f4005..13d96541e3 100644
--- a/modules/stb_vorbis/resource_importer_ogg_vorbis.cpp
+++ b/modules/stb_vorbis/resource_importer_ogg_vorbis.cpp
@@ -73,7 +73,7 @@ String ResourceImporterOGGVorbis::get_preset_name(int p_idx) const {
void ResourceImporterOGGVorbis::get_import_options(List<ImportOption> *r_options, int p_preset) const {
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "loop"), true));
- r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "loop_offset"), 0));
+ r_options->push_back(ImportOption(PropertyInfo(Variant::FLOAT, "loop_offset"), 0));
}
Error ResourceImporterOGGVorbis::import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files, Variant *r_metadata) {
@@ -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/doc_classes/VisualScript.xml b/modules/visual_script/doc_classes/VisualScript.xml
index 9cd79aa781..db1ef2adc6 100644
--- a/modules/visual_script/doc_classes/VisualScript.xml
+++ b/modules/visual_script/doc_classes/VisualScript.xml
@@ -15,7 +15,7 @@
<method name="add_custom_signal">
<return type="void">
</return>
- <argument index="0" name="name" type="String">
+ <argument index="0" name="name" type="StringName">
</argument>
<description>
Add a custom signal with the specified name to the VisualScript.
@@ -24,7 +24,7 @@
<method name="add_function">
<return type="void">
</return>
- <argument index="0" name="name" type="String">
+ <argument index="0" name="name" type="StringName">
</argument>
<description>
Add a function with the specified name to the VisualScript.
@@ -33,7 +33,7 @@
<method name="add_node">
<return type="void">
</return>
- <argument index="0" name="func" type="String">
+ <argument index="0" name="func" type="StringName">
</argument>
<argument index="1" name="id" type="int">
</argument>
@@ -48,7 +48,7 @@
<method name="add_variable">
<return type="void">
</return>
- <argument index="0" name="name" type="String">
+ <argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="default_value" type="Variant" default="null">
</argument>
@@ -61,7 +61,7 @@
<method name="custom_signal_add_argument">
<return type="void">
</return>
- <argument index="0" name="name" type="String">
+ <argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="type" type="int" enum="Variant.Type">
</argument>
@@ -76,7 +76,7 @@
<method name="custom_signal_get_argument_count" qualifiers="const">
<return type="int">
</return>
- <argument index="0" name="name" type="String">
+ <argument index="0" name="name" type="StringName">
</argument>
<description>
Get the count of a custom signal's arguments.
@@ -85,7 +85,7 @@
<method name="custom_signal_get_argument_name" qualifiers="const">
<return type="String">
</return>
- <argument index="0" name="name" type="String">
+ <argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="argidx" type="int">
</argument>
@@ -96,7 +96,7 @@
<method name="custom_signal_get_argument_type" qualifiers="const">
<return type="int" enum="Variant.Type">
</return>
- <argument index="0" name="name" type="String">
+ <argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="argidx" type="int">
</argument>
@@ -107,7 +107,7 @@
<method name="custom_signal_remove_argument">
<return type="void">
</return>
- <argument index="0" name="name" type="String">
+ <argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="argidx" type="int">
</argument>
@@ -118,7 +118,7 @@
<method name="custom_signal_set_argument_name">
<return type="void">
</return>
- <argument index="0" name="name" type="String">
+ <argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="argidx" type="int">
</argument>
@@ -131,7 +131,7 @@
<method name="custom_signal_set_argument_type">
<return type="void">
</return>
- <argument index="0" name="name" type="String">
+ <argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="argidx" type="int">
</argument>
@@ -144,7 +144,7 @@
<method name="custom_signal_swap_argument">
<return type="void">
</return>
- <argument index="0" name="name" type="String">
+ <argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="argidx" type="int">
</argument>
@@ -157,7 +157,7 @@
<method name="data_connect">
<return type="void">
</return>
- <argument index="0" name="func" type="String">
+ <argument index="0" name="func" type="StringName">
</argument>
<argument index="1" name="from_node" type="int">
</argument>
@@ -174,7 +174,7 @@
<method name="data_disconnect">
<return type="void">
</return>
- <argument index="0" name="func" type="String">
+ <argument index="0" name="func" type="StringName">
</argument>
<argument index="1" name="from_node" type="int">
</argument>
@@ -191,7 +191,7 @@
<method name="get_function_node_id" qualifiers="const">
<return type="int">
</return>
- <argument index="0" name="name" type="String">
+ <argument index="0" name="name" type="StringName">
</argument>
<description>
Returns the id of a function's entry point node.
@@ -200,7 +200,7 @@
<method name="get_function_scroll" qualifiers="const">
<return type="Vector2">
</return>
- <argument index="0" name="name" type="String">
+ <argument index="0" name="name" type="StringName">
</argument>
<description>
Returns the position of the center of the screen for a given function.
@@ -209,7 +209,7 @@
<method name="get_node" qualifiers="const">
<return type="VisualScriptNode">
</return>
- <argument index="0" name="func" type="String">
+ <argument index="0" name="func" type="StringName">
</argument>
<argument index="1" name="id" type="int">
</argument>
@@ -220,7 +220,7 @@
<method name="get_node_position" qualifiers="const">
<return type="Vector2">
</return>
- <argument index="0" name="func" type="String">
+ <argument index="0" name="func" type="StringName">
</argument>
<argument index="1" name="id" type="int">
</argument>
@@ -231,7 +231,7 @@
<method name="get_variable_default_value" qualifiers="const">
<return type="Variant">
</return>
- <argument index="0" name="name" type="String">
+ <argument index="0" name="name" type="StringName">
</argument>
<description>
Returns the default (initial) value of a variable.
@@ -240,7 +240,7 @@
<method name="get_variable_export" qualifiers="const">
<return type="bool">
</return>
- <argument index="0" name="name" type="String">
+ <argument index="0" name="name" type="StringName">
</argument>
<description>
Returns whether a variable is exported.
@@ -249,7 +249,7 @@
<method name="get_variable_info" qualifiers="const">
<return type="Dictionary">
</return>
- <argument index="0" name="name" type="String">
+ <argument index="0" name="name" type="StringName">
</argument>
<description>
Returns the information for a given variable as a dictionary. The information includes its name, type, hint and usage.
@@ -258,7 +258,7 @@
<method name="has_custom_signal" qualifiers="const">
<return type="bool">
</return>
- <argument index="0" name="name" type="String">
+ <argument index="0" name="name" type="StringName">
</argument>
<description>
Returns whether a signal exists with the specified name.
@@ -267,7 +267,7 @@
<method name="has_data_connection" qualifiers="const">
<return type="bool">
</return>
- <argument index="0" name="func" type="String">
+ <argument index="0" name="func" type="StringName">
</argument>
<argument index="1" name="from_node" type="int">
</argument>
@@ -284,7 +284,7 @@
<method name="has_function" qualifiers="const">
<return type="bool">
</return>
- <argument index="0" name="name" type="String">
+ <argument index="0" name="name" type="StringName">
</argument>
<description>
Returns whether a function exists with the specified name.
@@ -293,7 +293,7 @@
<method name="has_node" qualifiers="const">
<return type="bool">
</return>
- <argument index="0" name="func" type="String">
+ <argument index="0" name="func" type="StringName">
</argument>
<argument index="1" name="id" type="int">
</argument>
@@ -304,7 +304,7 @@
<method name="has_sequence_connection" qualifiers="const">
<return type="bool">
</return>
- <argument index="0" name="func" type="String">
+ <argument index="0" name="func" type="StringName">
</argument>
<argument index="1" name="from_node" type="int">
</argument>
@@ -319,7 +319,7 @@
<method name="has_variable" qualifiers="const">
<return type="bool">
</return>
- <argument index="0" name="name" type="String">
+ <argument index="0" name="name" type="StringName">
</argument>
<description>
Returns whether a variable exists with the specified name.
@@ -328,7 +328,7 @@
<method name="remove_custom_signal">
<return type="void">
</return>
- <argument index="0" name="name" type="String">
+ <argument index="0" name="name" type="StringName">
</argument>
<description>
Remove a custom signal with the given name.
@@ -337,7 +337,7 @@
<method name="remove_function">
<return type="void">
</return>
- <argument index="0" name="name" type="String">
+ <argument index="0" name="name" type="StringName">
</argument>
<description>
Remove a specific function and its nodes from the script.
@@ -346,7 +346,7 @@
<method name="remove_node">
<return type="void">
</return>
- <argument index="0" name="func" type="String">
+ <argument index="0" name="func" type="StringName">
</argument>
<argument index="1" name="id" type="int">
</argument>
@@ -357,7 +357,7 @@
<method name="remove_variable">
<return type="void">
</return>
- <argument index="0" name="name" type="String">
+ <argument index="0" name="name" type="StringName">
</argument>
<description>
Remove a variable with the given name.
@@ -366,9 +366,9 @@
<method name="rename_custom_signal">
<return type="void">
</return>
- <argument index="0" name="name" type="String">
+ <argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="new_name" type="String">
+ <argument index="1" name="new_name" type="StringName">
</argument>
<description>
Change the name of a custom signal.
@@ -377,9 +377,9 @@
<method name="rename_function">
<return type="void">
</return>
- <argument index="0" name="name" type="String">
+ <argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="new_name" type="String">
+ <argument index="1" name="new_name" type="StringName">
</argument>
<description>
Change the name of a function.
@@ -388,9 +388,9 @@
<method name="rename_variable">
<return type="void">
</return>
- <argument index="0" name="name" type="String">
+ <argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="new_name" type="String">
+ <argument index="1" name="new_name" type="StringName">
</argument>
<description>
Change the name of a variable.
@@ -399,7 +399,7 @@
<method name="sequence_connect">
<return type="void">
</return>
- <argument index="0" name="func" type="String">
+ <argument index="0" name="func" type="StringName">
</argument>
<argument index="1" name="from_node" type="int">
</argument>
@@ -415,7 +415,7 @@
<method name="sequence_disconnect">
<return type="void">
</return>
- <argument index="0" name="func" type="String">
+ <argument index="0" name="func" type="StringName">
</argument>
<argument index="1" name="from_node" type="int">
</argument>
@@ -430,7 +430,7 @@
<method name="set_function_scroll">
<return type="void">
</return>
- <argument index="0" name="name" type="String">
+ <argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="ofs" type="Vector2">
</argument>
@@ -441,7 +441,7 @@
<method name="set_instance_base_type">
<return type="void">
</return>
- <argument index="0" name="type" type="String">
+ <argument index="0" name="type" type="StringName">
</argument>
<description>
Set the base type of the script.
@@ -450,7 +450,7 @@
<method name="set_node_position">
<return type="void">
</return>
- <argument index="0" name="func" type="String">
+ <argument index="0" name="func" type="StringName">
</argument>
<argument index="1" name="id" type="int">
</argument>
@@ -463,7 +463,7 @@
<method name="set_variable_default_value">
<return type="void">
</return>
- <argument index="0" name="name" type="String">
+ <argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="value" type="Variant">
</argument>
@@ -474,7 +474,7 @@
<method name="set_variable_export">
<return type="void">
</return>
- <argument index="0" name="name" type="String">
+ <argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="enable" type="bool">
</argument>
@@ -485,7 +485,7 @@
<method name="set_variable_info">
<return type="void">
</return>
- <argument index="0" name="name" type="String">
+ <argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="value" type="Dictionary">
</argument>
diff --git a/modules/visual_script/doc_classes/VisualScriptBasicTypeConstant.xml b/modules/visual_script/doc_classes/VisualScriptBasicTypeConstant.xml
index c8e391c4a1..4d07f878a2 100644
--- a/modules/visual_script/doc_classes/VisualScriptBasicTypeConstant.xml
+++ b/modules/visual_script/doc_classes/VisualScriptBasicTypeConstant.xml
@@ -14,7 +14,7 @@
<member name="basic_type" type="int" setter="set_basic_type" getter="get_basic_type" enum="Variant.Type" default="0">
The type to get the constant from.
</member>
- <member name="constant" type="String" setter="set_basic_type_constant" getter="get_basic_type_constant">
+ <member name="constant" type="StringName" setter="set_basic_type_constant" getter="get_basic_type_constant">
The name of the constant to return.
</member>
</members>
diff --git a/modules/visual_script/doc_classes/VisualScriptBuiltinFunc.xml b/modules/visual_script/doc_classes/VisualScriptBuiltinFunc.xml
index 9f4846ee1f..ef4183e6f6 100644
--- a/modules/visual_script/doc_classes/VisualScriptBuiltinFunc.xml
+++ b/modules/visual_script/doc_classes/VisualScriptBuiltinFunc.xml
@@ -197,10 +197,10 @@
Deserialize a [Variant] from a string serialized using [constant VAR_TO_STR].
</constant>
<constant name="VAR_TO_BYTES" value="61" enum="BuiltinFunc">
- Serialize a [Variant] to a [PoolByteArray].
+ Serialize a [Variant] to a [PackedByteArray].
</constant>
<constant name="BYTES_TO_VAR" value="62" enum="BuiltinFunc">
- Deserialize a [Variant] from a [PoolByteArray] serialized using [constant VAR_TO_BYTES].
+ Deserialize a [Variant] from a [PackedByteArray] serialized using [constant VAR_TO_BYTES].
</constant>
<constant name="COLORN" value="63" enum="BuiltinFunc">
Return the [Color] with the given name and alpha ranging from 0 to 1.
diff --git a/modules/visual_script/doc_classes/VisualScriptClassConstant.xml b/modules/visual_script/doc_classes/VisualScriptClassConstant.xml
index cf35808823..de5d731cc0 100644
--- a/modules/visual_script/doc_classes/VisualScriptClassConstant.xml
+++ b/modules/visual_script/doc_classes/VisualScriptClassConstant.xml
@@ -15,10 +15,10 @@
<methods>
</methods>
<members>
- <member name="base_type" type="String" setter="set_base_type" getter="get_base_type" default="&quot;Object&quot;">
+ <member name="base_type" type="StringName" setter="set_base_type" getter="get_base_type" default="@&quot;Object&quot;">
The constant's parent class.
</member>
- <member name="constant" type="String" setter="set_class_constant" getter="get_class_constant" default="&quot;&quot;">
+ <member name="constant" type="StringName" setter="set_class_constant" getter="get_class_constant" default="@&quot;&quot;">
The constant to return. See the given class for its available constants.
</member>
</members>
diff --git a/modules/visual_script/doc_classes/VisualScriptEmitSignal.xml b/modules/visual_script/doc_classes/VisualScriptEmitSignal.xml
index 60a19ac7a7..5c9c8d3eca 100644
--- a/modules/visual_script/doc_classes/VisualScriptEmitSignal.xml
+++ b/modules/visual_script/doc_classes/VisualScriptEmitSignal.xml
@@ -15,7 +15,7 @@
<methods>
</methods>
<members>
- <member name="signal" type="String" setter="set_signal" getter="get_signal" default="&quot;&quot;">
+ <member name="signal" type="StringName" setter="set_signal" getter="get_signal" default="@&quot;&quot;">
The signal to emit.
</member>
</members>
diff --git a/modules/visual_script/doc_classes/VisualScriptFunctionCall.xml b/modules/visual_script/doc_classes/VisualScriptFunctionCall.xml
index 16c3af7ab2..2d0fac1fa0 100644
--- a/modules/visual_script/doc_classes/VisualScriptFunctionCall.xml
+++ b/modules/visual_script/doc_classes/VisualScriptFunctionCall.xml
@@ -11,19 +11,19 @@
<members>
<member name="base_script" type="String" setter="set_base_script" getter="get_base_script">
</member>
- <member name="base_type" type="String" setter="set_base_type" getter="get_base_type" default="&quot;Object&quot;">
+ <member name="base_type" type="StringName" setter="set_base_type" getter="get_base_type" default="@&quot;Object&quot;">
</member>
<member name="basic_type" type="int" setter="set_basic_type" getter="get_basic_type" enum="Variant.Type">
</member>
<member name="call_mode" type="int" setter="set_call_mode" getter="get_call_mode" enum="VisualScriptFunctionCall.CallMode" default="0">
</member>
- <member name="function" type="String" setter="set_function" getter="get_function" default="&quot;&quot;">
+ <member name="function" type="StringName" setter="set_function" getter="get_function" default="@&quot;&quot;">
</member>
<member name="node_path" type="NodePath" setter="set_base_path" getter="get_base_path">
</member>
<member name="rpc_call_mode" type="int" setter="set_rpc_call_mode" getter="get_rpc_call_mode" enum="VisualScriptFunctionCall.RPCCallMode" default="0">
</member>
- <member name="singleton" type="String" setter="set_singleton" getter="get_singleton">
+ <member name="singleton" type="StringName" setter="set_singleton" getter="get_singleton">
</member>
<member name="use_default_args" type="int" setter="set_use_default_args" getter="get_use_default_args">
</member>
diff --git a/modules/visual_script/doc_classes/VisualScriptInputAction.xml b/modules/visual_script/doc_classes/VisualScriptInputAction.xml
index 0b6325bf0a..6c296fdb4b 100644
--- a/modules/visual_script/doc_classes/VisualScriptInputAction.xml
+++ b/modules/visual_script/doc_classes/VisualScriptInputAction.xml
@@ -9,7 +9,7 @@
<methods>
</methods>
<members>
- <member name="action" type="String" setter="set_action_name" getter="get_action_name" default="&quot;&quot;">
+ <member name="action" type="StringName" setter="set_action_name" getter="get_action_name" default="@&quot;&quot;">
</member>
<member name="mode" type="int" setter="set_action_mode" getter="get_action_mode" enum="VisualScriptInputAction.Mode" default="0">
</member>
diff --git a/modules/visual_script/doc_classes/VisualScriptLocalVar.xml b/modules/visual_script/doc_classes/VisualScriptLocalVar.xml
index 6c31ae1a30..c3741eea89 100644
--- a/modules/visual_script/doc_classes/VisualScriptLocalVar.xml
+++ b/modules/visual_script/doc_classes/VisualScriptLocalVar.xml
@@ -18,7 +18,7 @@
<member name="type" type="int" setter="set_var_type" getter="get_var_type" enum="Variant.Type" default="0">
The local variable's type.
</member>
- <member name="var_name" type="String" setter="set_var_name" getter="get_var_name" default="&quot;new_local&quot;">
+ <member name="var_name" type="StringName" setter="set_var_name" getter="get_var_name" default="@&quot;new_local&quot;">
The local variable's name.
</member>
</members>
diff --git a/modules/visual_script/doc_classes/VisualScriptLocalVarSet.xml b/modules/visual_script/doc_classes/VisualScriptLocalVarSet.xml
index 0a9a509958..619bbb90ca 100644
--- a/modules/visual_script/doc_classes/VisualScriptLocalVarSet.xml
+++ b/modules/visual_script/doc_classes/VisualScriptLocalVarSet.xml
@@ -20,7 +20,7 @@
<member name="type" type="int" setter="set_var_type" getter="get_var_type" enum="Variant.Type" default="0">
The local variable's type.
</member>
- <member name="var_name" type="String" setter="set_var_name" getter="get_var_name" default="&quot;new_local&quot;">
+ <member name="var_name" type="StringName" setter="set_var_name" getter="get_var_name" default="@&quot;new_local&quot;">
The local variable's name.
</member>
</members>
diff --git a/modules/visual_script/doc_classes/VisualScriptPropertyGet.xml b/modules/visual_script/doc_classes/VisualScriptPropertyGet.xml
index cf436116b8..f13d449064 100644
--- a/modules/visual_script/doc_classes/VisualScriptPropertyGet.xml
+++ b/modules/visual_script/doc_classes/VisualScriptPropertyGet.xml
@@ -11,15 +11,15 @@
<members>
<member name="base_script" type="String" setter="set_base_script" getter="get_base_script">
</member>
- <member name="base_type" type="String" setter="set_base_type" getter="get_base_type" default="&quot;Object&quot;">
+ <member name="base_type" type="StringName" setter="set_base_type" getter="get_base_type" default="@&quot;Object&quot;">
</member>
<member name="basic_type" type="int" setter="set_basic_type" getter="get_basic_type" enum="Variant.Type">
</member>
- <member name="index" type="String" setter="set_index" getter="get_index">
+ <member name="index" type="StringName" setter="set_index" getter="get_index">
</member>
<member name="node_path" type="NodePath" setter="set_base_path" getter="get_base_path">
</member>
- <member name="property" type="String" setter="set_property" getter="get_property" default="&quot;&quot;">
+ <member name="property" type="StringName" setter="set_property" getter="get_property" default="@&quot;&quot;">
</member>
<member name="set_mode" type="int" setter="set_call_mode" getter="get_call_mode" enum="VisualScriptPropertyGet.CallMode" default="0">
</member>
diff --git a/modules/visual_script/doc_classes/VisualScriptPropertySet.xml b/modules/visual_script/doc_classes/VisualScriptPropertySet.xml
index 357b4b9f5c..629576e261 100644
--- a/modules/visual_script/doc_classes/VisualScriptPropertySet.xml
+++ b/modules/visual_script/doc_classes/VisualScriptPropertySet.xml
@@ -13,15 +13,15 @@
</member>
<member name="base_script" type="String" setter="set_base_script" getter="get_base_script">
</member>
- <member name="base_type" type="String" setter="set_base_type" getter="get_base_type" default="&quot;Object&quot;">
+ <member name="base_type" type="StringName" setter="set_base_type" getter="get_base_type" default="@&quot;Object&quot;">
</member>
<member name="basic_type" type="int" setter="set_basic_type" getter="get_basic_type" enum="Variant.Type">
</member>
- <member name="index" type="String" setter="set_index" getter="get_index">
+ <member name="index" type="StringName" setter="set_index" getter="get_index">
</member>
<member name="node_path" type="NodePath" setter="set_base_path" getter="get_base_path">
</member>
- <member name="property" type="String" setter="set_property" getter="get_property" default="&quot;&quot;">
+ <member name="property" type="StringName" setter="set_property" getter="get_property" default="@&quot;&quot;">
</member>
<member name="set_mode" type="int" setter="set_call_mode" getter="get_call_mode" enum="VisualScriptPropertySet.CallMode" default="0">
</member>
diff --git a/modules/visual_script/doc_classes/VisualScriptTypeCast.xml b/modules/visual_script/doc_classes/VisualScriptTypeCast.xml
index 43fe9d16ea..80a8d31041 100644
--- a/modules/visual_script/doc_classes/VisualScriptTypeCast.xml
+++ b/modules/visual_script/doc_classes/VisualScriptTypeCast.xml
@@ -11,7 +11,7 @@
<members>
<member name="base_script" type="String" setter="set_base_script" getter="get_base_script" default="&quot;&quot;">
</member>
- <member name="base_type" type="String" setter="set_base_type" getter="get_base_type" default="&quot;Object&quot;">
+ <member name="base_type" type="StringName" setter="set_base_type" getter="get_base_type" default="@&quot;Object&quot;">
</member>
</members>
<constants>
diff --git a/modules/visual_script/doc_classes/VisualScriptVariableGet.xml b/modules/visual_script/doc_classes/VisualScriptVariableGet.xml
index 0746ab293e..d182e14e4d 100644
--- a/modules/visual_script/doc_classes/VisualScriptVariableGet.xml
+++ b/modules/visual_script/doc_classes/VisualScriptVariableGet.xml
@@ -15,7 +15,7 @@
<methods>
</methods>
<members>
- <member name="var_name" type="String" setter="set_variable" getter="get_variable" default="&quot;&quot;">
+ <member name="var_name" type="StringName" setter="set_variable" getter="get_variable" default="@&quot;&quot;">
The variable's name.
</member>
</members>
diff --git a/modules/visual_script/doc_classes/VisualScriptVariableSet.xml b/modules/visual_script/doc_classes/VisualScriptVariableSet.xml
index e7d83e60ab..3bd392dd85 100644
--- a/modules/visual_script/doc_classes/VisualScriptVariableSet.xml
+++ b/modules/visual_script/doc_classes/VisualScriptVariableSet.xml
@@ -16,7 +16,7 @@
<methods>
</methods>
<members>
- <member name="var_name" type="String" setter="set_variable" getter="get_variable" default="&quot;&quot;">
+ <member name="var_name" type="StringName" setter="set_variable" getter="get_variable" default="@&quot;&quot;">
The variable's name.
</member>
</members>
diff --git a/modules/visual_script/doc_classes/VisualScriptYieldSignal.xml b/modules/visual_script/doc_classes/VisualScriptYieldSignal.xml
index 8f6941ce1e..483cdfeaf8 100644
--- a/modules/visual_script/doc_classes/VisualScriptYieldSignal.xml
+++ b/modules/visual_script/doc_classes/VisualScriptYieldSignal.xml
@@ -9,13 +9,13 @@
<methods>
</methods>
<members>
- <member name="base_type" type="String" setter="set_base_type" getter="get_base_type" default="&quot;Object&quot;">
+ <member name="base_type" type="StringName" setter="set_base_type" getter="get_base_type" default="@&quot;Object&quot;">
</member>
<member name="call_mode" type="int" setter="set_call_mode" getter="get_call_mode" enum="VisualScriptYieldSignal.CallMode" default="0">
</member>
<member name="node_path" type="NodePath" setter="set_base_path" getter="get_base_path">
</member>
- <member name="signal" type="String" setter="set_signal" getter="get_signal" default="&quot;&quot;">
+ <member name="signal" type="StringName" setter="set_signal" getter="get_signal" default="@&quot;&quot;">
</member>
</members>
<constants>
diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp
index e712190344..70f650cfd3 100644
--- a/modules/visual_script/visual_script.cpp
+++ b/modules/visual_script/visual_script.cpp
@@ -88,11 +88,11 @@ void VisualScriptNode::validate_input_default_values() {
continue;
} else {
//not the same, reconvert
- Variant::CallError ce;
+ Callable::CallError ce;
Variant existing = default_input_values[i];
const Variant *existingp = &existing;
default_input_values[i] = Variant::construct(expected, &existingp, 1, ce, false);
- if (ce.error != Variant::CallError::CALL_OK) {
+ if (ce.error != Callable::CallError::CALL_OK) {
//could not convert? force..
default_input_values[i] = Variant::construct(expected, NULL, 0, ce, false);
}
@@ -198,7 +198,7 @@ void VisualScript::remove_function(const StringName &p_name) {
for (Map<int, Function::NodeData>::Element *E = functions[p_name].nodes.front(); E; E = E->next()) {
- E->get().node->disconnect("ports_changed", this, "_node_ports_changed");
+ E->get().node->disconnect_compat("ports_changed", this, "_node_ports_changed");
E->get().node->scripts_used.erase(this);
}
@@ -340,7 +340,7 @@ void VisualScript::add_node(const StringName &p_func, int p_id, const Ref<Visual
nd.pos = p_pos;
Ref<VisualScriptNode> vsn = p_node;
- vsn->connect("ports_changed", this, "_node_ports_changed", varray(p_id));
+ vsn->connect_compat("ports_changed", this, "_node_ports_changed", varray(p_id));
vsn->scripts_used.insert(this);
vsn->validate_input_default_values(); // Validate when fully loaded
@@ -389,7 +389,7 @@ void VisualScript::remove_node(const StringName &p_func, int p_id) {
func.function_id = -1; //revert to invalid
}
- func.nodes[p_id].node->disconnect("ports_changed", this, "_node_ports_changed");
+ func.nodes[p_id].node->disconnect_compat("ports_changed", this, "_node_ports_changed");
func.nodes[p_id].node->scripts_used.erase(this);
func.nodes.erase(p_id);
@@ -1560,7 +1560,7 @@ bool VisualScriptInstance::has_method(const StringName &p_method) const {
//#define VSDEBUG(m_text) print_line(m_text)
#define VSDEBUG(m_text)
-void VisualScriptInstance::_dependency_step(VisualScriptNodeInstance *node, int p_pass, int *pass_stack, const Variant **input_args, Variant **output_args, Variant *variant_stack, Variant::CallError &r_error, String &error_str, VisualScriptNodeInstance **r_error_node) {
+void VisualScriptInstance::_dependency_step(VisualScriptNodeInstance *node, int p_pass, int *pass_stack, const Variant **input_args, Variant **output_args, Variant *variant_stack, Callable::CallError &r_error, String &error_str, VisualScriptNodeInstance **r_error_node) {
ERR_FAIL_COND(node->pass_idx == -1);
@@ -1577,7 +1577,7 @@ void VisualScriptInstance::_dependency_step(VisualScriptNodeInstance *node, int
for (int i = 0; i < dc; i++) {
_dependency_step(deps[i], p_pass, pass_stack, input_args, output_args, variant_stack, r_error, error_str, r_error_node);
- if (r_error.error != Variant::CallError::CALL_OK)
+ if (r_error.error != Callable::CallError::CALL_OK)
return;
}
}
@@ -1602,12 +1602,12 @@ void VisualScriptInstance::_dependency_step(VisualScriptNodeInstance *node, int
node->step(input_args, output_args, VisualScriptNodeInstance::START_MODE_BEGIN_SEQUENCE, working_mem, r_error, error_str);
//ignore return
- if (r_error.error != Variant::CallError::CALL_OK) {
+ if (r_error.error != Callable::CallError::CALL_OK) {
*r_error_node = node;
}
}
-Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p_stack, int p_stack_size, VisualScriptNodeInstance *p_node, int p_flow_stack_pos, int p_pass, bool p_resuming_yield, Variant::CallError &r_error) {
+Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p_stack, int p_stack_size, VisualScriptNodeInstance *p_node, int p_flow_stack_pos, int p_pass, bool p_resuming_yield, Callable::CallError &r_error) {
Map<StringName, Function>::Element *F = functions.find(p_method);
ERR_FAIL_COND_V(!F, Variant());
@@ -1669,7 +1669,7 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p
for (int i = 0; i < dc; i++) {
_dependency_step(deps[i], p_pass, pass_stack, input_args, output_args, variant_stack, r_error, error_str, &node);
- if (r_error.error != Variant::CallError::CALL_OK) {
+ if (r_error.error != Callable::CallError::CALL_OK) {
error = true;
current_node_id = node->id;
break;
@@ -1729,7 +1729,7 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p
int ret = node->step(input_args, output_args, start_mode, working_mem, r_error, error_str);
- if (r_error.error != Variant::CallError::CALL_OK) {
+ if (r_error.error != Callable::CallError::CALL_OK) {
//use error from step
error = true;
break;
@@ -1738,7 +1738,7 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p
if (ret & VisualScriptNodeInstance::STEP_YIELD_BIT) {
//yielded!
if (node->get_working_memory_size() == 0) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
error_str = RTR("A node yielded without working memory, please read the docs on how to yield properly!");
error = true;
break;
@@ -1747,7 +1747,7 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p
Ref<VisualScriptFunctionState> state = *working_mem;
if (!state.is_valid()) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
error_str = RTR("Node yielded, but did not return a function state in the first working memory.");
error = true;
break;
@@ -1766,7 +1766,7 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p
state->pass = p_pass;
copymem(state->stack.ptrw(), p_stack, p_stack_size);
//step 2, run away, return directly
- r_error.error = Variant::CallError::CALL_OK;
+ r_error.error = Callable::CallError::CALL_OK;
#ifdef DEBUG_ENABLED
//will re-enter later, so exiting
@@ -1809,7 +1809,7 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p
if (ret & VisualScriptNodeInstance::STEP_EXIT_FUNCTION_BIT) {
if (node->get_working_memory_size() == 0) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
error_str = RTR("Return value must be assigned to first element of node working memory! Fix your node please.");
error = true;
} else {
@@ -1826,7 +1826,7 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p
if ((ret == output || ret & VisualScriptNodeInstance::STEP_FLAG_PUSH_STACK_BIT) && node->sequence_output_count) {
//if no exit bit was set, and has sequence outputs, guess next node
if (output >= node->sequence_output_count) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
error_str = RTR("Node returned an invalid sequence output: ") + itos(output);
error = true;
break;
@@ -1888,7 +1888,7 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p
}
if (!found) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
error_str = RTR("Found sequence bit but not the node in the stack, report bug!");
error = true;
break;
@@ -1900,7 +1900,7 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p
} else {
// check for stack overflow
if (flow_stack_pos + 1 >= flow_max) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
error_str = RTR("Stack overflow with stack depth: ") + itos(output);
error = true;
break;
@@ -1952,22 +1952,22 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p
String err_func = p_method;
int err_line = current_node_id; //not a line but it works as one
- if (node && (r_error.error != Variant::CallError::CALL_ERROR_INVALID_METHOD || error_str == String())) {
+ if (node && (r_error.error != Callable::CallError::CALL_ERROR_INVALID_METHOD || error_str == String())) {
if (error_str != String()) {
error_str += " ";
}
- if (r_error.error == Variant::CallError::CALL_ERROR_INVALID_ARGUMENT) {
+ if (r_error.error == Callable::CallError::CALL_ERROR_INVALID_ARGUMENT) {
int errorarg = r_error.argument;
- error_str += "Cannot convert argument " + itos(errorarg + 1) + " to " + Variant::get_type_name(r_error.expected) + ".";
- } else if (r_error.error == Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS) {
+ error_str += "Cannot convert argument " + itos(errorarg + 1) + " to " + Variant::get_type_name(Variant::Type(r_error.expected)) + ".";
+ } else if (r_error.error == Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS) {
error_str += "Expected " + itos(r_error.argument) + " arguments.";
- } else if (r_error.error == Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS) {
+ } else if (r_error.error == Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS) {
error_str += "Expected " + itos(r_error.argument) + " arguments.";
- } else if (r_error.error == Variant::CallError::CALL_ERROR_INVALID_METHOD) {
+ } else if (r_error.error == Callable::CallError::CALL_ERROR_INVALID_METHOD) {
error_str += "Invalid Call.";
- } else if (r_error.error == Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL) {
+ } else if (r_error.error == Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL) {
error_str += "Base Instance is null";
}
}
@@ -2000,13 +2000,13 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p
return return_value;
}
-Variant VisualScriptInstance::call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error) {
+Variant VisualScriptInstance::call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) {
- r_error.error = Variant::CallError::CALL_OK; //ok by default
+ r_error.error = Callable::CallError::CALL_OK; //ok by default
Map<StringName, Function>::Element *F = functions.find(p_method);
if (!F) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
return Variant();
}
@@ -2048,7 +2048,7 @@ Variant VisualScriptInstance::call(const StringName &p_method, const Variant **p
Map<int, VisualScriptNodeInstance *>::Element *E = instances.find(f->node);
if (!E) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
ERR_FAIL_V_MSG(Variant(), "No VisualScriptFunction node in function.");
}
@@ -2062,14 +2062,14 @@ Variant VisualScriptInstance::call(const StringName &p_method, const Variant **p
VSDEBUG("ARGUMENTS: " + itos(f->argument_count) = " RECEIVED: " + itos(p_argcount));
if (p_argcount < f->argument_count) {
- r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS;
+ r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS;
r_error.argument = node->get_input_port_count();
return Variant();
}
if (p_argcount > f->argument_count) {
- r_error.error = Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS;
+ r_error.error = Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS;
r_error.argument = node->get_input_port_count();
return Variant();
@@ -2094,15 +2094,15 @@ void VisualScriptInstance::notification(int p_notification) {
Variant what = p_notification;
const Variant *whatp = &what;
- Variant::CallError ce;
+ Callable::CallError ce;
call(VisualScriptLanguage::singleton->notification, &whatp, 1, ce); //do as call
}
String VisualScriptInstance::to_string(bool *r_valid) {
if (has_method(CoreStringNames::get_singleton()->_to_string)) {
- Variant::CallError ce;
+ Callable::CallError ce;
Variant ret = call(CoreStringNames::get_singleton()->_to_string, NULL, 0, ce);
- if (ce.error == Variant::CallError::CALL_OK) {
+ if (ce.error == Callable::CallError::CALL_OK) {
if (ret.get_type() != Variant::STRING) {
if (r_valid)
*r_valid = false;
@@ -2408,7 +2408,7 @@ VisualScriptInstance::~VisualScriptInstance() {
/////////////////////
-Variant VisualScriptFunctionState::_signal_callback(const Variant **p_args, int p_argcount, Variant::CallError &r_error) {
+Variant VisualScriptFunctionState::_signal_callback(const Variant **p_args, int p_argcount, Callable::CallError &r_error) {
ERR_FAIL_COND_V(function == StringName(), Variant());
@@ -2419,12 +2419,12 @@ Variant VisualScriptFunctionState::_signal_callback(const Variant **p_args, int
#endif
- r_error.error = Variant::CallError::CALL_OK;
+ r_error.error = Callable::CallError::CALL_OK;
Array args;
if (p_argcount == 0) {
- r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS;
+ r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS;
r_error.argument = 1;
return Variant();
} else if (p_argcount == 1) {
@@ -2439,13 +2439,13 @@ Variant VisualScriptFunctionState::_signal_callback(const Variant **p_args, int
Ref<VisualScriptFunctionState> self = *p_args[p_argcount - 1]; //hi, I'm myself, needed this to remain alive.
if (self.is_null()) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = p_argcount - 1;
r_error.expected = Variant::OBJECT;
return Variant();
}
- r_error.error = Variant::CallError::CALL_OK;
+ r_error.error = Callable::CallError::CALL_OK;
Variant *working_mem = ((Variant *)stack.ptr()) + working_mem_index;
@@ -2463,7 +2463,7 @@ void VisualScriptFunctionState::connect_to_signal(Object *p_obj, const String &p
binds.push_back(p_binds[i]);
}
binds.push_back(Ref<VisualScriptFunctionState>(this)); //add myself on the back to avoid dying from unreferencing
- p_obj->connect(p_signal, this, "_signal_callback", binds, CONNECT_ONESHOT);
+ p_obj->connect_compat(p_signal, this, "_signal_callback", binds, CONNECT_ONESHOT);
}
bool VisualScriptFunctionState::is_valid() const {
@@ -2481,8 +2481,8 @@ Variant VisualScriptFunctionState::resume(Array p_args) {
#endif
- Variant::CallError r_error;
- r_error.error = Variant::CallError::CALL_OK;
+ Callable::CallError r_error;
+ r_error.error = Callable::CallError::CALL_OK;
Variant *working_mem = ((Variant *)stack.ptr()) + working_mem_index;
@@ -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..08b84bce1d 100644
--- a/modules/visual_script/visual_script.h
+++ b/modules/visual_script/visual_script.h
@@ -155,7 +155,7 @@ public:
virtual int get_working_memory_size() const { return 0; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) = 0; //do a step, return which sequence port to go out
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) = 0; //do a step, return which sequence port to go out
Ref<VisualScriptNode> get_base_node() { return Ref<VisualScriptNode>(base); }
@@ -408,8 +408,8 @@ class VisualScriptInstance : public ScriptInstance {
StringName source;
- void _dependency_step(VisualScriptNodeInstance *node, int p_pass, int *pass_stack, const Variant **input_args, Variant **output_args, Variant *variant_stack, Variant::CallError &r_error, String &error_str, VisualScriptNodeInstance **r_error_node);
- Variant _call_internal(const StringName &p_method, void *p_stack, int p_stack_size, VisualScriptNodeInstance *p_node, int p_flow_stack_pos, int p_pass, bool p_resuming_yield, Variant::CallError &r_error);
+ void _dependency_step(VisualScriptNodeInstance *node, int p_pass, int *pass_stack, const Variant **input_args, Variant **output_args, Variant *variant_stack, Callable::CallError &r_error, String &error_str, VisualScriptNodeInstance **r_error_node);
+ Variant _call_internal(const StringName &p_method, void *p_stack, int p_stack_size, VisualScriptNodeInstance *p_node, int p_flow_stack_pos, int p_pass, bool p_resuming_yield, Callable::CallError &r_error);
//Map<StringName,Function> functions;
friend class VisualScriptFunctionState; //for yield
@@ -422,7 +422,7 @@ public:
virtual void get_method_list(List<MethodInfo> *p_list) const;
virtual bool has_method(const StringName &p_method) const;
- virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error);
+ virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error);
virtual void notification(int p_notification);
String to_string(bool *r_valid);
@@ -487,7 +487,7 @@ class VisualScriptFunctionState : public Reference {
int flow_stack_pos;
int pass;
- Variant _signal_callback(const Variant **p_args, int p_argcount, Variant::CallError &r_error);
+ Variant _signal_callback(const Variant **p_args, int p_argcount, Callable::CallError &r_error);
protected:
static void _bind_methods();
@@ -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..07f152efd4 100644
--- a/modules/visual_script/visual_script_builtin_funcs.cpp
+++ b/modules/visual_script/visual_script_builtin_funcs.cpp
@@ -277,22 +277,22 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const
case MATH_EXP:
case MATH_ISNAN:
case MATH_ISINF: {
- return PropertyInfo(Variant::REAL, "s");
+ return PropertyInfo(Variant::FLOAT, "s");
} break;
case MATH_ATAN2: {
if (p_idx == 0)
- return PropertyInfo(Variant::REAL, "y");
+ return PropertyInfo(Variant::FLOAT, "y");
else
- return PropertyInfo(Variant::REAL, "x");
+ return PropertyInfo(Variant::FLOAT, "x");
} break;
case MATH_FMOD:
case MATH_FPOSMOD:
case LOGIC_MAX:
case LOGIC_MIN: {
if (p_idx == 0)
- return PropertyInfo(Variant::REAL, "a");
+ return PropertyInfo(Variant::FLOAT, "a");
else
- return PropertyInfo(Variant::REAL, "b");
+ return PropertyInfo(Variant::FLOAT, "b");
} break;
case MATH_POSMOD: {
if (p_idx == 0)
@@ -302,63 +302,63 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const
} break;
case MATH_POW: {
if (p_idx == 0)
- return PropertyInfo(Variant::REAL, "base");
+ return PropertyInfo(Variant::FLOAT, "base");
else
- return PropertyInfo(Variant::REAL, "exp");
+ return PropertyInfo(Variant::FLOAT, "exp");
} break;
case MATH_EASE: {
if (p_idx == 0)
- return PropertyInfo(Variant::REAL, "s");
+ return PropertyInfo(Variant::FLOAT, "s");
else
- return PropertyInfo(Variant::REAL, "curve");
+ return PropertyInfo(Variant::FLOAT, "curve");
} break;
case MATH_STEP_DECIMALS: {
- return PropertyInfo(Variant::REAL, "step");
+ return PropertyInfo(Variant::FLOAT, "step");
} break;
case MATH_STEPIFY: {
if (p_idx == 0)
- return PropertyInfo(Variant::REAL, "s");
+ return PropertyInfo(Variant::FLOAT, "s");
else
- return PropertyInfo(Variant::REAL, "steps");
+ return PropertyInfo(Variant::FLOAT, "steps");
} break;
case MATH_LERP:
case MATH_LERP_ANGLE:
case MATH_INVERSE_LERP:
case MATH_SMOOTHSTEP: {
if (p_idx == 0)
- return PropertyInfo(Variant::REAL, "from");
+ return PropertyInfo(Variant::FLOAT, "from");
else if (p_idx == 1)
- return PropertyInfo(Variant::REAL, "to");
+ return PropertyInfo(Variant::FLOAT, "to");
else
- return PropertyInfo(Variant::REAL, "weight");
+ return PropertyInfo(Variant::FLOAT, "weight");
} break;
case MATH_RANGE_LERP: {
if (p_idx == 0)
- return PropertyInfo(Variant::REAL, "value");
+ return PropertyInfo(Variant::FLOAT, "value");
else if (p_idx == 1)
- return PropertyInfo(Variant::REAL, "istart");
+ return PropertyInfo(Variant::FLOAT, "istart");
else if (p_idx == 2)
- return PropertyInfo(Variant::REAL, "istop");
+ return PropertyInfo(Variant::FLOAT, "istop");
else if (p_idx == 3)
- return PropertyInfo(Variant::REAL, "ostart");
+ return PropertyInfo(Variant::FLOAT, "ostart");
else
- return PropertyInfo(Variant::REAL, "ostop");
+ return PropertyInfo(Variant::FLOAT, "ostop");
} break;
case MATH_MOVE_TOWARD: {
if (p_idx == 0)
- return PropertyInfo(Variant::REAL, "from");
+ return PropertyInfo(Variant::FLOAT, "from");
else if (p_idx == 1)
- return PropertyInfo(Variant::REAL, "to");
+ return PropertyInfo(Variant::FLOAT, "to");
else
- return PropertyInfo(Variant::REAL, "delta");
+ return PropertyInfo(Variant::FLOAT, "delta");
} break;
case MATH_DECTIME: {
if (p_idx == 0)
- return PropertyInfo(Variant::REAL, "value");
+ return PropertyInfo(Variant::FLOAT, "value");
else if (p_idx == 1)
- return PropertyInfo(Variant::REAL, "amount");
+ return PropertyInfo(Variant::FLOAT, "amount");
else
- return PropertyInfo(Variant::REAL, "step");
+ return PropertyInfo(Variant::FLOAT, "step");
} break;
case MATH_RANDOMIZE:
case MATH_RAND:
@@ -367,37 +367,37 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const
} break;
case MATH_RANDOM: {
if (p_idx == 0)
- return PropertyInfo(Variant::REAL, "from");
+ return PropertyInfo(Variant::FLOAT, "from");
else
- return PropertyInfo(Variant::REAL, "to");
+ return PropertyInfo(Variant::FLOAT, "to");
} break;
case MATH_SEED:
case MATH_RANDSEED: {
return PropertyInfo(Variant::INT, "seed");
} break;
case MATH_DEG2RAD: {
- return PropertyInfo(Variant::REAL, "deg");
+ return PropertyInfo(Variant::FLOAT, "deg");
} break;
case MATH_RAD2DEG: {
- return PropertyInfo(Variant::REAL, "rad");
+ return PropertyInfo(Variant::FLOAT, "rad");
} break;
case MATH_LINEAR2DB: {
- return PropertyInfo(Variant::REAL, "nrg");
+ return PropertyInfo(Variant::FLOAT, "nrg");
} break;
case MATH_DB2LINEAR: {
- return PropertyInfo(Variant::REAL, "db");
+ return PropertyInfo(Variant::FLOAT, "db");
} break;
case MATH_POLAR2CARTESIAN: {
if (p_idx == 0)
- return PropertyInfo(Variant::REAL, "r");
+ return PropertyInfo(Variant::FLOAT, "r");
else
- return PropertyInfo(Variant::REAL, "th");
+ return PropertyInfo(Variant::FLOAT, "th");
} break;
case MATH_CARTESIAN2POLAR: {
if (p_idx == 0)
- return PropertyInfo(Variant::REAL, "x");
+ return PropertyInfo(Variant::FLOAT, "x");
else
- return PropertyInfo(Variant::REAL, "y");
+ return PropertyInfo(Variant::FLOAT, "y");
} break;
case MATH_WRAP: {
if (p_idx == 0)
@@ -410,11 +410,11 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const
case MATH_WRAPF:
case LOGIC_CLAMP: {
if (p_idx == 0)
- return PropertyInfo(Variant::REAL, "value");
+ return PropertyInfo(Variant::FLOAT, "value");
else if (p_idx == 1)
- return PropertyInfo(Variant::REAL, "min");
+ return PropertyInfo(Variant::FLOAT, "min");
else
- return PropertyInfo(Variant::REAL, "max");
+ return PropertyInfo(Variant::FLOAT, "max");
} break;
case LOGIC_NEAREST_PO2: {
return PropertyInfo(Variant::INT, "value");
@@ -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;
@@ -475,7 +475,7 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const
if (p_idx == 0)
return PropertyInfo(Variant::STRING, "name");
else
- return PropertyInfo(Variant::REAL, "alpha");
+ return PropertyInfo(Variant::FLOAT, "alpha");
} break;
case FUNC_MAX: {
}
@@ -504,7 +504,7 @@ PropertyInfo VisualScriptBuiltinFunc::get_output_value_port_info(int p_idx) cons
case MATH_FPOSMOD:
case MATH_FLOOR:
case MATH_CEIL: {
- t = Variant::REAL;
+ t = Variant::FLOAT;
} break;
case MATH_POSMOD:
case MATH_ROUND: {
@@ -519,14 +519,14 @@ PropertyInfo VisualScriptBuiltinFunc::get_output_value_port_info(int p_idx) cons
case MATH_POW:
case MATH_LOG:
case MATH_EXP: {
- t = Variant::REAL;
+ t = Variant::FLOAT;
} break;
case MATH_ISNAN:
case MATH_ISINF: {
t = Variant::BOOL;
} break;
case MATH_EASE: {
- t = Variant::REAL;
+ t = Variant::FLOAT;
} break;
case MATH_STEP_DECIMALS: {
t = Variant::INT;
@@ -539,7 +539,7 @@ PropertyInfo VisualScriptBuiltinFunc::get_output_value_port_info(int p_idx) cons
case MATH_SMOOTHSTEP:
case MATH_MOVE_TOWARD:
case MATH_DECTIME: {
- t = Variant::REAL;
+ t = Variant::FLOAT;
} break;
case MATH_RANDOMIZE: {
@@ -551,7 +551,7 @@ PropertyInfo VisualScriptBuiltinFunc::get_output_value_port_info(int p_idx) cons
} break;
case MATH_RANDF:
case MATH_RANDOM: {
- t = Variant::REAL;
+ t = Variant::FLOAT;
} break;
case MATH_SEED: {
@@ -568,7 +568,7 @@ PropertyInfo VisualScriptBuiltinFunc::get_output_value_port_info(int p_idx) cons
case MATH_LINEAR2DB:
case MATH_WRAPF:
case MATH_DB2LINEAR: {
- t = Variant::REAL;
+ t = Variant::FLOAT;
} break;
case MATH_POLAR2CARTESIAN:
case MATH_CARTESIAN2POLAR: {
@@ -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;
@@ -675,15 +675,15 @@ VisualScriptBuiltinFunc::BuiltinFunc VisualScriptBuiltinFunc::get_func() {
return func;
}
-#define VALIDATE_ARG_NUM(m_arg) \
- if (!p_inputs[m_arg]->is_num()) { \
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; \
- r_error.argument = m_arg; \
- r_error.expected = Variant::REAL; \
- return; \
+#define VALIDATE_ARG_NUM(m_arg) \
+ if (!p_inputs[m_arg]->is_num()) { \
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; \
+ r_error.argument = m_arg; \
+ r_error.expected = Variant::FLOAT; \
+ return; \
}
-void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant *r_return, Variant::CallError &r_error, String &r_error_str) {
+void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant *r_return, Callable::CallError &r_error, String &r_error_str) {
switch (p_func) {
case VisualScriptBuiltinFunc::MATH_SIN: {
@@ -781,15 +781,15 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in
int64_t i = *p_inputs[0];
*r_return = ABS(i);
- } else if (p_inputs[0]->get_type() == Variant::REAL) {
+ } else if (p_inputs[0]->get_type() == Variant::FLOAT) {
real_t r = *p_inputs[0];
*r_return = Math::abs(r);
} else {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
- r_error.expected = Variant::REAL;
+ r_error.expected = Variant::FLOAT;
}
} break;
case VisualScriptBuiltinFunc::MATH_SIGN: {
@@ -798,15 +798,15 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in
int64_t i = *p_inputs[0];
*r_return = i < 0 ? -1 : (i > 0 ? +1 : 0);
- } else if (p_inputs[0]->get_type() == Variant::REAL) {
+ } else if (p_inputs[0]->get_type() == Variant::FLOAT) {
real_t r = *p_inputs[0];
*r_return = r < 0.0 ? -1.0 : (r > 0.0 ? +1.0 : 0.0);
} else {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
- r_error.expected = Variant::REAL;
+ r_error.expected = Variant::FLOAT;
}
} break;
case VisualScriptBuiltinFunc::MATH_POW: {
@@ -1047,7 +1047,7 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in
if (p_inputs[0]->get_type() != Variant::OBJECT) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
r_error.expected = Variant::OBJECT;
@@ -1081,7 +1081,7 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in
if (p_inputs[0]->get_type() != Variant::OBJECT) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
r_error.expected = Variant::OBJECT;
@@ -1089,7 +1089,7 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in
}
if (p_inputs[1]->get_type() != Variant::STRING && p_inputs[1]->get_type() != Variant::NODE_PATH) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 1;
r_error.expected = Variant::STRING;
@@ -1111,7 +1111,7 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in
if (type < 0 || type >= Variant::VARIANT_MAX) {
r_error_str = RTR("Invalid type argument to convert(), use TYPE_* constants.");
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
r_error.expected = Variant::INT;
return;
@@ -1141,7 +1141,7 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in
case VisualScriptBuiltinFunc::TEXT_ORD: {
if (p_inputs[0]->get_type() != Variant::STRING) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
r_error.expected = Variant::STRING;
@@ -1151,7 +1151,7 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in
String str = p_inputs[0]->operator String();
if (str.length() != 1) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
r_error.expected = Variant::STRING;
*r_return = "Expected a string of length 1 (a character).";
@@ -1197,7 +1197,7 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in
case VisualScriptBuiltinFunc::STR_TO_VAR: {
if (p_inputs[0]->get_type() != Variant::STRING) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
r_error.expected = Variant::STRING;
@@ -1212,7 +1212,7 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in
Error err = VariantParser::parse(&ss, *r_return, errs, line);
if (err != OK) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
r_error.expected = Variant::STRING;
*r_return = "Parse error at line " + itos(line) + ": " + errs;
@@ -1223,17 +1223,17 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in
case VisualScriptBuiltinFunc::VAR_TO_BYTES: {
if (p_inputs[1]->get_type() != Variant::BOOL) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 1;
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);
if (err) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
r_error.expected = Variant::NIL;
r_error_str = "Unexpected error encoding variable to bytes, likely unserializable type found (Object or RID).";
@@ -1242,37 +1242,37 @@ 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) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ if (p_inputs[0]->get_type() != Variant::PACKED_BYTE_ARRAY) {
+ r_error.error = Callable::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) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 1;
r_error.expected = Variant::BOOL;
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.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
- r_error.expected = Variant::POOL_BYTE_ARRAY;
+ r_error.expected = Variant::PACKED_BYTE_ARRAY;
return;
}
}
@@ -1306,7 +1306,7 @@ public:
//virtual bool is_output_port_unsequenced(int p_idx) const { return false; }
//virtual bool get_output_port_unsequenced(int p_idx,Variant* r_value,Variant* p_working_mem,String &r_error) const { return true; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
VisualScriptBuiltinFunc::exec_func(func, p_inputs, p_outputs[0], r_error, r_error_str);
return 0;
diff --git a/modules/visual_script/visual_script_builtin_funcs.h b/modules/visual_script/visual_script_builtin_funcs.h
index d0787b3dd3..d950f858d4 100644
--- a/modules/visual_script/visual_script_builtin_funcs.h
+++ b/modules/visual_script/visual_script_builtin_funcs.h
@@ -112,7 +112,7 @@ public:
static int get_func_argument_count(BuiltinFunc p_func);
static String get_func_name(BuiltinFunc p_func);
- static void exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant *r_return, Variant::CallError &r_error, String &r_error_str);
+ static void exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant *r_return, Callable::CallError &r_error, String &r_error_str);
static BuiltinFunc find_function(const String &p_string);
private:
diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp
index 9a1125c375..0bbef066a4 100644
--- a/modules/visual_script/visual_script_editor.cpp
+++ b/modules/visual_script/visual_script_editor.cpp
@@ -346,7 +346,7 @@ static Color _color_from_type(Variant::Type p_type, bool dark_theme = true) {
case Variant::BOOL: color = Color(0.55, 0.65, 0.94); break;
case Variant::INT: color = Color(0.49, 0.78, 0.94); break;
- case Variant::REAL: color = Color(0.38, 0.85, 0.96); break;
+ case Variant::FLOAT: color = Color(0.38, 0.85, 0.96); break;
case Variant::STRING: color = Color(0.42, 0.65, 0.93); break;
case Variant::VECTOR2: color = Color(0.74, 0.57, 0.95); break;
@@ -366,13 +366,15 @@ 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_INT32_ARRAY: color = Color(0.69, 0.86, 0.96); break;
+ case Variant::PACKED_FLOAT32_ARRAY: color = Color(0.59, 0.91, 0.97); break;
+ case Variant::PACKED_INT64_ARRAY: color = Color(0.69, 0.86, 0.96); break;
+ case Variant::PACKED_FLOAT64_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);
@@ -383,7 +385,7 @@ static Color _color_from_type(Variant::Type p_type, bool dark_theme = true) {
case Variant::BOOL: color = Color(0.43, 0.56, 0.92); break;
case Variant::INT: color = Color(0.31, 0.7, 0.91); break;
- case Variant::REAL: color = Color(0.15, 0.8, 0.94); break;
+ case Variant::FLOAT: color = Color(0.15, 0.8, 0.94); break;
case Variant::STRING: color = Color(0.27, 0.56, 0.91); break;
case Variant::VECTOR2: color = Color(0.68, 0.46, 0.93); break;
@@ -403,13 +405,15 @@ 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_INT32_ARRAY: color = Color(0.38, 0.73, 0.92); break;
+ case Variant::PACKED_FLOAT32_ARRAY: color = Color(0.25, 0.83, 0.95); break;
+ case Variant::PACKED_INT64_ARRAY: color = Color(0.38, 0.73, 0.92); break;
+ case Variant::PACKED_FLOAT64_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 +524,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("PackedInt32Array", "EditorIcons"),
+ Control::get_icon("PackedFloat32Array", "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");
@@ -556,8 +560,8 @@ void VisualScriptEditor::_update_graph(int p_only_id) {
gnode->set_meta("__vnode", node);
gnode->set_name(itos(E->get()));
- gnode->connect("dragged", this, "_node_moved", varray(E->get()));
- gnode->connect("close_request", this, "_remove_node", varray(E->get()), CONNECT_DEFERRED);
+ gnode->connect_compat("dragged", this, "_node_moved", varray(E->get()));
+ gnode->connect_compat("close_request", this, "_remove_node", varray(E->get()), CONNECT_DEFERRED);
if (E->get() != script->get_function_node_id(F->get())) {
//function can't be erased
@@ -575,7 +579,7 @@ void VisualScriptEditor::_update_graph(int p_only_id) {
Button *btn = memnew(Button);
btn->set_text(TTR("Add Input Port"));
hbnc->add_child(btn);
- btn->connect("pressed", this, "_add_input_port", varray(E->get()), CONNECT_DEFERRED);
+ btn->connect_compat("pressed", this, "_add_input_port", varray(E->get()), CONNECT_DEFERRED);
}
if (nd_list->is_output_port_editable()) {
if (nd_list->is_input_port_editable())
@@ -584,7 +588,7 @@ void VisualScriptEditor::_update_graph(int p_only_id) {
Button *btn = memnew(Button);
btn->set_text(TTR("Add Output Port"));
hbnc->add_child(btn);
- btn->connect("pressed", this, "_add_output_port", varray(E->get()), CONNECT_DEFERRED);
+ btn->connect_compat("pressed", this, "_add_output_port", varray(E->get()), CONNECT_DEFERRED);
}
gnode->add_child(hbnc);
} else if (Object::cast_to<VisualScriptExpression>(node.ptr())) {
@@ -594,7 +598,7 @@ void VisualScriptEditor::_update_graph(int p_only_id) {
line_edit->set_expand_to_text_length(true);
line_edit->add_font_override("font", get_font("source", "EditorFonts"));
gnode->add_child(line_edit);
- line_edit->connect("text_changed", this, "_expression_text_changed", varray(E->get()));
+ line_edit->connect_compat("text_changed", this, "_expression_text_changed", varray(E->get()));
} else {
String text = node->get_text();
if (!text.empty()) {
@@ -610,7 +614,7 @@ void VisualScriptEditor::_update_graph(int p_only_id) {
gnode->set_comment(true);
gnode->set_resizable(true);
gnode->set_custom_minimum_size(vsc->get_size() * EDSCALE);
- gnode->connect("resize_request", this, "_comment_node_resized", varray(E->get()));
+ gnode->connect_compat("resize_request", this, "_comment_node_resized", varray(E->get()));
}
if (node_styles.has(node->get_category())) {
@@ -619,16 +623,24 @@ void VisualScriptEditor::_update_graph(int p_only_id) {
sbf = EditorNode::get_singleton()->get_theme_base()->get_theme()->get_stylebox("comment", "GraphNode");
Color c = sbf->get_border_color();
+ Color ic = c;
c.a = 1;
if (EditorSettings::get_singleton()->get("interface/theme/use_graph_node_headers")) {
- Color mono_color = ((c.r + c.g + c.b) / 3) < 0.7 ? Color(1.0, 1.0, 1.0) : Color(0.0, 0.0, 0.0);
+ Color mono_color;
+ if (((c.r + c.g + c.b) / 3) < 0.7) {
+ mono_color = Color(1.0, 1.0, 1.0);
+ ic = Color(0.0, 0.0, 0.0, 0.7);
+ } else {
+ mono_color = Color(0.0, 0.0, 0.0);
+ ic = Color(1.0, 1.0, 1.0, 0.7);
+ }
mono_color.a = 0.85;
c = mono_color;
}
gnode->add_color_override("title_color", c);
c.a = 0.7;
gnode->add_color_override("close_color", c);
- gnode->add_color_override("resizer_color", c);
+ gnode->add_color_override("resizer_color", ic);
gnode->add_style_override("frame", sbf);
}
@@ -720,8 +732,8 @@ void VisualScriptEditor::_update_graph(int p_only_id) {
name_box->set_custom_minimum_size(Size2(60 * EDSCALE, 0));
name_box->set_text(left_name);
name_box->set_expand_to_text_length(true);
- name_box->connect("resized", this, "_update_node_size", varray(E->get()));
- name_box->connect("focus_exited", this, "_port_name_focus_out", varray(name_box, E->get(), i, true));
+ name_box->connect_compat("resized", this, "_update_node_size", varray(E->get()));
+ name_box->connect_compat("focus_exited", this, "_port_name_focus_out", varray(name_box, E->get(), i, true));
} else {
hbc->add_child(memnew(Label(left_name)));
}
@@ -734,13 +746,13 @@ void VisualScriptEditor::_update_graph(int p_only_id) {
opbtn->select(left_type);
opbtn->set_custom_minimum_size(Size2(100 * EDSCALE, 0));
hbc->add_child(opbtn);
- opbtn->connect("item_selected", this, "_change_port_type", varray(E->get(), i, true), CONNECT_DEFERRED);
+ opbtn->connect_compat("item_selected", this, "_change_port_type", varray(E->get(), i, true), CONNECT_DEFERRED);
}
Button *rmbtn = memnew(Button);
rmbtn->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("Remove", "EditorIcons"));
hbc->add_child(rmbtn);
- rmbtn->connect("pressed", this, "_remove_input_port", varray(E->get(), i), CONNECT_DEFERRED);
+ rmbtn->connect_compat("pressed", this, "_remove_input_port", varray(E->get(), i), CONNECT_DEFERRED);
} else {
hbc->add_child(memnew(Label(left_name)));
}
@@ -753,14 +765,14 @@ void VisualScriptEditor::_update_graph(int p_only_id) {
if (value.get_type() != left_type) {
//different type? for now convert
//not the same, reconvert
- Variant::CallError ce;
+ Callable::CallError ce;
const Variant *existingp = &value;
value = Variant::construct(left_type, &existingp, 1, ce, false);
}
if (left_type == Variant::COLOR) {
button->set_custom_minimum_size(Size2(30, 0) * EDSCALE);
- button->connect("draw", this, "_draw_color_over_button", varray(button, value));
+ button->connect_compat("draw", this, "_draw_color_over_button", varray(button, value));
} else if (left_type == Variant::OBJECT && Ref<Resource>(value).is_valid()) {
Ref<Resource> res = value;
@@ -776,7 +788,7 @@ void VisualScriptEditor::_update_graph(int p_only_id) {
button->set_text(value);
}
- button->connect("pressed", this, "_default_value_edited", varray(button, E->get(), i));
+ button->connect_compat("pressed", this, "_default_value_edited", varray(button, E->get(), i));
hbc2->add_child(button);
}
} else {
@@ -802,7 +814,7 @@ void VisualScriptEditor::_update_graph(int p_only_id) {
Button *rmbtn = memnew(Button);
rmbtn->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("Remove", "EditorIcons"));
hbc->add_child(rmbtn);
- rmbtn->connect("pressed", this, "_remove_output_port", varray(E->get(), i), CONNECT_DEFERRED);
+ rmbtn->connect_compat("pressed", this, "_remove_output_port", varray(E->get(), i), CONNECT_DEFERRED);
if (nd_list->is_output_port_type_editable()) {
OptionButton *opbtn = memnew(OptionButton);
@@ -812,7 +824,7 @@ void VisualScriptEditor::_update_graph(int p_only_id) {
opbtn->select(right_type);
opbtn->set_custom_minimum_size(Size2(100 * EDSCALE, 0));
hbc->add_child(opbtn);
- opbtn->connect("item_selected", this, "_change_port_type", varray(E->get(), i, false), CONNECT_DEFERRED);
+ opbtn->connect_compat("item_selected", this, "_change_port_type", varray(E->get(), i, false), CONNECT_DEFERRED);
}
if (nd_list->is_output_port_name_editable()) {
@@ -821,8 +833,8 @@ void VisualScriptEditor::_update_graph(int p_only_id) {
name_box->set_custom_minimum_size(Size2(60 * EDSCALE, 0));
name_box->set_text(right_name);
name_box->set_expand_to_text_length(true);
- name_box->connect("resized", this, "_update_node_size", varray(E->get()));
- name_box->connect("focus_exited", this, "_port_name_focus_out", varray(name_box, E->get(), i, false));
+ name_box->connect_compat("resized", this, "_update_node_size", varray(E->get()));
+ name_box->connect_compat("focus_exited", this, "_port_name_focus_out", varray(name_box, E->get(), i, false));
} else {
hbc->add_child(memnew(Label(right_name)));
}
@@ -976,13 +988,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("PackedInt32Array", "EditorIcons"),
+ Control::get_icon("PackedFloat32Array", "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;
@@ -1225,7 +1237,7 @@ void VisualScriptEditor::_add_func_input() {
LineEdit *name_box = memnew(LineEdit);
name_box->set_h_size_flags(SIZE_EXPAND_FILL);
name_box->set_text("input");
- name_box->connect("focus_entered", this, "_deselect_input_names");
+ name_box->connect_compat("focus_entered", this, "_deselect_input_names");
hbox->add_child(name_box);
Label *type_label = memnew(Label);
@@ -1252,7 +1264,7 @@ void VisualScriptEditor::_add_func_input() {
func_input_vbox->add_child(hbox);
hbox->set_meta("id", hbox->get_position_in_parent());
- delete_button->connect("pressed", this, "_remove_func_input", varray(hbox));
+ delete_button->connect_compat("pressed", this, "_remove_func_input", varray(hbox));
name_box->select_all();
name_box->grab_focus();
@@ -2408,7 +2420,7 @@ void VisualScriptEditor::set_edited_resource(const RES &p_res) {
variable_editor->script = script;
variable_editor->undo_redo = undo_redo;
- script->connect("node_ports_changed", this, "_node_ports_changed");
+ script->connect_compat("node_ports_changed", this, "_node_ports_changed");
default_func = script->get_default_func();
@@ -2585,7 +2597,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();
@@ -2910,8 +2922,8 @@ void VisualScriptEditor::_graph_connected(const String &p_from, int p_from_slot,
if (to_type != Variant::NIL && from_type != Variant::NIL && to_type != from_type) {
// add a constructor node between the ports
bool exceptions = false; // true if there are any exceptions
- exceptions = exceptions || (to_type == Variant::INT && from_type == Variant::REAL);
- exceptions = exceptions || (to_type == Variant::REAL && from_type == Variant::INT);
+ exceptions = exceptions || (to_type == Variant::INT && from_type == Variant::FLOAT);
+ exceptions = exceptions || (to_type == Variant::FLOAT && from_type == Variant::INT);
if (Variant::can_convert(from_type, to_type) && !exceptions) {
MethodInfo mi;
mi.name = Variant::get_type_name(to_type);
@@ -3851,7 +3863,7 @@ void VisualScriptEditor::_default_value_edited(Node *p_button, int p_id, int p_i
Variant existing = vsn->get_default_input_value(p_input_port);
if (pinfo.type != Variant::NIL && existing.get_type() != pinfo.type) {
- Variant::CallError ce;
+ Callable::CallError ce;
const Variant *existingp = &existing;
existing = Variant::construct(pinfo.type, &existingp, 1, ce, false);
}
@@ -3904,9 +3916,9 @@ void VisualScriptEditor::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_READY: {
- variable_editor->connect("changed", this, "_update_members");
- signal_editor->connect("changed", this, "_update_members");
- FALLTHROUGH;
+ variable_editor->connect_compat("changed", this, "_update_members");
+ signal_editor->connect_compat("changed", this, "_update_members");
+ [[fallthrough]];
}
case NOTIFICATION_THEME_CHANGED: {
if (p_what != NOTIFICATION_READY && !is_visible_in_tree()) {
@@ -4697,7 +4709,7 @@ VisualScriptEditor::VisualScriptEditor() {
edit_menu->get_popup()->add_separator();
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("visual_script_editor/create_function"), EDIT_CREATE_FUNCTION);
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("visual_script_editor/refresh_nodes"), REFRESH_GRAPH);
- edit_menu->get_popup()->connect("id_pressed", this, "_menu_option");
+ edit_menu->get_popup()->connect_compat("id_pressed", this, "_menu_option");
members_section = memnew(VBoxContainer);
// Add but wait until done setting up this.
@@ -4707,7 +4719,7 @@ VisualScriptEditor::VisualScriptEditor() {
CheckButton *tool_script_check = memnew(CheckButton);
tool_script_check->set_text(TTR("Make Tool:"));
members_section->add_child(tool_script_check);
- tool_script_check->connect("pressed", this, "_toggle_tool_script");
+ tool_script_check->connect_compat("pressed", this, "_toggle_tool_script");
/// Members ///
@@ -4715,11 +4727,11 @@ VisualScriptEditor::VisualScriptEditor() {
members_section->add_margin_child(TTR("Members:"), members, true);
members->set_custom_minimum_size(Size2(0, 50 * EDSCALE));
members->set_hide_root(true);
- members->connect("button_pressed", this, "_member_button");
- members->connect("item_edited", this, "_member_edited");
- members->connect("cell_selected", this, "_member_selected", varray(), CONNECT_DEFERRED);
- members->connect("gui_input", this, "_members_gui_input");
- members->connect("item_rmb_selected", this, "_member_rmb_selected");
+ members->connect_compat("button_pressed", this, "_member_button");
+ members->connect_compat("item_edited", this, "_member_edited");
+ members->connect_compat("cell_selected", this, "_member_selected", varray(), CONNECT_DEFERRED);
+ members->connect_compat("gui_input", this, "_members_gui_input");
+ members->connect_compat("item_rmb_selected", this, "_member_rmb_selected");
members->set_allow_rmb_select(true);
members->set_allow_reselect(true);
members->set_hide_folding(true);
@@ -4727,13 +4739,13 @@ VisualScriptEditor::VisualScriptEditor() {
member_popup = memnew(PopupMenu);
add_child(member_popup);
- member_popup->connect("id_pressed", this, "_member_option");
+ member_popup->connect_compat("id_pressed", this, "_member_option");
function_name_edit = memnew(PopupDialog);
function_name_box = memnew(LineEdit);
function_name_edit->add_child(function_name_box);
function_name_edit->set_h_size_flags(SIZE_EXPAND);
- function_name_box->connect("gui_input", this, "_fn_name_box_input");
+ function_name_box->connect_compat("gui_input", this, "_fn_name_box_input");
function_name_box->set_expand_to_text_length(true);
add_child(function_name_edit);
@@ -4743,15 +4755,15 @@ VisualScriptEditor::VisualScriptEditor() {
add_child(graph);
graph->set_v_size_flags(Control::SIZE_EXPAND_FILL);
graph->set_anchors_and_margins_preset(Control::PRESET_WIDE);
- graph->connect("node_selected", this, "_node_selected");
- graph->connect("_begin_node_move", this, "_begin_node_move");
- graph->connect("_end_node_move", this, "_end_node_move");
- graph->connect("delete_nodes_request", this, "_on_nodes_delete");
- graph->connect("duplicate_nodes_request", this, "_on_nodes_duplicate");
- graph->connect("gui_input", this, "_graph_gui_input");
+ graph->connect_compat("node_selected", this, "_node_selected");
+ graph->connect_compat("_begin_node_move", this, "_begin_node_move");
+ graph->connect_compat("_end_node_move", this, "_end_node_move");
+ graph->connect_compat("delete_nodes_request", this, "_on_nodes_delete");
+ graph->connect_compat("duplicate_nodes_request", this, "_on_nodes_duplicate");
+ graph->connect_compat("gui_input", this, "_graph_gui_input");
graph->set_drag_forwarding(this);
graph->hide();
- graph->connect("scroll_offset_changed", this, "_graph_ofs_changed");
+ graph->connect_compat("scroll_offset_changed", this, "_graph_ofs_changed");
/// Add Buttons to Top Bar/Zoom bar.
HBoxContainer *graph_hbc = graph->get_zoom_hbox();
@@ -4761,18 +4773,18 @@ VisualScriptEditor::VisualScriptEditor() {
graph_hbc->add_child(base_lbl);
base_type_select = memnew(Button);
- base_type_select->connect("pressed", this, "_change_base_type");
+ base_type_select->connect_compat("pressed", this, "_change_base_type");
graph_hbc->add_child(base_type_select);
Button *add_nds = memnew(Button);
add_nds->set_text(TTR("Add Nodes..."));
graph_hbc->add_child(add_nds);
- add_nds->connect("pressed", this, "_add_node_dialog");
+ add_nds->connect_compat("pressed", this, "_add_node_dialog");
Button *fn_btn = memnew(Button);
fn_btn->set_text(TTR("Add Function..."));
graph_hbc->add_child(fn_btn);
- fn_btn->connect("pressed", this, "_create_function_dialog");
+ fn_btn->connect_compat("pressed", this, "_create_function_dialog");
// Add Function Dialog.
VBoxContainer *function_vb = memnew(VBoxContainer);
@@ -4790,7 +4802,7 @@ VisualScriptEditor::VisualScriptEditor() {
func_name_box->set_h_size_flags(SIZE_EXPAND_FILL);
func_name_box->set_placeholder(TTR("function_name"));
func_name_box->set_text("");
- func_name_box->connect("focus_entered", this, "_deselect_input_names");
+ func_name_box->connect_compat("focus_entered", this, "_deselect_input_names");
func_name_hbox->add_child(func_name_box);
// Add minor setting for function if needed, here!
@@ -4800,7 +4812,7 @@ VisualScriptEditor::VisualScriptEditor() {
Button *add_input_button = memnew(Button);
add_input_button->set_h_size_flags(SIZE_EXPAND_FILL);
add_input_button->set_text(TTR("Add Input"));
- add_input_button->connect("pressed", this, "_add_func_input");
+ add_input_button->connect_compat("pressed", this, "_add_func_input");
function_vb->add_child(add_input_button);
func_input_scroll = memnew(ScrollContainer);
@@ -4816,7 +4828,7 @@ VisualScriptEditor::VisualScriptEditor() {
function_create_dialog->set_title(TTR("Create Function"));
function_create_dialog->add_child(function_vb);
function_create_dialog->get_ok()->set_text(TTR("Create"));
- function_create_dialog->get_ok()->connect("pressed", this, "_create_function");
+ function_create_dialog->get_ok()->connect_compat("pressed", this, "_create_function");
add_child(function_create_dialog);
select_func_text = memnew(Label);
@@ -4836,7 +4848,7 @@ VisualScriptEditor::VisualScriptEditor() {
hint_text_timer = memnew(Timer);
hint_text_timer->set_wait_time(4);
- hint_text_timer->connect("timeout", this, "_hide_timer");
+ hint_text_timer->connect_compat("timeout", this, "_hide_timer");
add_child(hint_text_timer);
// Allowed casts (connections).
@@ -4854,9 +4866,9 @@ VisualScriptEditor::VisualScriptEditor() {
graph->add_valid_left_disconnect_type(TYPE_SEQUENCE);
- graph->connect("connection_request", this, "_graph_connected");
- graph->connect("disconnection_request", this, "_graph_disconnected");
- graph->connect("connection_to_empty", this, "_graph_connect_to_empty");
+ graph->connect_compat("connection_request", this, "_graph_connected");
+ graph->connect_compat("disconnection_request", this, "_graph_disconnected");
+ graph->connect_compat("connection_to_empty", this, "_graph_connect_to_empty");
edit_signal_dialog = memnew(AcceptDialog);
edit_signal_dialog->get_ok()->set_text(TTR("Close"));
@@ -4880,7 +4892,7 @@ VisualScriptEditor::VisualScriptEditor() {
select_base_type = memnew(CreateDialog);
select_base_type->set_base_type("Object"); // Anything goes.
- select_base_type->connect("create", this, "_change_base_type_callback");
+ select_base_type->connect_compat("create", this, "_change_base_type_callback");
add_child(select_base_type);
undo_redo = EditorNode::get_singleton()->get_undo_redo();
@@ -4892,22 +4904,22 @@ VisualScriptEditor::VisualScriptEditor() {
default_value_edit = memnew(CustomPropertyEditor);
add_child(default_value_edit);
- default_value_edit->connect("variant_changed", this, "_default_value_changed");
+ default_value_edit->connect_compat("variant_changed", this, "_default_value_changed");
method_select = memnew(VisualScriptPropertySelector);
add_child(method_select);
- method_select->connect("selected", this, "_selected_method");
+ method_select->connect_compat("selected", this, "_selected_method");
error_line = -1;
new_connect_node_select = memnew(VisualScriptPropertySelector);
add_child(new_connect_node_select);
new_connect_node_select->set_resizable(true);
- new_connect_node_select->connect("selected", this, "_selected_connect_node");
- new_connect_node_select->get_cancel()->connect("pressed", this, "_cancel_connect_node");
+ new_connect_node_select->connect_compat("selected", this, "_selected_connect_node");
+ new_connect_node_select->get_cancel()->connect_compat("pressed", this, "_cancel_connect_node");
new_virtual_method_select = memnew(VisualScriptPropertySelector);
add_child(new_virtual_method_select);
- new_virtual_method_select->connect("selected", this, "_selected_new_virtual_method");
+ new_virtual_method_select->connect_compat("selected", this, "_selected_new_virtual_method");
}
VisualScriptEditor::~VisualScriptEditor() {
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_expression.cpp b/modules/visual_script/visual_script_expression.cpp
index 63880df21d..23d1c8ccc0 100644
--- a/modules/visual_script/visual_script_expression.cpp
+++ b/modules/visual_script/visual_script_expression.cpp
@@ -1229,7 +1229,7 @@ public:
//virtual int get_working_memory_size() const { return 0; }
//execute by parsing the tree directly
- virtual bool _execute(const Variant **p_inputs, VisualScriptExpression::ENode *p_node, Variant &r_ret, String &r_error_str, Variant::CallError &ce) {
+ virtual bool _execute(const Variant **p_inputs, VisualScriptExpression::ENode *p_node, Variant &r_ret, String &r_error_str, Callable::CallError &ce) {
switch (p_node->type) {
case VisualScriptExpression::ENode::TYPE_INPUT: {
@@ -1371,7 +1371,7 @@ public:
r_ret = Variant::construct(constructor->data_type, (const Variant **)argp.ptr(), argp.size(), ce);
- if (ce.error != Variant::CallError::CALL_OK) {
+ if (ce.error != Callable::CallError::CALL_OK) {
r_error_str = "Invalid arguments to construct '" + Variant::get_type_name(constructor->data_type) + "'.";
return true;
}
@@ -1398,7 +1398,7 @@ public:
VisualScriptBuiltinFunc::exec_func(bifunc->func, (const Variant **)argp.ptr(), &r_ret, ce, r_error_str);
- if (ce.error != Variant::CallError::CALL_OK) {
+ if (ce.error != Callable::CallError::CALL_OK) {
r_error_str = "Builtin Call Failed. " + r_error_str;
return true;
}
@@ -1430,7 +1430,7 @@ public:
r_ret = base.call(call->method, (const Variant **)argp.ptr(), argp.size(), ce);
- if (ce.error != Variant::CallError::CALL_OK) {
+ if (ce.error != Callable::CallError::CALL_OK) {
r_error_str = "On call to '" + String(call->method) + "':";
return true;
}
@@ -1440,24 +1440,24 @@ public:
return false;
}
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
if (!expression->root || expression->error_set) {
r_error_str = expression->error_str;
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
return 0;
}
bool error = _execute(p_inputs, expression->root, *p_outputs[0], r_error_str, r_error);
- if (error && r_error.error == Variant::CallError::CALL_OK) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ if (error && r_error.error == Callable::CallError::CALL_OK) {
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
}
#ifdef DEBUG_ENABLED
if (!error && expression->output_type != Variant::NIL && !Variant::can_convert_strict(p_outputs[0]->get_type(), expression->output_type)) {
r_error_str += "Can't convert expression result from " + Variant::get_type_name(p_outputs[0]->get_type()) + " to " + Variant::get_type_name(expression->output_type) + ".";
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
}
#endif
diff --git a/modules/visual_script/visual_script_flow_control.cpp b/modules/visual_script/visual_script_flow_control.cpp
index 213dc897af..475893e86d 100644
--- a/modules/visual_script/visual_script_flow_control.cpp
+++ b/modules/visual_script/visual_script_flow_control.cpp
@@ -135,7 +135,7 @@ public:
//virtual bool is_output_port_unsequenced(int p_idx) const { return false; }
//virtual bool get_output_port_unsequenced(int p_idx,Variant* r_value,Variant* p_working_mem,String &r_error) const { return true; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
if (with_value) {
*p_working_mem = *p_inputs[0];
@@ -237,7 +237,7 @@ public:
//virtual bool is_output_port_unsequenced(int p_idx) const { return false; }
//virtual bool get_output_port_unsequenced(int p_idx,Variant* r_value,Variant* p_working_mem,String &r_error) const { return true; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
if (p_start_mode == START_MODE_CONTINUE_SEQUENCE)
return 2;
@@ -323,7 +323,7 @@ public:
//virtual bool is_output_port_unsequenced(int p_idx) const { return false; }
//virtual bool get_output_port_unsequenced(int p_idx,Variant* r_value,Variant* p_working_mem,String &r_error) const { return true; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
bool keep_going = p_inputs[0]->operator bool();
@@ -410,7 +410,7 @@ public:
//virtual bool is_output_port_unsequenced(int p_idx) const { return false; }
//virtual bool get_output_port_unsequenced(int p_idx,Variant* r_value,Variant* p_working_mem,String &r_error) const { return true; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
if (p_start_mode == START_MODE_BEGIN_SEQUENCE) {
p_working_mem[0] = *p_inputs[0];
@@ -418,7 +418,7 @@ public:
bool can_iter = p_inputs[0]->iter_init(p_working_mem[1], valid);
if (!valid) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
r_error_str = RTR("Input type not iterable: ") + Variant::get_type_name(p_inputs[0]->get_type());
return 0;
}
@@ -429,7 +429,7 @@ public:
*p_outputs[0] = p_working_mem[0].iter_get(p_working_mem[1], valid);
if (!valid) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
r_error_str = RTR("Iterator became invalid");
return 0;
}
@@ -440,7 +440,7 @@ public:
bool can_iter = p_working_mem[0].iter_next(p_working_mem[1], valid);
if (!valid) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
r_error_str = RTR("Iterator became invalid: ") + Variant::get_type_name(p_inputs[0]->get_type());
return 0;
}
@@ -451,7 +451,7 @@ public:
*p_outputs[0] = p_working_mem[0].iter_get(p_working_mem[1], valid);
if (!valid) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
r_error_str = RTR("Iterator became invalid");
return 0;
}
@@ -549,7 +549,7 @@ public:
//virtual bool is_output_port_unsequenced(int p_idx) const { return false; }
//virtual bool get_output_port_unsequenced(int p_idx,Variant* r_value,Variant* p_working_mem,String &r_error) const { return true; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
if (p_start_mode == START_MODE_BEGIN_SEQUENCE) {
@@ -645,7 +645,7 @@ public:
//virtual bool is_output_port_unsequenced(int p_idx) const { return false; }
//virtual bool get_output_port_unsequenced(int p_idx,Variant* r_value,Variant* p_working_mem,String &r_error) const { return false; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
if (p_start_mode == START_MODE_CONTINUE_SEQUENCE) {
return case_count; //exit
@@ -836,14 +836,14 @@ public:
//virtual bool is_output_port_unsequenced(int p_idx) const { return false; }
//virtual bool get_output_port_unsequenced(int p_idx,Variant* r_value,Variant* p_working_mem,String &r_error) const { return false; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
Object *obj = *p_inputs[0];
*p_outputs[0] = Variant();
if (!obj) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
r_error_str = "Instance is null";
return 0;
}
@@ -861,7 +861,7 @@ public:
}
Ref<Script> cast_script = Ref<Resource>(ResourceCache::get(script));
if (!cast_script.is_valid()) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
r_error_str = "Script path is not a script: " + script;
return 1;
}
diff --git a/modules/visual_script/visual_script_func_nodes.cpp b/modules/visual_script/visual_script_func_nodes.cpp
index 63c36ae431..011432ef39 100644
--- a/modules/visual_script/visual_script_func_nodes.cpp
+++ b/modules/visual_script/visual_script_func_nodes.cpp
@@ -788,7 +788,7 @@ public:
return true;
}
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
switch (call_mode) {
@@ -808,14 +808,14 @@ public:
Node *node = Object::cast_to<Node>(instance->get_owner_ptr());
if (!node) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
r_error_str = "Base object is not a Node!";
return 0;
}
Node *another = node->get_node(node_path);
if (!another) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
r_error_str = "Path does not lead Node!";
return 0;
}
@@ -846,7 +846,7 @@ public:
} else if (returns == 1) {
v.call(function, p_inputs + 1, input_args, r_error);
} else {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
r_error_str = "Invalid returns count for call_mode == CALL_MODE_INSTANCE";
return 0;
}
@@ -866,7 +866,7 @@ public:
Object *object = Engine::get_singleton()->get_singleton_object(singleton);
if (!object) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
r_error_str = "Invalid singleton name: '" + String(singleton) + "'";
return 0;
}
@@ -884,7 +884,7 @@ public:
if (!validate) {
//ignore call errors if validation is disabled
- r_error.error = Variant::CallError::CALL_OK;
+ r_error.error = Callable::CallError::CALL_OK;
r_error_str = String();
}
@@ -1020,7 +1020,7 @@ void VisualScriptPropertySet::_adjust_input_index(PropertyInfo &pinfo) const {
if (index != StringName()) {
Variant v;
- Variant::CallError ce;
+ Callable::CallError ce;
v = Variant::construct(pinfo.type, NULL, 0, ce);
Variant i = v.get(index);
pinfo.type = i.get_type();
@@ -1167,7 +1167,7 @@ void VisualScriptPropertySet::_update_cache() {
//not super efficient..
Variant v;
- Variant::CallError ce;
+ Callable::CallError ce;
v = Variant::construct(basic_type, NULL, 0, ce);
List<PropertyInfo> pinfo;
@@ -1409,7 +1409,7 @@ void VisualScriptPropertySet::_validate_property(PropertyInfo &property) const {
if (property.name == "index") {
- Variant::CallError ce;
+ Callable::CallError ce;
Variant v = Variant::construct(type_cache.type, NULL, 0, ce);
List<PropertyInfo> plist;
v.get_property_list(&plist);
@@ -1578,7 +1578,7 @@ public:
}
}
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
switch (call_mode) {
@@ -1597,7 +1597,7 @@ public:
}
if (!valid) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
r_error_str = "Invalid set value '" + String(*p_inputs[0]) + "' on property '" + String(property) + "' of type " + object->get_class();
}
} break;
@@ -1605,14 +1605,14 @@ public:
Node *node = Object::cast_to<Node>(instance->get_owner_ptr());
if (!node) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
r_error_str = "Base object is not a Node!";
return 0;
}
Node *another = node->get_node(node_path);
if (!another) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
r_error_str = "Path does not lead Node!";
return 0;
}
@@ -1629,7 +1629,7 @@ public:
}
if (!valid) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
r_error_str = "Invalid set value '" + String(*p_inputs[0]) + "' on property '" + String(property) + "' of type " + another->get_class();
}
@@ -1651,7 +1651,7 @@ public:
}
if (!valid) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
r_error_str = "Invalid set value '" + String(*p_inputs[1]) + "' (" + Variant::get_type_name(p_inputs[1]->get_type()) + ") on property '" + String(property) + "' of type " + Variant::get_type_name(v.get_type());
}
@@ -1875,7 +1875,7 @@ void VisualScriptPropertyGet::_update_cache() {
//not super efficient..
Variant v;
- Variant::CallError ce;
+ Callable::CallError ce;
v = Variant::construct(basic_type, NULL, 0, ce);
List<PropertyInfo> pinfo;
@@ -2124,7 +2124,7 @@ void VisualScriptPropertyGet::_validate_property(PropertyInfo &property) const {
if (property.name == "index") {
- Variant::CallError ce;
+ Callable::CallError ce;
Variant v = Variant::construct(type_cache, NULL, 0, ce);
List<PropertyInfo> plist;
v.get_property_list(&plist);
@@ -2211,7 +2211,7 @@ public:
VisualScriptPropertyGet *node;
VisualScriptInstance *instance;
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
switch (call_mode) {
@@ -2228,7 +2228,7 @@ public:
}
if (!valid) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
r_error_str = RTR("Invalid index property name.");
return 0;
}
@@ -2237,14 +2237,14 @@ public:
Node *node = Object::cast_to<Node>(instance->get_owner_ptr());
if (!node) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
r_error_str = RTR("Base object is not a Node!");
return 0;
}
Node *another = node->get_node(node_path);
if (!another) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
r_error_str = RTR("Path does not lead Node!");
return 0;
}
@@ -2258,7 +2258,7 @@ public:
}
if (!valid) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
r_error_str = vformat(RTR("Invalid index property name '%s' in node %s."), String(property), another->get_name());
return 0;
}
@@ -2275,7 +2275,7 @@ public:
}
if (!valid) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
r_error_str = RTR("Invalid index property name.");
}
};
@@ -2434,7 +2434,7 @@ public:
//virtual bool is_output_port_unsequenced(int p_idx) const { return false; }
//virtual bool get_output_port_unsequenced(int p_idx,Variant* r_value,Variant* p_working_mem,String &r_error) const { return true; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
Object *obj = instance->get_owner_ptr();
@@ -2500,7 +2500,7 @@ void register_visual_script_func_nodes() {
Variant::Type t = Variant::Type(i);
String type_name = Variant::get_type_name(t);
- Variant::CallError ce;
+ Callable::CallError ce;
Variant vt = Variant::construct(t, NULL, 0, ce);
List<MethodInfo> ml;
vt.get_method_list(&ml);
diff --git a/modules/visual_script/visual_script_nodes.cpp b/modules/visual_script/visual_script_nodes.cpp
index dc49ed72d0..4a9a6bdb1d 100644
--- a/modules/visual_script/visual_script_nodes.cpp
+++ b/modules/visual_script/visual_script_nodes.cpp
@@ -285,7 +285,7 @@ public:
//virtual int get_working_memory_size() const { return 0; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
int ac = node->get_argument_count();
@@ -294,7 +294,7 @@ public:
Variant::Type expected = node->get_argument_type(i);
if (expected != Variant::NIL) {
if (!Variant::can_convert_strict(p_inputs[i]->get_type(), expected)) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.expected = expected;
r_error.argument = i;
return 0;
@@ -762,7 +762,7 @@ public:
int input_count = 0;
virtual int get_working_memory_size() const { return 0; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
if (input_count > 0) {
Array arr;
@@ -1031,7 +1031,7 @@ public:
//virtual int get_working_memory_size() const { return 0; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
bool valid;
if (unary) {
@@ -1043,7 +1043,7 @@ public:
if (!valid) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
if (p_outputs[0]->get_type() == Variant::STRING) {
r_error_str = *p_outputs[0];
} else {
@@ -1165,7 +1165,7 @@ class VisualScriptNodeInstanceSelect : public VisualScriptNodeInstance {
public:
//virtual int get_working_memory_size() const { return 0; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
bool cond = *p_inputs[0];
if (cond)
@@ -1285,10 +1285,10 @@ public:
VisualScriptInstance *instance;
StringName variable;
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
if (!instance->get_variable(variable, p_outputs[0])) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
r_error_str = RTR("VariableGet not found in script: ") + "'" + String(variable) + "'";
return 0;
}
@@ -1407,11 +1407,11 @@ public:
//virtual int get_working_memory_size() const { return 0; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
if (!instance->set_variable(variable, *p_inputs[0])) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
r_error_str = RTR("VariableSet not found in script: ") + "'" + String(variable) + "'";
}
@@ -1482,7 +1482,7 @@ void VisualScriptConstant::set_constant_type(Variant::Type p_type) {
return;
type = p_type;
- Variant::CallError ce;
+ Callable::CallError ce;
value = Variant::construct(type, NULL, 0, ce);
ports_changed_notify();
_change_notify();
@@ -1537,7 +1537,7 @@ public:
Variant constant;
//virtual int get_working_memory_size() const { return 0; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
*p_outputs[0] = constant;
return 0;
@@ -1642,7 +1642,7 @@ public:
Ref<Resource> preload;
//virtual int get_working_memory_size() const { return 0; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
*p_outputs[0] = preload;
return 0;
@@ -1710,13 +1710,13 @@ class VisualScriptNodeInstanceIndexGet : public VisualScriptNodeInstance {
public:
//virtual int get_working_memory_size() const { return 0; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
bool valid;
*p_outputs[0] = p_inputs[0]->get(*p_inputs[1], &valid);
if (!valid) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
r_error_str = "Invalid get: " + p_inputs[0]->get_construct_string();
}
return 0;
@@ -1785,14 +1785,14 @@ class VisualScriptNodeInstanceIndexSet : public VisualScriptNodeInstance {
public:
//virtual int get_working_memory_size() const { return 0; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
bool valid;
*p_outputs[0] = *p_inputs[0];
p_outputs[0]->set(*p_inputs[1], *p_inputs[2], &valid);
if (!valid) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
r_error_str = "Invalid set: " + p_inputs[1]->get_construct_string();
}
return 0;
@@ -1866,7 +1866,7 @@ public:
int index;
//virtual int get_working_memory_size() const { return 0; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
*p_outputs[0] = GlobalConstants::get_global_constant_value(index);
return 0;
@@ -1991,11 +1991,11 @@ public:
bool valid;
//virtual int get_working_memory_size() const { return 0; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
if (!valid) {
r_error_str = "Invalid constant name, pick a valid class constant.";
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
}
*p_outputs[0] = value;
@@ -2140,11 +2140,11 @@ public:
bool valid;
//virtual int get_working_memory_size() const { return 0; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
if (!valid) {
r_error_str = "Invalid constant name, pick a valid basic type constant.";
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
}
*p_outputs[0] = value;
@@ -2259,7 +2259,7 @@ PropertyInfo VisualScriptMathConstant::get_input_value_port_info(int p_idx) cons
PropertyInfo VisualScriptMathConstant::get_output_value_port_info(int p_idx) const {
- return PropertyInfo(Variant::REAL, const_name[constant]);
+ return PropertyInfo(Variant::FLOAT, const_name[constant]);
}
String VisualScriptMathConstant::get_caption() const {
@@ -2283,7 +2283,7 @@ public:
float value;
//virtual int get_working_memory_size() const { return 0; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
*p_outputs[0] = value;
return 0;
@@ -2389,7 +2389,7 @@ public:
//virtual int get_working_memory_size() const { return 0; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
*p_outputs[0] = singleton;
return 0;
@@ -2512,18 +2512,18 @@ public:
//virtual int get_working_memory_size() const { return 0; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
Node *node = Object::cast_to<Node>(instance->get_owner_ptr());
if (!node) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
r_error_str = "Base object is not a Node!";
return 0;
}
Node *another = node->get_node(path);
if (!another) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
r_error_str = "Path does not lead Node!";
return 0;
}
@@ -2696,18 +2696,18 @@ public:
//virtual int get_working_memory_size() const { return 0; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
Node *node = Object::cast_to<Node>(instance->get_owner_ptr());
if (!node) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
r_error_str = "Base object is not a Node!";
return 0;
}
SceneTree *tree = node->get_tree();
if (!tree) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
r_error_str = "Attempt to get SceneTree while node is not in the active tree.";
return 0;
}
@@ -2803,7 +2803,7 @@ public:
//virtual int get_working_memory_size() const { return 0; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
*p_outputs[0] = path;
return 0;
@@ -2885,7 +2885,7 @@ public:
//virtual int get_working_memory_size() const { return 0; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
*p_outputs[0] = instance->get_owner_ptr();
return 0;
@@ -3022,13 +3022,13 @@ public:
int work_mem_size;
virtual int get_working_memory_size() const { return work_mem_size; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
if (node->get_script_instance()) {
#ifdef DEBUG_ENABLED
if (!node->get_script_instance()->has_method(VisualScriptLanguage::singleton->_step)) {
r_error_str = RTR("Custom node has no _step() method, can't process graph.");
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
return 0;
}
#endif
@@ -3055,13 +3055,13 @@ public:
Variant ret = node->get_script_instance()->call(VisualScriptLanguage::singleton->_step, in_values, out_values, p_start_mode, work_mem);
if (ret.get_type() == Variant::STRING) {
r_error_str = ret;
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
return 0;
} else if (ret.is_num()) {
ret_out = ret;
} else {
r_error_str = RTR("Invalid return value from _step(), must be integer (seq out), or string (error).");
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
return 0;
}
@@ -3144,7 +3144,7 @@ void VisualScriptCustomNode::_bind_methods() {
}
VisualScriptCustomNode::VisualScriptCustomNode() {
- connect("script_changed", this, "_script_changed");
+ connect_compat("script_changed", this, "_script_changed");
}
//////////////////////////////////////////
@@ -3237,11 +3237,11 @@ public:
//virtual int get_working_memory_size() const { return 0; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
if (!valid) {
r_error_str = "Node requires a script with a _subcall(<args>) method to work.";
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
return 0;
}
*p_outputs[0] = subcall->call(VisualScriptLanguage::singleton->_subcall, p_inputs, input_args, r_error);
@@ -3368,7 +3368,7 @@ public:
//virtual int get_working_memory_size() const { return 0; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
return 0;
}
@@ -3483,11 +3483,11 @@ public:
//virtual int get_working_memory_size() const { return 0; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
- Variant::CallError ce;
+ Callable::CallError ce;
*p_outputs[0] = Variant::construct(type, p_inputs, argcount, ce);
- if (ce.error != Variant::CallError::CALL_OK) {
+ if (ce.error != Callable::CallError::CALL_OK) {
r_error_str = "Invalid arguments for constructor";
}
@@ -3612,7 +3612,7 @@ public:
StringName name;
virtual int get_working_memory_size() const { return 1; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
*p_outputs[0] = *p_working_mem;
return 0;
@@ -3733,7 +3733,7 @@ public:
StringName name;
virtual int get_working_memory_size() const { return 1; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
*p_working_mem = *p_inputs[0];
*p_outputs[0] = *p_working_mem;
@@ -3868,7 +3868,7 @@ public:
StringName action;
VisualScriptInputAction::Mode mode;
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
switch (mode) {
case VisualScriptInputAction::MODE_PRESSED: {
@@ -4007,7 +4007,7 @@ void VisualScriptDeconstruct::_update_elements() {
elements.clear();
Variant v;
- Variant::CallError ce;
+ Callable::CallError ce;
v = Variant::construct(type, NULL, 0, ce);
List<PropertyInfo> pinfo;
@@ -4065,7 +4065,7 @@ public:
//virtual int get_working_memory_size() const { return 0; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
Variant in = *p_inputs[0];
@@ -4074,7 +4074,7 @@ public:
*p_outputs[i] = in.get(outputs[i], &valid);
if (!valid) {
r_error_str = "Can't obtain element '" + String(outputs[i]) + "' from " + Variant::get_type_name(in.get_type());
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
return 0;
}
}
diff --git a/modules/visual_script/visual_script_property_selector.cpp b/modules/visual_script/visual_script_property_selector.cpp
index e8c02a41c4..20bad364dc 100644
--- a/modules/visual_script/visual_script_property_selector.cpp
+++ b/modules/visual_script/visual_script_property_selector.cpp
@@ -119,13 +119,15 @@ 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("PackedInt32Array", "EditorIcons"),
+ Control::get_icon("PackedFloat32Array", "EditorIcons"),
+ Control::get_icon("PackedInt64Array", "EditorIcons"),
+ Control::get_icon("PackedFloat64Array", "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());
@@ -193,7 +195,7 @@ void VisualScriptPropertySelector::_update_search() {
{
if (type != Variant::NIL) {
Variant v;
- Variant::CallError ce;
+ Callable::CallError ce;
v = Variant::construct(type, NULL, 0, ce);
v.get_method_list(&methods);
} else {
@@ -279,7 +281,7 @@ void VisualScriptPropertySelector::_update_search() {
if (type == Variant::BOOL) {
get_visual_node_names("operators/logic/", Set<String>(), found, root, search_box);
}
- if (type == Variant::BOOL || type == Variant::INT || type == Variant::REAL || type == Variant::VECTOR2 || type == Variant::VECTOR3) {
+ if (type == Variant::BOOL || type == Variant::INT || type == Variant::FLOAT || type == Variant::VECTOR2 || type == Variant::VECTOR3) {
get_visual_node_names("operators/math/", Set<String>(), found, root, search_box);
}
}
@@ -355,7 +357,7 @@ void VisualScriptPropertySelector::get_visual_node_names(const String &root_filt
continue;
}
- bool in_modifier = false | p_modifiers.empty();
+ bool in_modifier = p_modifiers.empty();
for (Set<String>::Element *F = p_modifiers.front(); F && in_modifier; F = F->next()) {
if (E->get().findn(F->get()) != -1)
in_modifier = true;
@@ -520,7 +522,7 @@ void VisualScriptPropertySelector::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE) {
- connect("confirmed", this, "_confirmed");
+ connect_compat("confirmed", this, "_confirmed");
}
}
@@ -703,23 +705,23 @@ VisualScriptPropertySelector::VisualScriptPropertySelector() {
//set_child_rect(vbc);
search_box = memnew(LineEdit);
vbc->add_margin_child(TTR("Search:"), search_box);
- search_box->connect("text_changed", this, "_text_changed");
- search_box->connect("gui_input", this, "_sbox_input");
+ search_box->connect_compat("text_changed", this, "_text_changed");
+ search_box->connect_compat("gui_input", this, "_sbox_input");
search_options = memnew(Tree);
vbc->add_margin_child(TTR("Matches:"), search_options, true);
get_ok()->set_text(TTR("Open"));
get_ok()->set_disabled(true);
register_text_enter(search_box);
set_hide_on_ok(false);
- search_options->connect("item_activated", this, "_confirmed");
- search_options->connect("cell_selected", this, "_item_selected");
+ search_options->connect_compat("item_activated", this, "_confirmed");
+ search_options->connect_compat("cell_selected", this, "_item_selected");
search_options->set_hide_root(true);
search_options->set_hide_folding(true);
virtuals_only = false;
seq_connect = false;
help_bit = memnew(EditorHelpBit);
vbc->add_margin_child(TTR("Description:"), help_bit);
- help_bit->connect("request_hide", this, "_closed");
+ help_bit->connect_compat("request_hide", this, "_closed");
search_options->set_columns(3);
search_options->set_column_expand(1, false);
search_options->set_column_expand(2, false);
diff --git a/modules/visual_script/visual_script_yield_nodes.cpp b/modules/visual_script/visual_script_yield_nodes.cpp
index 877d5836d2..858074742e 100644
--- a/modules/visual_script/visual_script_yield_nodes.cpp
+++ b/modules/visual_script/visual_script_yield_nodes.cpp
@@ -99,7 +99,7 @@ public:
//virtual bool is_output_port_unsequenced(int p_idx) const { return false; }
//virtual bool get_output_port_unsequenced(int p_idx,Variant* r_value,Variant* p_working_mem,String &r_error) const { return false; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
if (p_start_mode == START_MODE_RESUME_YIELD) {
return 0; //resuming yield
@@ -109,7 +109,7 @@ public:
SceneTree *tree = Object::cast_to<SceneTree>(OS::get_singleton()->get_main_loop());
if (!tree) {
r_error_str = "Main Loop is not SceneTree";
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
return 0;
}
@@ -188,7 +188,7 @@ void VisualScriptYield::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_wait_time"), &VisualScriptYield::get_wait_time);
ADD_PROPERTY(PropertyInfo(Variant::INT, "mode", PROPERTY_HINT_ENUM, "Frame,Physics Frame,Time", PROPERTY_USAGE_NOEDITOR), "set_yield_mode", "get_yield_mode");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "wait_time"), "set_wait_time", "get_wait_time");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "wait_time"), "set_wait_time", "get_wait_time");
BIND_ENUM_CONSTANT(YIELD_FRAME);
BIND_ENUM_CONSTANT(YIELD_PHYSICS_FRAME);
@@ -509,7 +509,7 @@ public:
//virtual bool is_output_port_unsequenced(int p_idx) const { return false; }
//virtual bool get_output_port_unsequenced(int p_idx,Variant* r_value,Variant* p_working_mem,String &r_error) const { return true; }
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
+ virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
if (p_start_mode == START_MODE_RESUME_YIELD) {
return 0; //resuming yield
@@ -529,14 +529,14 @@ public:
Node *node = Object::cast_to<Node>(instance->get_owner_ptr());
if (!node) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
r_error_str = "Base object is not a Node!";
return 0;
}
Node *another = node->get_node(node_path);
if (!another) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
r_error_str = "Path does not lead Node!";
return 0;
}
@@ -548,7 +548,7 @@ public:
object = *p_inputs[0];
if (!object) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
r_error_str = "Supplied instance input is null.";
return 0;
}
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/doc_classes/WebSocketClient.xml b/modules/websocket/doc_classes/WebSocketClient.xml
index 2549321db3..45db49c913 100644
--- a/modules/websocket/doc_classes/WebSocketClient.xml
+++ b/modules/websocket/doc_classes/WebSocketClient.xml
@@ -17,11 +17,11 @@
</return>
<argument index="0" name="url" type="String">
</argument>
- <argument index="1" name="protocols" type="PoolStringArray" default="PoolStringArray( )">
+ <argument index="1" name="protocols" type="PackedStringArray" default="PackedStringArray( )">
</argument>
<argument index="2" name="gd_mp_api" type="bool" default="false">
</argument>
- <argument index="3" name="custom_headers" type="PoolStringArray" default="PoolStringArray( )">
+ <argument index="3" name="custom_headers" type="PackedStringArray" default="PackedStringArray( )">
</argument>
<description>
Connects to the given URL requesting one of the given [code]protocols[/code] as sub-protocol. If the list empty (default), no sub-protocol will be requested.
diff --git a/modules/websocket/doc_classes/WebSocketServer.xml b/modules/websocket/doc_classes/WebSocketServer.xml
index f66e1bf54b..f7805209e2 100644
--- a/modules/websocket/doc_classes/WebSocketServer.xml
+++ b/modules/websocket/doc_classes/WebSocketServer.xml
@@ -63,7 +63,7 @@
</return>
<argument index="0" name="port" type="int">
</argument>
- <argument index="1" name="protocols" type="PoolStringArray" default="PoolStringArray( )">
+ <argument index="1" name="protocols" type="PackedStringArray" default="PackedStringArray( )">
</argument>
<argument index="2" name="gd_mp_api" type="bool" default="false">
</argument>
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;