diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-06-01 05:49:22 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-06-01 06:26:26 +0300 |
commit | 3a18e304be5ce6f800b997879a3c5c0fe357b330 (patch) | |
tree | 176057fae3e9e664077044c859a614a02a9eec05 /source/blender/bmesh | |
parent | 5e7fb77dc4d27df74a8e839b8a4eb7a1fe43475b (diff) |
Cleanup: remove disabled face tessellation logic
This was kept since these blocks are easier to follow.
Remove as the overall result wasn't so readable
(especially with nested ifdef's).
Replace disabled code with comment on the indices used for quads/tris.
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_polygon.c | 46 |
1 files changed, 5 insertions, 41 deletions
diff --git a/source/blender/bmesh/intern/bmesh_polygon.c b/source/blender/bmesh/intern/bmesh_polygon.c index 5e6635cc929..f1e6da9b746 100644 --- a/source/blender/bmesh/intern/bmesh_polygon.c +++ b/source/blender/bmesh/intern/bmesh_polygon.c @@ -1547,51 +1547,17 @@ void BM_mesh_calc_tessellation(BMesh *bm, BMLoop *(*looptris)[3]) BM_ITER_MESH (efa, &iter, bm, BM_FACES_OF_MESH) { BLI_assert(efa->len >= 3); - /* don't consider two-edged faces */ - if (0) { - /* do nothing (needed for else statements below) */ - } - #ifdef USE_TESSFACE_SPEEDUP - - /* no need to ensure the loop order, we know its ok */ - - else if (efa->len == 3) { -# if 0 - int j; - BM_ITER_ELEM_INDEX(l, &liter, efa, BM_LOOPS_OF_FACE, j) { - looptris[i][j] = l; - } - i += 1; -# else - /* more cryptic but faster */ + if (efa->len == 3) { + /* `0 1 2` -> `0 1 2` */ BMLoop *l; BMLoop **l_ptr = looptris[i++]; l_ptr[0] = l = BM_FACE_FIRST_LOOP(efa); l_ptr[1] = l = l->next; l_ptr[2] = l->next; -# endif } else if (efa->len == 4) { -# if 0 - BMLoop *ltmp[4]; - int j; - BLI_array_grow_items(looptris, 2); - BM_ITER_ELEM_INDEX(l, &liter, efa, BM_LOOPS_OF_FACE, j) { - ltmp[j] = l; - } - - looptris[i][0] = ltmp[0]; - looptris[i][1] = ltmp[1]; - looptris[i][2] = ltmp[2]; - i += 1; - - looptris[i][0] = ltmp[0]; - looptris[i][1] = ltmp[2]; - looptris[i][2] = ltmp[3]; - i += 1; -# else - /* more cryptic but faster */ + /* `0 1 2 3` -> (`0 1 2`, `0 2 3`) */ BMLoop *l; BMLoop **l_ptr_a = looptris[i++]; BMLoop **l_ptr_b = looptris[i++]; @@ -1599,7 +1565,6 @@ void BM_mesh_calc_tessellation(BMesh *bm, BMLoop *(*looptris)[3]) (l_ptr_a[1] = l = l->next); (l_ptr_a[2] = l_ptr_b[1] = l = l->next); (l_ptr_b[2] = l->next); -# endif if (UNLIKELY(is_quad_flip_v3_first_third_fast( l_ptr_a[0]->v->co, l_ptr_a[1]->v->co, l_ptr_a[2]->v->co, l_ptr_b[2]->v->co))) { @@ -1608,10 +1573,9 @@ void BM_mesh_calc_tessellation(BMesh *bm, BMLoop *(*looptris)[3]) l_ptr_b[0] = l_ptr_a[1]; } } - + else #endif /* USE_TESSFACE_SPEEDUP */ - - else { + { int j; BMLoop *l_iter; |