diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-12-02 12:30:03 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-12-02 12:30:29 +0300 |
commit | a5cd6a029ffc9d3e26f55ecf82da3ba5db2f63b8 (patch) | |
tree | 49f4bf8694a30e66f833f27adb57ffe185ae65eb /source/blender/bmesh | |
parent | f86fd544c1023a17e32693c7d8481d74c19e54d1 (diff) |
Cleanup: style & de-duplicate
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_polygon.c | 40 | ||||
-rw-r--r-- | source/blender/bmesh/tools/bmesh_beautify.c | 7 | ||||
-rw-r--r-- | source/blender/bmesh/tools/bmesh_beautify.h | 14 |
3 files changed, 27 insertions, 34 deletions
diff --git a/source/blender/bmesh/intern/bmesh_polygon.c b/source/blender/bmesh/intern/bmesh_polygon.c index a5a7bc5189e..4a1ab86a3fc 100644 --- a/source/blender/bmesh/intern/bmesh_polygon.c +++ b/source/blender/bmesh/intern/bmesh_polygon.c @@ -945,36 +945,26 @@ void BM_face_triangulate(BMesh *bm, BMFace *f, nf_i = 0; for (i = 0; i < edge_array_len; i++) { - BMFace *f_a, *f_b; + BMFace *f_pair[2]; BMEdge *e = edge_array[i]; + int j; #ifndef NDEBUG - const bool ok = BM_edge_face_pair(e, &f_a, &f_b); + const bool ok = BM_edge_face_pair(e, &f_pair[0], &f_pair[1]); BLI_assert(ok); #else - BM_edge_face_pair(e, &f_a, &f_b); + BM_edge_face_pair(e, &f_pair[0], &f_pair[1]); #endif - - if (FACE_USED_TEST(f_a) == false) { - FACE_USED_SET(f_a); /* set_dirty */ - - if (nf_i < edge_array_len) { - r_faces_new[nf_i++] = f_a; - } - else { - f_new = f_a; - break; - } - } - - if (FACE_USED_TEST(f_b) == false) { - FACE_USED_SET(f_b); /* set_dirty */ - - if (nf_i < edge_array_len) { - r_faces_new[nf_i++] = f_b; - } - else { - f_new = f_b; - break; + for (j = 0; j < 2; j++) { + if (FACE_USED_TEST(f_pair[j]) == false) { + FACE_USED_SET(f_pair[j]); /* set_dirty */ + + if (nf_i < edge_array_len) { + r_faces_new[nf_i++] = f_pair[j]; + } + else { + f_new = f_pair[j]; + break; + } } } } diff --git a/source/blender/bmesh/tools/bmesh_beautify.c b/source/blender/bmesh/tools/bmesh_beautify.c index 6639e767e77..a5b60268b8e 100644 --- a/source/blender/bmesh/tools/bmesh_beautify.c +++ b/source/blender/bmesh/tools/bmesh_beautify.c @@ -400,9 +400,10 @@ static void bm_edge_update_beauty_cost(BMEdge *e, Heap *eheap, HeapNode **eheap_ /** * \note This function sets the edge indices to invalid values. */ -void BM_mesh_beautify_fill(BMesh *bm, BMEdge **edge_array, const int edge_array_len, - const short flag, const short method, - const short oflag_edge, const short oflag_face) +void BM_mesh_beautify_fill( + BMesh *bm, BMEdge **edge_array, const int edge_array_len, + const short flag, const short method, + const short oflag_edge, const short oflag_face) { Heap *eheap; /* edge heap */ HeapNode **eheap_table; /* edge index aligned table pointing to the eheap */ diff --git a/source/blender/bmesh/tools/bmesh_beautify.h b/source/blender/bmesh/tools/bmesh_beautify.h index 7cc17008b50..0d6aa23b81d 100644 --- a/source/blender/bmesh/tools/bmesh_beautify.h +++ b/source/blender/bmesh/tools/bmesh_beautify.h @@ -31,12 +31,14 @@ enum { VERT_RESTRICT_TAG = (1 << 0), }; -void BM_mesh_beautify_fill(BMesh *bm, BMEdge **edge_array, const int edge_array_len, - const short flag, const short method, - const short oflag_edge, const short oflag_face); +void BM_mesh_beautify_fill( + BMesh *bm, BMEdge **edge_array, const int edge_array_len, + const short flag, const short method, + const short oflag_edge, const short oflag_face); -float BM_verts_calc_rotate_beauty(const BMVert *v1, const BMVert *v2, - const BMVert *v3, const BMVert *v4, - const short flag, const short method); +float BM_verts_calc_rotate_beauty( + const BMVert *v1, const BMVert *v2, + const BMVert *v3, const BMVert *v4, + const short flag, const short method); #endif /* __BMESH_BEAUTIFY_H__ */ |