Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-06-15 07:38:10 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-06-15 07:38:10 +0300
commit89e2b441ede8b4ef1412ad548d4df689d82f6d1c (patch)
tree214c23cc110bf4f0884bb74f6fe58f65a64702f7 /source/blender/bmesh
parentae348081145110f03825f48adbdd97b14a166af3 (diff)
Cleanup: remove return value from face normal calculation
This value is always 'sides - 2', no need to return this value.
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r--source/blender/bmesh/intern/bmesh_mesh_tessellate.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/source/blender/bmesh/intern/bmesh_mesh_tessellate.c b/source/blender/bmesh/intern/bmesh_mesh_tessellate.c
index 4092ad22ef9..ca1218c97f6 100644
--- a/source/blender/bmesh/intern/bmesh_mesh_tessellate.c
+++ b/source/blender/bmesh/intern/bmesh_mesh_tessellate.c
@@ -53,10 +53,10 @@
/**
* \param face_normal: This will be optimized out as a constant.
*/
-BLI_INLINE int mesh_calc_tessellation_for_face_impl(BMLoop *(*looptris)[3],
- BMFace *efa,
- MemArena **pf_arena_p,
- const bool face_normal)
+BLI_INLINE void mesh_calc_tessellation_for_face_impl(BMLoop *(*looptris)[3],
+ BMFace *efa,
+ MemArena **pf_arena_p,
+ const bool face_normal)
{
switch (efa->len) {
case 3: {
@@ -69,7 +69,7 @@ BLI_INLINE int mesh_calc_tessellation_for_face_impl(BMLoop *(*looptris)[3],
if (face_normal) {
normal_tri_v3(efa->no, l_ptr[0]->v->co, l_ptr[1]->v->co, l_ptr[2]->v->co);
}
- return 1;
+ break;
}
case 4: {
/* `0 1 2 3` -> (`0 1 2`, `0 2 3`) */
@@ -92,7 +92,7 @@ BLI_INLINE int mesh_calc_tessellation_for_face_impl(BMLoop *(*looptris)[3],
l_ptr_a[2] = l_ptr_b[2];
l_ptr_b[0] = l_ptr_a[1];
}
- return 2;
+ break;
}
default: {
if (face_normal) {
@@ -139,21 +139,21 @@ BLI_INLINE int mesh_calc_tessellation_for_face_impl(BMLoop *(*looptris)[3],
}
BLI_memarena_clear(pf_arena);
- return tris_len;
+ break;
}
}
}
-static int mesh_calc_tessellation_for_face(BMLoop *(*looptris)[3],
- BMFace *efa,
- MemArena **pf_arena_p)
+static void mesh_calc_tessellation_for_face(BMLoop *(*looptris)[3],
+ BMFace *efa,
+ MemArena **pf_arena_p)
{
return mesh_calc_tessellation_for_face_impl(looptris, efa, pf_arena_p, false);
}
-static int mesh_calc_tessellation_for_face_with_normal(BMLoop *(*looptris)[3],
- BMFace *efa,
- MemArena **pf_arena_p)
+static void mesh_calc_tessellation_for_face_with_normal(BMLoop *(*looptris)[3],
+ BMFace *efa,
+ MemArena **pf_arena_p)
{
return mesh_calc_tessellation_for_face_impl(looptris, efa, pf_arena_p, true);
}
@@ -182,13 +182,15 @@ static void bm_mesh_calc_tessellation__single_threaded(BMesh *bm,
BM_ITER_MESH (efa, &iter, bm, BM_FACES_OF_MESH) {
BLI_assert(efa->len >= 3);
BM_face_calc_normal(efa, efa->no);
- i += mesh_calc_tessellation_for_face_with_normal(looptris + i, efa, &pf_arena);
+ mesh_calc_tessellation_for_face_with_normal(looptris + i, efa, &pf_arena);
+ i += efa->len - 2;
}
}
else {
BM_ITER_MESH (efa, &iter, bm, BM_FACES_OF_MESH) {
BLI_assert(efa->len >= 3);
- i += mesh_calc_tessellation_for_face(looptris + i, efa, &pf_arena);
+ mesh_calc_tessellation_for_face(looptris + i, efa, &pf_arena);
+ i += efa->len - 2;
}
}