From eb7b450c0c65388758fcec5764a759d3d347c314 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 10 Aug 2018 08:10:07 +1000 Subject: Cleanup: style --- source/blender/bmesh/intern/bmesh_mesh.c | 21 ++++++++++++--------- source/blender/bmesh/intern/bmesh_mesh.h | 8 ++++---- source/blender/bmesh/operators/bmo_bevel.c | 5 +++-- source/blender/bmesh/tools/bmesh_bevel.c | 16 ++++++++++------ source/blender/bmesh/tools/bmesh_bevel.h | 2 +- 5 files changed, 30 insertions(+), 22 deletions(-) (limited to 'source/blender/bmesh') diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c index 292453fac4b..a454fb7e948 100644 --- a/source/blender/bmesh/intern/bmesh_mesh.c +++ b/source/blender/bmesh/intern/bmesh_mesh.c @@ -1115,7 +1115,7 @@ void BM_lnorspace_invalidate(BMesh *bm, const bool do_invalidate_all) /* Note that we only handle unselected neighbor vertices here, main loop will take care of * selected ones. */ if ((!BM_elem_flag_test(l->prev->v, BM_ELEM_SELECT)) && - !BLI_BITMAP_TEST(done_verts, BM_elem_index_get(l->prev->v))) + !BLI_BITMAP_TEST(done_verts, BM_elem_index_get(l->prev->v))) { BMLoop *l_prev; @@ -1127,7 +1127,7 @@ void BM_lnorspace_invalidate(BMesh *bm, const bool do_invalidate_all) } if ((!BM_elem_flag_test(l->next->v, BM_ELEM_SELECT)) && - !BLI_BITMAP_TEST(done_verts, BM_elem_index_get(l->next->v))) + !BLI_BITMAP_TEST(done_verts, BM_elem_index_get(l->next->v))) { BMLoop *l_next; @@ -1174,8 +1174,9 @@ void BM_lnorspace_rebuild(BMesh *bm, bool preserve_clnor) short(*clnor)[2] = BM_ELEM_CD_GET_VOID_P(l, cd_loop_clnors_offset); int l_index = BM_elem_index_get(l); - BKE_lnor_space_custom_data_to_normal(bm->lnor_spacearr->lspacearr[l_index], *clnor, - oldnors[l_index]); + BKE_lnor_space_custom_data_to_normal( + bm->lnor_spacearr->lspacearr[l_index], *clnor, + oldnors[l_index]); } } } @@ -1194,8 +1195,9 @@ void BM_lnorspace_rebuild(BMesh *bm, bool preserve_clnor) if (preserve_clnor) { short(*clnor)[2] = BM_ELEM_CD_GET_VOID_P(l, cd_loop_clnors_offset); int l_index = BM_elem_index_get(l); - BKE_lnor_space_custom_normal_to_data(bm->lnor_spacearr->lspacearr[l_index], oldnors[l_index], - *clnor); + BKE_lnor_space_custom_normal_to_data( + bm->lnor_spacearr->lspacearr[l_index], oldnors[l_index], + *clnor); } BM_ELEM_API_FLAG_DISABLE(l, BM_LNORSPACE_UPDATE); } @@ -1401,9 +1403,10 @@ BMLoopNorEditDataArray *BM_loop_normal_editdata_array_init(BMesh *bm) BLI_assert(bm->spacearr_dirty == 0); - BMLoopNorEditDataArray *lnors_ed_arr = MEM_mallocN(sizeof(*lnors_ed_arr), __func__); - lnors_ed_arr->lidx_to_lnor_editdata = MEM_callocN(sizeof(*lnors_ed_arr->lidx_to_lnor_editdata) * bm->totloop, - __func__); + BMLoopNorEditDataArray *lnors_ed_arr = MEM_mallocN( + sizeof(*lnors_ed_arr), __func__); + lnors_ed_arr->lidx_to_lnor_editdata = MEM_callocN( + sizeof(*lnors_ed_arr->lidx_to_lnor_editdata) * bm->totloop, __func__); if (!CustomData_has_layer(&bm->ldata, CD_CUSTOMLOOPNORMAL)) { BM_data_layer_add(bm, &bm->ldata, CD_CUSTOMLOOPNORMAL); diff --git a/source/blender/bmesh/intern/bmesh_mesh.h b/source/blender/bmesh/intern/bmesh_mesh.h index 89077d84447..c7192590b79 100644 --- a/source/blender/bmesh/intern/bmesh_mesh.h +++ b/source/blender/bmesh/intern/bmesh_mesh.h @@ -49,10 +49,10 @@ void BM_mesh_clear(BMesh *bm); void BM_mesh_normals_update(BMesh *bm); void BM_verts_calc_normal_vcos(BMesh *bm, const float (*fnos)[3], const float (*vcos)[3], float (*vnos)[3]); void BM_loops_calc_normal_vcos( - BMesh *bm, const float(*vcos)[3], const float(*vnos)[3], const float(*pnos)[3], - const bool use_split_normals, const float split_angle, float(*r_lnos)[3], - struct MLoopNorSpaceArray *r_lnors_spacearr, short(*clnors_data)[2], - const int cd_loop_clnors_offset, const bool do_rebuild); + BMesh *bm, const float(*vcos)[3], const float(*vnos)[3], const float(*pnos)[3], + const bool use_split_normals, const float split_angle, float(*r_lnos)[3], + struct MLoopNorSpaceArray *r_lnors_spacearr, short(*clnors_data)[2], + const int cd_loop_clnors_offset, const bool do_rebuild); bool BM_loop_check_cyclic_smooth_fan(BMLoop *l_curr); void BM_lnorspacearr_store(BMesh *bm, float(*r_lnors)[3]); diff --git a/source/blender/bmesh/operators/bmo_bevel.c b/source/blender/bmesh/operators/bmo_bevel.c index eb299dbba60..8bc219d8421 100644 --- a/source/blender/bmesh/operators/bmo_bevel.c +++ b/source/blender/bmesh/operators/bmo_bevel.c @@ -66,8 +66,9 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) } } - BM_mesh_bevel(bm, offset, offset_type, seg, profile, vonly, false, clamp_overlap, NULL, -1, material, - loop_slide, mark_seam, mark_sharp, hnmode, op); + BM_mesh_bevel( + bm, offset, offset_type, seg, profile, vonly, false, clamp_overlap, NULL, -1, material, + loop_slide, mark_seam, mark_sharp, hnmode, op); BMO_slot_buffer_from_enabled_hflag(bm, op, op->slots_out, "faces.out", BM_FACE, BM_ELEM_TAG); BMO_slot_buffer_from_enabled_hflag(bm, op, op->slots_out, "edges.out", BM_EDGE, BM_ELEM_TAG); diff --git a/source/blender/bmesh/tools/bmesh_bevel.c b/source/blender/bmesh/tools/bmesh_bevel.c index 071b82afeb9..0415526574d 100644 --- a/source/blender/bmesh/tools/bmesh_bevel.c +++ b/source/blender/bmesh/tools/bmesh_bevel.c @@ -1553,28 +1553,32 @@ static void check_edge_data_seam_sharp_edges(BevVert *bv, int flag, bool neg) if ((!neg && !BEV_EXTEND_EDGE_DATA_CHECK(e, flag)) || (neg && BEV_EXTEND_EDGE_DATA_CHECK(e, flag))) return; - efirst = e; /* Set efirst to this first encountered edge*/ + /* Set efirst to this first encountered edge. */ + efirst = e; do { int flag_count = 0; EdgeHalf *ne = e->next; while (((!neg && !BEV_EXTEND_EDGE_DATA_CHECK(ne, flag)) || (neg && BEV_EXTEND_EDGE_DATA_CHECK(ne, flag))) && - ne != efirst) + ne != efirst) { if (ne->is_bev) flag_count++; ne = ne->next; } if (ne == e || (ne == efirst && ((!neg && !BEV_EXTEND_EDGE_DATA_CHECK(efirst, flag)) || - (neg && BEV_EXTEND_EDGE_DATA_CHECK(efirst, flag))))) + (neg && BEV_EXTEND_EDGE_DATA_CHECK(efirst, flag))))) { break; } - if (flag == BM_ELEM_SEAM) /* Set seam_len / sharp_len of starting edge */ + /* Set seam_len / sharp_len of starting edge */ + if (flag == BM_ELEM_SEAM) { e->rightv->seam_len = flag_count; - else if (flag == BM_ELEM_SMOOTH) + } + else if (flag == BM_ELEM_SMOOTH) { e->rightv->sharp_len = flag_count; + } e = ne; } while (e != efirst); } @@ -5635,7 +5639,7 @@ void BM_mesh_bevel( const bool vertex_only, const bool use_weights, const bool limit_offset, const struct MDeformVert *dvert, const int vertex_group, const int mat, const bool loop_slide, const bool mark_seam, const bool mark_sharp, - const int hnmode, void *mod_bmop_customdata) + const int hnmode, void *mod_bmop_customdata) { BMIter iter; BMVert *v, *v_next; diff --git a/source/blender/bmesh/tools/bmesh_bevel.h b/source/blender/bmesh/tools/bmesh_bevel.h index 5cf8b1e78bb..f8a77d431cc 100644 --- a/source/blender/bmesh/tools/bmesh_bevel.h +++ b/source/blender/bmesh/tools/bmesh_bevel.h @@ -34,6 +34,6 @@ void BM_mesh_bevel( const float profile, const bool vertex_only, const bool use_weights, const bool limit_offset, const struct MDeformVert *dvert, const int vertex_group, const int mat, const bool loop_slide, const bool mark_seam, const bool mark_sharp, - const int hnmode, void *mod_bmop_customdata); + const int hnmode, void *mod_bmop_customdata); #endif /* __BMESH_BEVEL_H__ */ -- cgit v1.2.3