diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index 79e74c4cc4a..ed234a57eb1 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -21,11 +21,11 @@ var array = new Godot.Collections.Array{"First", 2, 3, "Last"}; GD.Print(array[0]); // Prints "First" GD.Print(array[2]); // Prints 3 - GD.Print(array[array.Count - 1]); // Prints "Last" + GD.Print(array[^1]); // Prints "Last" - array[2] = "Second"; + array[1] = "Second"; GD.Print(array[1]); // Prints "Second" - GD.Print(array[array.Count - 3]); // Prints "Second" + GD.Print(array[^3]); // Prints "Second" [/csharp] [/codeblocks] [b]Note:[/b] Arrays are always passed by [b]reference[/b]. To get a copy of an array that can be modified independently of the original array, use [method duplicate]. diff --git a/doc/classes/DTLSServer.xml b/doc/classes/DTLSServer.xml index 41e241779a9..7fc45d80bf8 100644 --- a/doc/classes/DTLSServer.xml +++ b/doc/classes/DTLSServer.xml @@ -19,7 +19,7 @@ server.listen(4242) var key = load("key.key") # Your private key. var cert = load("cert.crt") # Your X509 certificate. - dtls.setup(key, cert) + dtls.setup(TlsOptions.server(key, cert)) func _process(delta): while server.is_connection_available(): @@ -52,12 +52,12 @@ _server.Listen(4242); var key = GD.Load<CryptoKey>("key.key"); // Your private key. var cert = GD.Load<X509Certificate>("cert.crt"); // Your X509 certificate. - _dtls.Setup(key, cert); + _dtls.Setup(TlsOptions.Server(key, cert)); } public override void _Process(double delta) { - while (Server.IsConnectionAvailable()) + while (_server.IsConnectionAvailable()) { PacketPeerUdp peer = _server.TakeConnection(); PacketPeerDtls dtlsPeer = _dtls.TakeConnection(peer); diff --git a/doc/classes/Window.xml b/doc/classes/Window.xml index ca155881c8e..64ff78e647a 100644 --- a/doc/classes/Window.xml +++ b/doc/classes/Window.xml @@ -638,13 +638,13 @@ [/gdscript] [csharp] // Set region, using Path2D node. - GetNode<Window>("Window").MousePassthrough = GetNode<Path2D>("Path2D").Curve.GetBakedPoints(); + GetNode<Window>("Window").MousePassthroughPolygon = GetNode<Path2D>("Path2D").Curve.GetBakedPoints(); // Set region, using Polygon2D node. - GetNode<Window>("Window").MousePassthrough = GetNode<Polygon2D>("Polygon2D").Polygon; + GetNode<Window>("Window").MousePassthroughPolygon = GetNode<Polygon2D>("Polygon2D").Polygon; // Reset region to default. - GetNode<Window>("Window").MousePassthrough = new Vector2[] {}; + GetNode<Window>("Window").MousePassthroughPolygon = new Vector2[] {}; [/csharp] [/codeblocks] [b]Note:[/b] This property is ignored if [member mouse_passthrough] is set to [code]true[/code]. diff --git a/modules/gltf/extensions/gltf_document_extension_convert_importer_mesh.cpp b/modules/gltf/extensions/gltf_document_extension_convert_importer_mesh.cpp index 90147a2b9a5..f9382814450 100644 --- a/modules/gltf/extensions/gltf_document_extension_convert_importer_mesh.cpp +++ b/modules/gltf/extensions/gltf_document_extension_convert_importer_mesh.cpp @@ -48,6 +48,29 @@ void GLTFDocumentExtensionConvertImporterMesh::_copy_meta(Object *p_src_object, } } +MeshInstance3D *GLTFDocumentExtensionConvertImporterMesh::convert_importer_mesh_instance_3d(ImporterMeshInstance3D *p_importer_mesh_instance_3d) { + // Convert the node itself first. + MeshInstance3D *mesh_instance_node_3d = memnew(MeshInstance3D); + ERR_FAIL_NULL_V(p_importer_mesh_instance_3d, mesh_instance_node_3d); + mesh_instance_node_3d->set_name(p_importer_mesh_instance_3d->get_name()); + mesh_instance_node_3d->set_transform(p_importer_mesh_instance_3d->get_transform()); + mesh_instance_node_3d->set_skin(p_importer_mesh_instance_3d->get_skin()); + mesh_instance_node_3d->set_skeleton_path(p_importer_mesh_instance_3d->get_skeleton_path()); + mesh_instance_node_3d->set_visible(p_importer_mesh_instance_3d->is_visible()); + p_importer_mesh_instance_3d->replace_by(mesh_instance_node_3d); + _copy_meta(p_importer_mesh_instance_3d, mesh_instance_node_3d); + // Convert the mesh data in the mesh resource. + Ref importer_mesh = p_importer_mesh_instance_3d->get_mesh(); + if (importer_mesh.is_valid()) { + Ref array_mesh = importer_mesh->get_mesh(); + mesh_instance_node_3d->set_mesh(array_mesh); + _copy_meta(importer_mesh.ptr(), array_mesh.ptr()); + } else { + WARN_PRINT("glTF: ImporterMeshInstance3D does not have a valid mesh. This should not happen. Continuing anyway."); + } + return mesh_instance_node_3d; +} + Error GLTFDocumentExtensionConvertImporterMesh::import_post(Ref p_state, Node *p_root) { ERR_FAIL_NULL_V(p_root, ERR_INVALID_PARAMETER); ERR_FAIL_NULL_V(p_state, ERR_INVALID_PARAMETER); @@ -59,24 +82,8 @@ Error GLTFDocumentExtensionConvertImporterMesh::import_post(Ref p_sta Node *node = E->get(); ImporterMeshInstance3D *importer_mesh_3d = Object::cast_to(node); if (importer_mesh_3d) { - MeshInstance3D *mesh_instance_node_3d = memnew(MeshInstance3D); - Ref mesh = importer_mesh_3d->get_mesh(); - if (mesh.is_valid()) { - Ref array_mesh = mesh->get_mesh(); - mesh_instance_node_3d->set_name(node->get_name()); - mesh_instance_node_3d->set_transform(importer_mesh_3d->get_transform()); - mesh_instance_node_3d->set_mesh(array_mesh); - mesh_instance_node_3d->set_skin(importer_mesh_3d->get_skin()); - mesh_instance_node_3d->set_skeleton_path(importer_mesh_3d->get_skeleton_path()); - mesh_instance_node_3d->set_visible(importer_mesh_3d->is_visible()); - node->replace_by(mesh_instance_node_3d); - _copy_meta(importer_mesh_3d, mesh_instance_node_3d); - _copy_meta(mesh.ptr(), array_mesh.ptr()); - delete_queue.push_back(node); - node = mesh_instance_node_3d; - } else { - memdelete(mesh_instance_node_3d); - } + delete_queue.push_back(importer_mesh_3d); + node = convert_importer_mesh_instance_3d(importer_mesh_3d); } int child_count = node->get_child_count(); for (int i = 0; i < child_count; i++) { diff --git a/modules/gltf/extensions/gltf_document_extension_convert_importer_mesh.h b/modules/gltf/extensions/gltf_document_extension_convert_importer_mesh.h index 7efffc873c3..f7c6f44aad1 100644 --- a/modules/gltf/extensions/gltf_document_extension_convert_importer_mesh.h +++ b/modules/gltf/extensions/gltf_document_extension_convert_importer_mesh.h @@ -35,6 +35,8 @@ #include "gltf_document_extension.h" +class MeshInstance3D; + class GLTFDocumentExtensionConvertImporterMesh : public GLTFDocumentExtension { GDCLASS(GLTFDocumentExtensionConvertImporterMesh, GLTFDocumentExtension); @@ -43,6 +45,7 @@ class GLTFDocumentExtensionConvertImporterMesh : public GLTFDocumentExtension { static void _copy_meta(Object *p_src_object, Object *p_dst_object); public: + static MeshInstance3D *convert_importer_mesh_instance_3d(ImporterMeshInstance3D *p_importer_mesh_instance_3d); Error import_post(Ref p_state, Node *p_root) override; }; diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp index e43f941d3a8..008334d96ff 100644 --- a/modules/gltf/gltf_document.cpp +++ b/modules/gltf/gltf_document.cpp @@ -32,6 +32,7 @@ #include "gltf_document.h" +#include "extensions/gltf_document_extension_convert_importer_mesh.h" #include "extensions/gltf_spec_gloss.h" #include "gltf_state.h" #include "skin_tool.h" @@ -7338,6 +7339,11 @@ Node *GLTFDocument::generate_scene(Ref p_state, float p_bake_fps, boo ERR_CONTINUE(err != OK); } } + ImporterMeshInstance3D *root_importer_mesh = Object::cast_to(root); + if (unlikely(root_importer_mesh)) { + root = GLTFDocumentExtensionConvertImporterMesh::convert_importer_mesh_instance_3d(root_importer_mesh); + memdelete(root_importer_mesh); + } for (Ref ext : document_extensions) { ERR_CONTINUE(ext.is_null()); err = ext->import_post(p_state, root); diff --git a/modules/navigation/nav_map.cpp b/modules/navigation/nav_map.cpp index 6c62a365658..dc04c7df68e 100644 --- a/modules/navigation/nav_map.cpp +++ b/modules/navigation/nav_map.cpp @@ -672,7 +672,6 @@ Vector3 NavMap::get_closest_point_to_segment(const Vector3 &p_from, const Vector } Vector3 NavMap::get_closest_point(const Vector3 &p_point) const { - RWLockRead read_lock(map_rwlock); if (iteration_id == 0) { NAVMAP_ITERATION_ZERO_ERROR_MSG(); return Vector3(); @@ -682,7 +681,6 @@ Vector3 NavMap::get_closest_point(const Vector3 &p_point) const { } Vector3 NavMap::get_closest_point_normal(const Vector3 &p_point) const { - RWLockRead read_lock(map_rwlock); if (iteration_id == 0) { NAVMAP_ITERATION_ZERO_ERROR_MSG(); return Vector3(); @@ -692,7 +690,6 @@ Vector3 NavMap::get_closest_point_normal(const Vector3 &p_point) const { } RID NavMap::get_closest_point_owner(const Vector3 &p_point) const { - RWLockRead read_lock(map_rwlock); if (iteration_id == 0) { NAVMAP_ITERATION_ZERO_ERROR_MSG(); return RID(); diff --git a/thirdparty/glslang/SPIRV/SpvBuilder.h b/thirdparty/glslang/SPIRV/SpvBuilder.h index a65a98e3377..1499592c4f8 100644 --- a/thirdparty/glslang/SPIRV/SpvBuilder.h +++ b/thirdparty/glslang/SPIRV/SpvBuilder.h @@ -56,6 +56,7 @@ namespace spv { } #include +#include #include #include #include diff --git a/thirdparty/glslang/patches/fix-build-gcc15.patch b/thirdparty/glslang/patches/fix-build-gcc15.patch new file mode 100644 index 00000000000..69ccf8e34c3 --- /dev/null +++ b/thirdparty/glslang/patches/fix-build-gcc15.patch @@ -0,0 +1,12 @@ +diff --git a/thirdparty/glslang/SPIRV/SpvBuilder.h b/thirdparty/glslang/SPIRV/SpvBuilder.h +index a65a98e337..1499592c4f 100644 +--- a/thirdparty/glslang/SPIRV/SpvBuilder.h ++++ b/thirdparty/glslang/SPIRV/SpvBuilder.h +@@ -56,6 +56,7 @@ namespace spv { + } + + #include ++#include + #include + #include + #include diff --git a/thirdparty/thorvg/inc/thorvg.h b/thirdparty/thorvg/inc/thorvg.h index 4303092a5ea..607b7b37825 100644 --- a/thirdparty/thorvg/inc/thorvg.h +++ b/thirdparty/thorvg/inc/thorvg.h @@ -1,6 +1,7 @@ #ifndef _THORVG_H_ #define _THORVG_H_ +#include #include #include #include diff --git a/thirdparty/thorvg/patches/fix-build-gcc15.patch b/thirdparty/thorvg/patches/fix-build-gcc15.patch new file mode 100644 index 00000000000..4071e1dd6e6 --- /dev/null +++ b/thirdparty/thorvg/patches/fix-build-gcc15.patch @@ -0,0 +1,12 @@ +diff --git a/thirdparty/thorvg/inc/thorvg.h b/thirdparty/thorvg/inc/thorvg.h +index 8e3ab4e6ce..f515a03136 100644 +--- a/thirdparty/thorvg/inc/thorvg.h ++++ b/thirdparty/thorvg/inc/thorvg.h +@@ -1,6 +1,7 @@ + #ifndef _THORVG_H_ + #define _THORVG_H_ + ++#include + #include + #include + #include