aboutsummaryrefslogtreecommitdiff
path: root/editor/plugins/navigation_mesh_generator.cpp
diff options
context:
space:
mode:
authorJuan Linietsky2017-11-25 00:07:54 -0300
committerJuan Linietsky2017-11-25 00:09:40 -0300
commitbc2e8d99e5ae0dbd69e712cc71da3033f5f30139 (patch)
treed836011e3d5873e3ceea328ea3100f3c7719ab99 /editor/plugins/navigation_mesh_generator.cpp
parent7dfba3cda9f13427f9f10a6eefbec52aef62274c (diff)
downloadgodot-bc2e8d9.tar.gz
godot-bc2e8d9.tar.zst
godot-bc2e8d9.zip
Made Vector::ptrw explicit for writing, compiler was sometimes using the wrong function,
leading to unnecesary copy on writes and reduced performance.
Diffstat (limited to '')
-rw-r--r--editor/plugins/navigation_mesh_generator.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/editor/plugins/navigation_mesh_generator.cpp b/editor/plugins/navigation_mesh_generator.cpp
index 5d50e9c85..005a132e2 100644
--- a/editor/plugins/navigation_mesh_generator.cpp
+++ b/editor/plugins/navigation_mesh_generator.cpp
@@ -189,8 +189,8 @@ void NavigationMeshGenerator::_build_recast_navigation_mesh(Ref<NavigationMesh>
ERR_FAIL_COND(tri_areas.size() == 0);
- memset(tri_areas.ptr(), 0, ntris * sizeof(unsigned char));
- rcMarkWalkableTriangles(&ctx, cfg.walkableSlopeAngle, verts, nverts, tris, ntris, tri_areas.ptr());
+ memset(tri_areas.ptrw(), 0, ntris * sizeof(unsigned char));
+ rcMarkWalkableTriangles(&ctx, cfg.walkableSlopeAngle, verts, nverts, tris, ntris, tri_areas.ptrw());
ERR_FAIL_COND(!rcRasterizeTriangles(&ctx, verts, nverts, tris, tri_areas.ptr(), ntris, *hf, cfg.walkableClimb));
}