diff options
-rw-r--r-- | scene/main/node.cpp | 5 | ||||
-rw-r--r-- | scene/resources/navigation_mesh.cpp | 2 | ||||
-rw-r--r-- | thirdparty/README.md | 3 | ||||
-rw-r--r-- | thirdparty/pcre2/patches/sljit-macos11-conditional.patch | 31 | ||||
-rw-r--r-- | thirdparty/pcre2/src/sljit/sljitExecAllocator.c | 3 |
5 files changed, 42 insertions, 2 deletions
diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 0c1a62c667..bd791dff2a 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -2528,9 +2528,10 @@ Node *Node::get_node_and_resource(const NodePath &p_path, Ref<Resource> &r_res, int j = 0; // If not p_last_is_property, we shouldn't consider the last one as part of the resource for (; j < p_path.get_subname_count() - (int)p_last_is_property; j++) { - Variant new_res_v = j == 0 ? node->get(p_path.get_subname(j)) : r_res->get(p_path.get_subname(j)); + bool is_valid = false; + Variant new_res_v = j == 0 ? node->get(p_path.get_subname(j), &is_valid) : r_res->get(p_path.get_subname(j), &is_valid); - if (new_res_v.get_type() == Variant::NIL) { // Found nothing on that path + if (!is_valid) { // Found nothing on that path return nullptr; } diff --git a/scene/resources/navigation_mesh.cpp b/scene/resources/navigation_mesh.cpp index 7813de94ca..dd0a8472a4 100644 --- a/scene/resources/navigation_mesh.cpp +++ b/scene/resources/navigation_mesh.cpp @@ -38,6 +38,7 @@ void NavigationMesh::create_from_mesh(const Ref<Mesh> &p_mesh) { for (int i = 0; i < p_mesh->get_surface_count(); i++) { if (p_mesh->surface_get_primitive_type(i) != Mesh::PRIMITIVE_TRIANGLES) { + WARN_PRINT("A mesh surface was skipped when creating a NavigationMesh due to wrong primitive type in the source mesh. Mesh surface must be made out of triangles."); continue; } Array arr = p_mesh->surface_get_arrays(i); @@ -46,6 +47,7 @@ void NavigationMesh::create_from_mesh(const Ref<Mesh> &p_mesh) { Vector<Vector3> varr = arr[Mesh::ARRAY_VERTEX]; Vector<int> iarr = arr[Mesh::ARRAY_INDEX]; if (varr.size() == 0 || iarr.size() == 0) { + WARN_PRINT("A mesh surface was skipped when creating a NavigationMesh due to an empty vertex or index array."); continue; } diff --git a/thirdparty/README.md b/thirdparty/README.md index ab59d4fc18..0b0583b1fc 100644 --- a/thirdparty/README.md +++ b/thirdparty/README.md @@ -547,6 +547,9 @@ Files extracted from upstream source: - src/sljit/ - AUTHORS and LICENCE +A sljit patch from upstream was backported to fix macOS < 11.0 compilation +in 10.40, it can be found in the `patches` folder. + ## recastnavigation diff --git a/thirdparty/pcre2/patches/sljit-macos11-conditional.patch b/thirdparty/pcre2/patches/sljit-macos11-conditional.patch new file mode 100644 index 0000000000..def1207a3d --- /dev/null +++ b/thirdparty/pcre2/patches/sljit-macos11-conditional.patch @@ -0,0 +1,31 @@ +From de8fc816bc6698ab97316ed954e133e7e5098262 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= <carenas@gmail.com> +Date: Thu, 21 Apr 2022 21:01:12 -0700 +Subject: [PATCH] macos: somehow allow building with a target below 11.0 + +While building for macOS older than 11 in Apple Silicon makes no +sense, some build systems lack the flexibility to set a target per +architecture while aiming to support multi architecture binaries. + +Allow an option in those cases by using the slower runtime checks +if the toolchain allows it. + +Fixes: PCRE2Project/pcre2#109 +--- + sljit_src/sljitExecAllocator.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/sljit_src/sljitExecAllocator.c b/sljit_src/sljitExecAllocator.c +index 92d940dd..6359848c 100644 +--- a/sljit_src/sljitExecAllocator.c ++++ b/sljit_src/sljitExecAllocator.c +@@ -152,6 +152,9 @@ static SLJIT_INLINE void apple_update_wx_flags(sljit_s32 enable_exec) + { + #if MAC_OS_X_VERSION_MIN_REQUIRED >= 110000 + pthread_jit_write_protect_np(enable_exec); ++#elif defined(__clang__) ++ if (__builtin_available(macOS 11.0, *)) ++ pthread_jit_write_protect_np(enable_exec); + #else + #error "Must target Big Sur or newer" + #endif /* BigSur */ diff --git a/thirdparty/pcre2/src/sljit/sljitExecAllocator.c b/thirdparty/pcre2/src/sljit/sljitExecAllocator.c index 92d940ddc2..6359848cd5 100644 --- a/thirdparty/pcre2/src/sljit/sljitExecAllocator.c +++ b/thirdparty/pcre2/src/sljit/sljitExecAllocator.c @@ -152,6 +152,9 @@ static SLJIT_INLINE void apple_update_wx_flags(sljit_s32 enable_exec) { #if MAC_OS_X_VERSION_MIN_REQUIRED >= 110000 pthread_jit_write_protect_np(enable_exec); +#elif defined(__clang__) + if (__builtin_available(macOS 11.0, *)) + pthread_jit_write_protect_np(enable_exec); #else #error "Must target Big Sur or newer" #endif /* BigSur */ |