diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-01-14 20:42:43 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-01-14 20:42:43 +0400 |
commit | b27854bd47104300a484e3b06185b2cb1fa0b774 (patch) | |
tree | 3be00fa743238e3a50283f56d595d978ed36667b /source/blender/bmesh/operators | |
parent | 6cdbd1b1aaae0f8b3018ecf2648699a0ea6d6be8 (diff) |
use booleans for bmesh api.
Diffstat (limited to 'source/blender/bmesh/operators')
22 files changed, 254 insertions, 252 deletions
diff --git a/source/blender/bmesh/operators/bmo_bevel.c b/source/blender/bmesh/operators/bmo_bevel.c index eb8e84da63f..c56af821a93 100644 --- a/source/blender/bmesh/operators/bmo_bevel.c +++ b/source/blender/bmesh/operators/bmo_bevel.c @@ -34,7 +34,7 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) { const float offset = BMO_slot_float_get(op->slots_in, "offset"); const int seg = BMO_slot_int_get(op->slots_in, "segments"); - const int vonly = BMO_slot_bool_get(op->slots_in, "vertex_only"); + const bool vonly = BMO_slot_bool_get(op->slots_in, "vertex_only"); if (offset > 0) { BMOIter siter; @@ -43,7 +43,7 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) /* first flush 'geom' into flags, this makes it possible to check connected data, * BM_FACE is cleared so we can put newly created faces into a bmesh slot. */ - BM_mesh_elem_hflag_disable_all(bm, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_TAG, FALSE); + BM_mesh_elem_hflag_disable_all(bm, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_TAG, false); BMO_ITER (v, &siter, op->slots_in, "geom", BM_VERT) { BM_elem_flag_enable(v, BM_ELEM_TAG); diff --git a/source/blender/bmesh/operators/bmo_connect.c b/source/blender/bmesh/operators/bmo_connect.c index c7cd1e742d8..3a0e18b9ee5 100644 --- a/source/blender/bmesh/operators/bmo_connect.c +++ b/source/blender/bmesh/operators/bmo_connect.c @@ -106,7 +106,7 @@ void bmo_connect_verts_exec(BMesh *bm, BMOperator *op) } for (i = 0; i < BLI_array_count(verts_pair); i++) { - nf = BM_face_split(bm, f, verts_pair[i][0], verts_pair[i][1], &nl, NULL, FALSE); + nf = BM_face_split(bm, f, verts_pair[i][0], verts_pair[i][1], &nl, NULL, false); f = nf; if (!nl || !nf) { @@ -221,7 +221,7 @@ void bmo_bridge_loops_exec(BMesh *bm, BMOperator *op) int c = 0, cl1 = 0, cl2 = 0; /* merge-bridge support */ - const int use_merge = BMO_slot_bool_get(op->slots_in, "use_merge"); + const bool use_merge = BMO_slot_bool_get(op->slots_in, "use_merge"); const float merge_factor = BMO_slot_float_get(op->slots_in, "merge_factor"); BMO_slot_buffer_flag_enable(bm, op->slots_in, "edges", BM_EDGE, EDGE_MARK); @@ -508,7 +508,7 @@ void bmo_bridge_loops_exec(BMesh *bm, BMOperator *op) vv2[i2], vv2[i2next], vv1[i1next], - f_example, TRUE); + f_example, true); if (UNLIKELY((f == NULL) || (f->len != 4))) { fprintf(stderr, "%s: in bridge! (bmesh internal error)\n", __func__); } diff --git a/source/blender/bmesh/operators/bmo_create.c b/source/blender/bmesh/operators/bmo_create.c index 2ea5914ca92..ae07c2cf0bc 100644 --- a/source/blender/bmesh/operators/bmo_create.c +++ b/source/blender/bmesh/operators/bmo_create.c @@ -87,8 +87,8 @@ BLI_INLINE BMDiskLink *rs_edge_link_get(BMEdge *e, BMVert *v, EdgeData *e_data) &(((EdgeData *)e_data)->v2_disk_link); } -static int rotsys_append_edge(BMEdge *e, BMVert *v, - EdgeData *edata, VertData *vdata) +static bool rotsys_append_edge(BMEdge *e, BMVert *v, + EdgeData *edata, VertData *vdata) { EdgeData *ed = &edata[BM_elem_index_get(e)]; VertData *vd = &vdata[BM_elem_index_get(v)]; @@ -116,7 +116,7 @@ static int rotsys_append_edge(BMEdge *e, BMVert *v, } } - return TRUE; + return true; } static void UNUSED_FUNCTION(rotsys_remove_edge)(BMEdge *e, BMVert *v, @@ -613,10 +613,10 @@ static void init_rotsys(BMesh *bm, EdgeData *edata, VertData *vdata) BM_elem_index_set(v2, -1); /* set_dirty! */ //BM_edge_create(bm, cv, v2, NULL, 0); - BM_vert_select_set(bm, v2, TRUE); + BM_vert_select_set(bm, v2, true); if (lastv) { e2 = BM_edge_create(bm, lastv, v2, NULL, 0); - BM_edge_select_set(bm, e2, TRUE); + BM_edge_select_set(bm, e2, true); } lastv = v2; @@ -742,7 +742,7 @@ static EPath *edge_find_shortest_path(BMesh *bm, BMOperator *op, BMEdge *edge, E BMVert *endv; EPathNode *node; int i; - const int use_restrict = BMO_slot_bool_get(op->slots_in, "use_restrict"); + const bool use_restrict = BMO_slot_bool_get(op->slots_in, "use_restrict"); BMOpSlot *slot_restrict = BMO_slot_get(op->slots_in, "restrict"); @@ -899,10 +899,10 @@ void bmo_edgenet_fill_exec(BMesh *bm, BMOperator *op) BMEdge **edges = NULL; PathBase *pathbase; BLI_array_declare(edges); - int use_restrict = BMO_slot_bool_get(op->slots_in, "use_restrict"); - int use_fill_check = BMO_slot_bool_get(op->slots_in, "use_fill_check"); - const short mat_nr = BMO_slot_int_get(op->slots_in, "mat_nr"); - const short use_smooth = BMO_slot_bool_get(op->slots_in, "use_smooth"); + const bool use_restrict = BMO_slot_bool_get(op->slots_in, "use_restrict"); + const bool use_fill_check = BMO_slot_bool_get(op->slots_in, "use_fill_check"); + const short mat_nr = BMO_slot_int_get(op->slots_in, "mat_nr"); + const bool use_smooth = BMO_slot_bool_get(op->slots_in, "use_smooth"); int i, j, group = 0; unsigned int winding[2]; /* accumulte winding directions for each edge which has a face */ BMOpSlot *slot_restrict = BMO_slot_get(op->slots_in, "restrict"); @@ -1047,9 +1047,9 @@ void bmo_edgenet_fill_exec(BMesh *bm, BMOperator *op) v2 = verts[0]; } - if ((use_fill_check == FALSE) || + if ((use_fill_check == false) || /* fairly expensive check - see if there are already faces filling this area */ - (BM_face_exists_multi_edge(edges, i) == FALSE)) + (BM_face_exists_multi_edge(edges, i) == false)) { f = BM_face_create_ngon(bm, v1, v2, edges, i, BM_CREATE_NO_DOUBLE); if (f && !BMO_elem_flag_test(bm, f, ELE_ORIG)) { @@ -1287,7 +1287,7 @@ void bmo_contextual_create_exec(BMesh *bm, BMOperator *op) BMFace *f; int totv = 0, tote = 0, totf = 0, amount; const short mat_nr = BMO_slot_int_get(op->slots_in, "mat_nr"); - const short use_smooth = BMO_slot_bool_get(op->slots_in, "use_smooth"); + const bool use_smooth = BMO_slot_bool_get(op->slots_in, "use_smooth"); /* count number of each element type we were passe */ BMO_ITER (h, &oiter, op->slots_in, "geom", BM_VERT | BM_EDGE | BM_FACE) { @@ -1321,7 +1321,7 @@ void bmo_contextual_create_exec(BMesh *bm, BMOperator *op) if (totf == 0 && totv >= 4 && totv == tote + 2) { /* find a free standing vertex and 2 endpoint verts */ BMVert *v_free = NULL, *v_a = NULL, *v_b = NULL; - int ok = TRUE; + bool ok = true; BMO_ITER (v, &oiter, op->slots_in, "geom", BM_VERT) { @@ -1339,26 +1339,26 @@ void bmo_contextual_create_exec(BMesh *bm, BMOperator *op) if (tot_edges == 0) { /* only accept 1 free vert */ if (v_free == NULL) v_free = v; - else ok = FALSE; /* only ever want one of these */ + else ok = false; /* only ever want one of these */ } else if (tot_edges == 1) { if (v_a == NULL) v_a = v; else if (v_b == NULL) v_b = v; - else ok = FALSE; /* only ever want 2 of these */ + else ok = false; /* only ever want 2 of these */ } else if (tot_edges == 2) { /* do nothing, regular case */ } else { - ok = FALSE; /* if a vertex has 3+ edge users then cancel - this is only simple cases */ + ok = false; /* if a vertex has 3+ edge users then cancel - this is only simple cases */ } - if (ok == FALSE) { + if (ok == false) { break; } } - if (ok == TRUE && v_free && v_a && v_b) { + if (ok == true && v_free && v_a && v_b) { e = BM_edge_create(bm, v_free, v_a, NULL, BM_CREATE_NO_DOUBLE); BMO_elem_flag_enable(bm, e, ELE_NEW); @@ -1377,7 +1377,7 @@ void bmo_contextual_create_exec(BMesh *bm, BMOperator *op) BMO_op_initf(bm, &op2, op->flag, "edgenet_fill edges=%fe use_fill_check=%b mat_nr=%i use_smooth=%b", - ELE_NEW, TRUE, mat_nr, use_smooth); + ELE_NEW, true, mat_nr, use_smooth); BMO_op_exec(bm, &op2); diff --git a/source/blender/bmesh/operators/bmo_dissolve.c b/source/blender/bmesh/operators/bmo_dissolve.c index d23c6d7332a..47b2497816f 100644 --- a/source/blender/bmesh/operators/bmo_dissolve.c +++ b/source/blender/bmesh/operators/bmo_dissolve.c @@ -41,7 +41,7 @@ #define VERT_MARK 1 -static int UNUSED_FUNCTION(check_hole_in_region) (BMesh * bm, BMFace * f) +static bool UNUSED_FUNCTION(check_hole_in_region) (BMesh * bm, BMFace * f) { BMWalker regwalker; BMIter liter2; @@ -62,14 +62,14 @@ static int UNUSED_FUNCTION(check_hole_in_region) (BMesh * bm, BMFace * f) BMO_elem_flag_test(bm, l2->f, FACE_MARK)) { if (!BMO_elem_flag_test(bm, l2->e, EDGE_MARK)) { - return FALSE; + return false; } } } } BMW_end(®walker); - return TRUE; + return true; } void bmo_dissolve_faces_exec(BMesh *bm, BMOperator *op) @@ -83,7 +83,7 @@ void bmo_dissolve_faces_exec(BMesh *bm, BMOperator *op) BMWalker regwalker; int i; - int use_verts = BMO_slot_bool_get(op->slots_in, "use_verts"); + const bool use_verts = BMO_slot_bool_get(op->slots_in, "use_verts"); if (use_verts) { /* tag verts that start out with only 2 edges, @@ -147,7 +147,7 @@ void bmo_dissolve_faces_exec(BMesh *bm, BMOperator *op) while (faces[tot]) tot++; - f = BM_faces_join(bm, faces, tot, TRUE); + f = BM_faces_join(bm, faces, tot, true); if (!f) { BMO_error_raise(bm, op, BMERR_DISSOLVEFACES_FAILED, "Could not create merged face"); @@ -171,7 +171,7 @@ void bmo_dissolve_faces_exec(BMesh *bm, BMOperator *op) BM_ITER_MESH (v, &viter, bm, BM_VERTS_OF_MESH) { if (BMO_elem_flag_test(bm, v, VERT_MARK)) { if (BM_vert_edge_count(v) == 2) { - BM_vert_collapse_edge(bm, v->e, v, TRUE); + BM_vert_collapse_edge(bm, v->e, v, true); } } } @@ -212,7 +212,7 @@ void bmo_dissolve_edgeloop_exec(BMesh *bm, BMOperator *op) /* BMESH_TODO - check on delaying edge removal since we may end up removing more then * one edge, and later reference a removed edge */ - BM_faces_join_pair(bm, fa, fb, e, TRUE); + BM_faces_join_pair(bm, fa, fb, e, true); } } @@ -225,7 +225,7 @@ void bmo_dissolve_edgeloop_exec(BMesh *bm, BMOperator *op) /* clean up extreneous 2-valence vertice */ for (i = 0; i < BLI_array_count(verts); i++) { if (verts[i]->e) { - BM_vert_collapse_edge(bm, verts[i]->e, verts[i], TRUE); + BM_vert_collapse_edge(bm, verts[i]->e, verts[i], true); } } @@ -251,7 +251,7 @@ void bmo_dissolve_edges_exec(BMesh *bm, BMOperator *op) BMIter viter; BMVert *v; - int use_verts = BMO_slot_bool_get(op->slots_in, "use_verts"); + const bool use_verts = BMO_slot_bool_get(op->slots_in, "use_verts"); if (use_verts) { BM_ITER_MESH (v, &viter, bm, BM_VERTS_OF_MESH) { @@ -268,7 +268,7 @@ void bmo_dissolve_edges_exec(BMesh *bm, BMOperator *op) /* BMESH_TODO - check on delaying edge removal since we may end up removing more then * one edge, and later reference a removed edge */ - BM_faces_join_pair(bm, fa, fb, e, TRUE); + BM_faces_join_pair(bm, fa, fb, e, true); } } @@ -276,20 +276,20 @@ void bmo_dissolve_edges_exec(BMesh *bm, BMOperator *op) BM_ITER_MESH (v, &viter, bm, BM_VERTS_OF_MESH) { if (BMO_elem_flag_test(bm, v, VERT_MARK)) { if (BM_vert_edge_count(v) == 2) { - BM_vert_collapse_edge(bm, v->e, v, TRUE); + BM_vert_collapse_edge(bm, v->e, v, true); } } } } } -static int test_extra_verts(BMesh *bm, BMVert *v) +static bool test_extra_verts(BMesh *bm, BMVert *v) { BMIter iter, liter, iter2, iter3; BMFace *f, *f2; BMLoop *l; BMEdge *e; - int found; + bool found; /* test faces around verts for verts that would be wrongly killed * by dissolve faces. */ @@ -302,31 +302,31 @@ static int test_extra_verts(BMesh *bm, BMVert *v) * then dissolve faces won't destroy it. * also if it forms a boundary with one * of the face region */ - found = FALSE; + found = false; e = BM_iter_new(&iter2, bm, BM_EDGES_OF_VERT, l->v); for ( ; e; e = BM_iter_step(&iter2)) { if (BM_edge_is_boundary(e)) { - found = TRUE; + found = true; } f2 = BM_iter_new(&iter3, bm, BM_FACES_OF_EDGE, e); for ( ; f2; f2 = BM_iter_step(&iter3)) { if (!BMO_elem_flag_test(bm, f2, FACE_MARK)) { - found = TRUE; + found = true; break; } } - if (found == TRUE) { + if (found == true) { break; } } - if (found == FALSE) { - return FALSE; + if (found == false) { + return false; } } } } - return TRUE; + return true; } void bmo_dissolve_verts_exec(BMesh *bm, BMOperator *op) { @@ -346,9 +346,9 @@ void bmo_dissolve_verts_exec(BMesh *bm, BMOperator *op) /* previously the faces were joined, but collapsing between 2 edges * gives some advantage/difference in using vertex-dissolve over edge-dissolve */ #if 0 - BM_vert_collapse_faces(bm, v->e, v, 1.0f, TRUE, TRUE); + BM_vert_collapse_faces(bm, v->e, v, 1.0f, true, true); #else - BM_vert_collapse_edge(bm, v->e, v, TRUE); + BM_vert_collapse_edge(bm, v->e, v, true); #endif continue; @@ -480,7 +480,7 @@ void bmo_dissolve_limit_exec(BMesh *bm, BMOperator *op) BMOpSlot *vinput = BMO_slot_get(op->slots_in, "verts"); const float angle_max = (float)M_PI / 2.0f; const float angle_limit = min_ff(angle_max, BMO_slot_float_get(op->slots_in, "angle_limit")); - const int do_dissolve_boundaries = BMO_slot_bool_get(op->slots_in, "use_dissolve_boundaries"); + const bool do_dissolve_boundaries = BMO_slot_bool_get(op->slots_in, "use_dissolve_boundaries"); BM_mesh_decimate_dissolve_ex(bm, angle_limit, do_dissolve_boundaries, (BMVert **)BMO_SLOT_AS_BUFFER(vinput), vinput->len, diff --git a/source/blender/bmesh/operators/bmo_dupe.c b/source/blender/bmesh/operators/bmo_dupe.c index f288901c272..1448129ccde 100644 --- a/source/blender/bmesh/operators/bmo_dupe.c +++ b/source/blender/bmesh/operators/bmo_dupe.c @@ -213,13 +213,13 @@ static void bmo_mesh_copy(BMOperator *op, BMesh *bm_src, BMesh *bm_dst) !BMO_elem_flag_test(bm_src, v, DUPE_DONE)) { BMIter iter; - int isolated = 1; + bool isolated = true; v2 = copy_vertex(bm_src, v, bm_dst, vhash); BM_ITER_ELEM (f, &iter, v, BM_FACES_OF_VERT) { if (BMO_elem_flag_test(bm_src, f, DUPE_INPUT)) { - isolated = 0; + isolated = false; break; } } @@ -227,7 +227,7 @@ static void bmo_mesh_copy(BMOperator *op, BMesh *bm_src, BMesh *bm_dst) if (isolated) { BM_ITER_ELEM (e, &iter, v, BM_EDGES_OF_VERT) { if (BMO_elem_flag_test(bm_src, e, DUPE_INPUT)) { - isolated = 0; + isolated = false; break; } } @@ -386,7 +386,7 @@ void bmo_split_exec(BMesh *bm, BMOperator *op) BMOperator *splitop = op; BMOperator dupeop; BMOperator delop; - const short use_only_faces = BMO_slot_bool_get(op->slots_in, "use_only_faces"); + const bool use_only_faces = BMO_slot_bool_get(op->slots_in, "use_only_faces"); /* initialize our sub-operator */ BMO_op_init(bm, &dupeop, op->flag, "duplicate"); diff --git a/source/blender/bmesh/operators/bmo_edgesplit.c b/source/blender/bmesh/operators/bmo_edgesplit.c index b4b50a60877..378f790ef32 100644 --- a/source/blender/bmesh/operators/bmo_edgesplit.c +++ b/source/blender/bmesh/operators/bmo_edgesplit.c @@ -37,17 +37,17 @@ /* keep this operator fast, its used in a modifier */ void bmo_split_edges_exec(BMesh *bm, BMOperator *op) { - const int use_verts = BMO_slot_bool_get(op->slots_in, "use_verts"); + const bool use_verts = BMO_slot_bool_get(op->slots_in, "use_verts"); - BMO_slot_buffer_hflag_enable(bm, op->slots_in, "edges", BM_EDGE, BM_ELEM_TAG, FALSE); + BMO_slot_buffer_hflag_enable(bm, op->slots_in, "edges", BM_EDGE, BM_ELEM_TAG, false); if (use_verts) { /* this slows down the operation but its ok because the modifier doesn't use */ - BMO_slot_buffer_hflag_enable(bm, op->slots_in, "verts", BM_VERT, BM_ELEM_TAG, FALSE); + BMO_slot_buffer_hflag_enable(bm, op->slots_in, "verts", BM_VERT, BM_ELEM_TAG, false); } /* this is where everything happens */ - BM_mesh_edgesplit(bm, use_verts, TRUE); + BM_mesh_edgesplit(bm, use_verts, true); BMO_slot_buffer_from_enabled_hflag(bm, op, op->slots_out, "edges.out", BM_EDGE, BM_ELEM_INTERNAL_TAG); } diff --git a/source/blender/bmesh/operators/bmo_extrude.c b/source/blender/bmesh/operators/bmo_extrude.c index 2cca3fcb24a..4fde6150f05 100644 --- a/source/blender/bmesh/operators/bmo_extrude.c +++ b/source/blender/bmesh/operators/bmo_extrude.c @@ -112,7 +112,7 @@ void bmo_extrude_discrete_faces_exec(BMesh *bm, BMOperator *op) l3 = l->next; l4 = l2->next; - f3 = BM_face_create_quad_tri(bm, l3->v, l4->v, l2->v, l->v, f, FALSE); + f3 = BM_face_create_quad_tri(bm, l3->v, l4->v, l2->v, l->v, f, false); /* XXX, no error check here, why? - Campbell */ l_tmp = BM_FACE_FIRST_LOOP(f3); @@ -225,7 +225,7 @@ void bmo_extrude_edge_only_exec(BMesh *bm, BMOperator *op) f_verts[3] = e_new->v2; } /* not sure what to do about example face, pass NULL for now */ - f = BM_face_create_quad_tri_v(bm, f_verts, 4, NULL, FALSE); + f = BM_face_create_quad_tri_v(bm, f_verts, 4, NULL, false); bm_extrude_copy_face_loop_attributes(bm, f); if (BMO_elem_flag_test(bm, e, EXT_INPUT)) @@ -248,7 +248,7 @@ void bmo_extrude_vert_indiv_exec(BMesh *bm, BMOperator *op) BMOIter siter; BMVert *v, *dupev; BMEdge *e; - const int has_vskin = CustomData_has_layer(&bm->vdata, CD_MVERT_SKIN); + const bool has_vskin = CustomData_has_layer(&bm->vdata, CD_MVERT_SKIN); for (v = BMO_iter_new(&siter, op->slots_in, "verts", BM_VERT); v; v = BMO_iter_step(&siter)) { dupev = BM_vert_create(bm, v->co, v, 0); @@ -273,7 +273,7 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op) BMEdge *e, *e_new; BMVert *v, *v2; BMFace *f; - int found, fwd, delorig = FALSE; + bool found, fwd, delorig = false; BMOpSlot *slot_facemap_out; BMOpSlot *slot_edges_exclude; @@ -293,20 +293,20 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op) continue; } - found = FALSE; /* found a face that isn't input? */ + found = false; /* found a face that isn't input? */ edge_face_tot = 0; /* edge/face count */ BM_ITER_ELEM (f, &fiter, e, BM_FACES_OF_EDGE) { if (!BMO_elem_flag_test(bm, f, EXT_INPUT)) { - found = TRUE; - delorig = TRUE; + found = true; + delorig = true; break; } edge_face_tot++; } - if ((edge_face_tot > 1) && (found == FALSE)) { + if ((edge_face_tot > 1) && (found == false)) { /* edge has a face user, that face isn't extrude input */ BMO_elem_flag_enable(bm, e, EXT_DEL); } @@ -316,26 +316,26 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op) /* calculate verts to delete */ BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) { if (v->e) { /* only deal with verts attached to geometry [#33651] */ - found = FALSE; + found = false; BM_ITER_ELEM (e, &viter, v, BM_EDGES_OF_VERT) { if (!BMO_elem_flag_test(bm, e, EXT_INPUT) || !BMO_elem_flag_test(bm, e, EXT_DEL)) { - found = TRUE; + found = true; break; } } /* avoid an extra loop */ - if (found == TRUE) { + if (found == true) { BM_ITER_ELEM (f, &viter, v, BM_FACES_OF_VERT) { if (!BMO_elem_flag_test(bm, f, EXT_INPUT)) { - found = TRUE; + found = true; break; } } } - if (found == FALSE) { + if (found == false) { BMO_elem_flag_enable(bm, v, EXT_DEL); } } @@ -347,7 +347,7 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op) } } - if (delorig == TRUE) { + if (delorig == true) { BMO_op_initf(bm, &delop, op->flag, "delete geom=%fvef context=%i", EXT_DEL, DEL_ONLYTAGGED); @@ -435,7 +435,7 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op) } /* not sure what to do about example face, pass NULL for now */ - f = BM_face_create_quad_tri_v(bm, f_verts, 4, NULL, FALSE); + f = BM_face_create_quad_tri_v(bm, f_verts, 4, NULL, false); bm_extrude_copy_face_loop_attributes(bm, f); } @@ -665,7 +665,7 @@ void bmo_solidify_face_region_exec(BMesh *bm, BMOperator *op) BMO_op_finish(bm, &reverseop); /* Extrude the region */ - BMO_op_initf(bm, &extrudeop, op->flag, "extrude_face_region use_keep_orig=%b", TRUE); + BMO_op_initf(bm, &extrudeop, op->flag, "extrude_face_region use_keep_orig=%b", true); BMO_slot_copy(op, slots_in, "geom", &extrudeop, slots_in, "geom"); BMO_op_exec(bm, &extrudeop); diff --git a/source/blender/bmesh/operators/bmo_hull.c b/source/blender/bmesh/operators/bmo_hull.c index e2da4f4f89c..5d8689b9da6 100644 --- a/source/blender/bmesh/operators/bmo_hull.c +++ b/source/blender/bmesh/operators/bmo_hull.c @@ -136,12 +136,12 @@ static void hull_output_triangles(BMesh *bm, GHash *hull_triangles) } /* Create new hull face */ - f = BM_face_create_quad_tri_v(bm, t->v, 3, example, TRUE); + f = BM_face_create_quad_tri_v(bm, t->v, 3, example, true); BM_face_copy_shared(bm, f); } /* Mark face for 'geom.out' slot and select */ BMO_elem_flag_enable(bm, f, HULL_FLAG_OUTPUT_GEOM); - BM_face_select_set(bm, f, TRUE); + BM_face_select_set(bm, f, true); /* Mark edges for 'geom.out' slot */ for (i = 0; i < 3; i++) { @@ -200,7 +200,7 @@ static int hull_final_edges_lookup(HullFinalEdges *final_edges, adj = BLI_ghash_lookup(final_edges->edges, v1); if (!adj) - return FALSE; + return false; return !!final_edges_find_link(adj, v2); } @@ -268,17 +268,17 @@ static void hull_remove_overlapping(BMesh *bm, GHash *hull_triangles, HullTriangle *t = BLI_ghashIterator_getKey(&hull_iter); BMIter bm_iter1, bm_iter2; BMFace *f; - int f_on_hull; + bool f_on_hull; BM_ITER_ELEM (f, &bm_iter1, t->v[0], BM_FACES_OF_VERT) { BMEdge *e; /* Check that all the face's edges are on the hull, * otherwise can't reuse it */ - f_on_hull = TRUE; + f_on_hull = true; BM_ITER_ELEM (e, &bm_iter2, f, BM_EDGES_OF_FACE) { if (!hull_final_edges_lookup(final_edges, e->v1, e->v2)) { - f_on_hull = FALSE; + f_on_hull = false; break; } } @@ -288,7 +288,7 @@ static void hull_remove_overlapping(BMesh *bm, GHash *hull_triangles, if (BM_vert_in_face(f, t->v[1]) && BM_vert_in_face(f, t->v[2]) && f_on_hull) { - t->skip = TRUE; + t->skip = true; BMO_elem_flag_disable(bm, f, HULL_FLAG_INTERIOR_ELE); BMO_elem_flag_enable(bm, f, HULL_FLAG_HOLE); } @@ -330,18 +330,18 @@ static void hull_tag_unused(BMesh *bm, BMOperator *op) * input set */ BMO_ITER (v, &oiter, op->slots_in, "input", BM_VERT) { if (BMO_elem_flag_test(bm, v, HULL_FLAG_INTERIOR_ELE)) { - int del = TRUE; + bool del = true; BM_ITER_ELEM (e, &iter, v, BM_EDGES_OF_VERT) { if (!BMO_elem_flag_test(bm, e, HULL_FLAG_INPUT)) { - del = FALSE; + del = false; break; } } BM_ITER_ELEM (f, &iter, v, BM_FACES_OF_VERT) { if (!BMO_elem_flag_test(bm, f, HULL_FLAG_INPUT)) { - del = FALSE; + del = false; break; } } @@ -353,11 +353,11 @@ static void hull_tag_unused(BMesh *bm, BMOperator *op) BMO_ITER (e, &oiter, op->slots_in, "input", BM_EDGE) { if (BMO_elem_flag_test(bm, e, HULL_FLAG_INTERIOR_ELE)) { - int del = TRUE; + bool del = true; BM_ITER_ELEM (f, &iter, e, BM_FACES_OF_EDGE) { if (!BMO_elem_flag_test(bm, f, HULL_FLAG_INPUT)) { - del = FALSE; + del = false; break; } } @@ -396,13 +396,13 @@ static void hull_tag_holes(BMesh *bm, BMOperator *op) /* Mark edges too if all adjacent faces are holes and the edge is * not already isolated */ BMO_ITER (e, &oiter, op->slots_in, "input", BM_EDGE) { - int hole = TRUE; - int any_faces = FALSE; + bool hole = true; + bool any_faces = false; BM_ITER_ELEM (f, &iter, e, BM_FACES_OF_EDGE) { - any_faces = TRUE; + any_faces = true; if (!BMO_elem_flag_test(bm, f, HULL_FLAG_HOLE)) { - hole = FALSE; + hole = false; break; } } diff --git a/source/blender/bmesh/operators/bmo_inset.c b/source/blender/bmesh/operators/bmo_inset.c index cef1181f63b..ef99dae5ac9 100644 --- a/source/blender/bmesh/operators/bmo_inset.c +++ b/source/blender/bmesh/operators/bmo_inset.c @@ -92,13 +92,13 @@ static BMLoop *bm_edge_is_mixed_face_tag(BMLoop *l) void bmo_inset_exec(BMesh *bm, BMOperator *op) { - const int use_outset = BMO_slot_bool_get(op->slots_in, "use_outset"); - const int use_boundary = BMO_slot_bool_get(op->slots_in, "use_boundary") && (use_outset == FALSE); - const int use_even_offset = BMO_slot_bool_get(op->slots_in, "use_even_offset"); - const int use_even_boundry = use_even_offset; /* could make own option */ - const int use_relative_offset = BMO_slot_bool_get(op->slots_in, "use_relative_offset"); - const float thickness = BMO_slot_float_get(op->slots_in, "thickness"); - const float depth = BMO_slot_float_get(op->slots_in, "depth"); + const bool use_outset = BMO_slot_bool_get(op->slots_in, "use_outset"); + const bool use_boundary = BMO_slot_bool_get(op->slots_in, "use_boundary") && (use_outset == false); + const bool use_even_offset = BMO_slot_bool_get(op->slots_in, "use_even_offset"); + const bool use_even_boundry = use_even_offset; /* could make own option */ + const bool use_relative_offset = BMO_slot_bool_get(op->slots_in, "use_relative_offset"); + const float thickness = BMO_slot_float_get(op->slots_in, "thickness"); + const float depth = BMO_slot_float_get(op->slots_in, "depth"); int edge_info_len = 0; @@ -111,13 +111,13 @@ void bmo_inset_exec(BMesh *bm, BMOperator *op) BMFace *f; int i, j, k; - if (use_outset == FALSE) { - BM_mesh_elem_hflag_disable_all(bm, BM_FACE, BM_ELEM_TAG, FALSE); - BMO_slot_buffer_hflag_enable(bm, op->slots_in, "faces", BM_FACE, BM_ELEM_TAG, FALSE); + if (use_outset == false) { + BM_mesh_elem_hflag_disable_all(bm, BM_FACE, BM_ELEM_TAG, false); + BMO_slot_buffer_hflag_enable(bm, op->slots_in, "faces", BM_FACE, BM_ELEM_TAG, false); } else { - BM_mesh_elem_hflag_enable_all(bm, BM_FACE, BM_ELEM_TAG, FALSE); - BMO_slot_buffer_hflag_disable(bm, op->slots_in, "faces", BM_FACE, BM_ELEM_TAG, FALSE); + BM_mesh_elem_hflag_enable_all(bm, BM_FACE, BM_ELEM_TAG, false); + BMO_slot_buffer_hflag_disable(bm, op->slots_in, "faces", BM_FACE, BM_ELEM_TAG, false); } /* first count all inset edges we will split */ @@ -411,11 +411,11 @@ void bmo_inset_exec(BMesh *bm, BMOperator *op) /* this saves expensive/slow glue check for common cases */ if (r_vout_len > 2) { - int ok = TRUE; + bool ok = true; /* last step, NULL this vertex if has a tagged face */ BM_ITER_ELEM (f, &iter, v_split, BM_FACES_OF_VERT) { if (BM_elem_flag_test(f, BM_ELEM_TAG)) { - ok = FALSE; + ok = false; break; } } @@ -471,7 +471,7 @@ void bmo_inset_exec(BMesh *bm, BMOperator *op) #endif /* no need to check doubles, we KNOW there won't be any */ /* yes - reverse face is correct in this case */ - f = BM_face_create_quad_tri_v(bm, varr, j, es->l->f, FALSE); + f = BM_face_create_quad_tri_v(bm, varr, j, es->l->f, false); BMO_elem_flag_enable(bm, f, ELE_NEW); /* copy for loop data, otherwise UV's and vcols are no good. @@ -548,7 +548,7 @@ void bmo_inset_exec(BMesh *bm, BMOperator *op) /* done correcting edge verts normals */ /* untag verts */ - BM_mesh_elem_hflag_disable_all(bm, BM_VERT, BM_ELEM_TAG, FALSE); + BM_mesh_elem_hflag_disable_all(bm, BM_VERT, BM_ELEM_TAG, false); /* tag face verts */ BMO_ITER (f, &oiter, op->slots_in, "faces", BM_FACE) { diff --git a/source/blender/bmesh/operators/bmo_join_triangles.c b/source/blender/bmesh/operators/bmo_join_triangles.c index 45ecdee014e..e052968a6a0 100644 --- a/source/blender/bmesh/operators/bmo_join_triangles.c +++ b/source/blender/bmesh/operators/bmo_join_triangles.c @@ -105,7 +105,7 @@ static float measure_facepair(BMVert *v1, BMVert *v2, #define T2QUV_LIMIT 0.005f #define T2QCOL_LIMIT 3 -static int bm_edge_faces_cmp(BMesh *bm, BMEdge *e, const int do_uv, const int do_tf, const int do_vcol) +static bool bm_edge_faces_cmp(BMesh *bm, BMEdge *e, const bool do_uv, const bool do_tf, const bool do_vcol) { /* first get loops */ BMLoop *l[4]; @@ -138,7 +138,7 @@ static int bm_edge_faces_cmp(BMesh *bm, BMEdge *e, const int do_uv, const int do if (luv[0] && (!compare_v2v2(luv[0]->uv, luv[2]->uv, T2QUV_LIMIT) || !compare_v2v2(luv[1]->uv, luv[3]->uv, T2QUV_LIMIT))) { - return FALSE; + return false; } } @@ -149,7 +149,7 @@ static int bm_edge_faces_cmp(BMesh *bm, BMEdge *e, const int do_uv, const int do }; if (tp[0] && (tp[0]->tpage != tp[1]->tpage)) { - return FALSE; + return false; } } @@ -166,12 +166,12 @@ static int bm_edge_faces_cmp(BMesh *bm, BMEdge *e, const int do_uv, const int do if (!compare_rgb_uchar((unsigned char *)&lcol[0]->r, (unsigned char *)&lcol[2]->r, T2QCOL_LIMIT) || !compare_rgb_uchar((unsigned char *)&lcol[1]->r, (unsigned char *)&lcol[3]->r, T2QCOL_LIMIT)) { - return FALSE; + return false; } } } - return TRUE; + return true; } typedef struct JoinEdge { @@ -197,6 +197,13 @@ static int fplcmp(const void *v1, const void *v2) void bmo_join_triangles_exec(BMesh *bm, BMOperator *op) { + const bool do_sharp = BMO_slot_bool_get(op->slots_in, "cmp_sharp"); + const bool do_uv = BMO_slot_bool_get(op->slots_in, "cmp_uvs"); + const bool do_tf = do_uv; /* texture face, make make its own option eventually */ + const bool do_vcol = BMO_slot_bool_get(op->slots_in, "cmp_vcols"); + const bool do_mat = BMO_slot_bool_get(op->slots_in, "cmp_materials"); + const float limit = BMO_slot_float_get(op->slots_in, "limit"); + BMIter iter, liter; BMOIter siter; BMFace *f; @@ -204,12 +211,6 @@ void bmo_join_triangles_exec(BMesh *bm, BMOperator *op) BMEdge *e; BLI_array_declare(jedges); JoinEdge *jedges = NULL; - int do_sharp = BMO_slot_bool_get(op->slots_in, "cmp_sharp"); - int do_uv = BMO_slot_bool_get(op->slots_in, "cmp_uvs"); - int do_tf = do_uv; /* texture face, make make its own option eventually */ - int do_vcol = BMO_slot_bool_get(op->slots_in, "cmp_vcols"); - int do_mat = BMO_slot_bool_get(op->slots_in, "cmp_materials"); - float limit = BMO_slot_float_get(op->slots_in, "limit"); int i, totedge; /* flag all edges of all input face */ @@ -265,7 +266,7 @@ void bmo_join_triangles_exec(BMesh *bm, BMOperator *op) if (do_mat && f1->mat_nr != f2->mat_nr) continue; - if ((do_uv || do_tf || do_vcol) && (bm_edge_faces_cmp(bm, e, do_uv, do_tf, do_vcol) == FALSE)) + if ((do_uv || do_tf || do_vcol) && (bm_edge_faces_cmp(bm, e, do_uv, do_tf, do_vcol) == false)) continue; measure = measure_facepair(v1, v2, v3, v4, limit); @@ -308,7 +309,7 @@ void bmo_join_triangles_exec(BMesh *bm, BMOperator *op) BM_edge_face_pair(e, &f1, &f2); /* checked above */ - BM_faces_join_pair(bm, f1, f2, e, TRUE); + BM_faces_join_pair(bm, f1, f2, e, true); } BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) { @@ -342,7 +343,7 @@ void bmo_join_triangles_exec(BMesh *bm, BMOperator *op) continue; } - BM_faces_join_pair(bm, f1, f2, e, TRUE); + BM_faces_join_pair(bm, f1, f2, e, true); } } diff --git a/source/blender/bmesh/operators/bmo_mesh_conv.c b/source/blender/bmesh/operators/bmo_mesh_conv.c index 4b897a24c8a..fa8beb3716c 100644 --- a/source/blender/bmesh/operators/bmo_mesh_conv.c +++ b/source/blender/bmesh/operators/bmo_mesh_conv.c @@ -53,9 +53,9 @@ void bmo_mesh_to_bmesh_exec(BMesh *bm, BMOperator *op) { - Object *ob = BMO_slot_ptr_get(op->slots_in, "object"); - Mesh *me = BMO_slot_ptr_get(op->slots_in, "mesh"); - int set_key = BMO_slot_bool_get(op->slots_in, "use_shapekey"); + Object *ob = BMO_slot_ptr_get(op->slots_in, "object"); + Mesh *me = BMO_slot_ptr_get(op->slots_in, "mesh"); + bool set_key = BMO_slot_bool_get(op->slots_in, "use_shapekey"); BM_mesh_bm_from_me(bm, me, set_key, ob->shapenr); @@ -72,14 +72,14 @@ void bmo_object_load_bmesh_exec(BMesh *bm, BMOperator *op) BMO_op_callf(bm, op->flag, "bmesh_to_mesh mesh=%p object=%p skip_tessface=%b", - me, ob, TRUE); + me, ob, true); } void bmo_bmesh_to_mesh_exec(BMesh *bm, BMOperator *op) { Mesh *me = BMO_slot_ptr_get(op->slots_in, "mesh"); /* Object *ob = BMO_slot_ptr_get(op, "object"); */ - int dotess = !BMO_slot_bool_get(op->slots_in, "skip_tessface"); + const bool dotess = !BMO_slot_bool_get(op->slots_in, "skip_tessface"); BM_mesh_bm_to_me(bm, me, dotess); } diff --git a/source/blender/bmesh/operators/bmo_mirror.c b/source/blender/bmesh/operators/bmo_mirror.c index 61b061dd21f..48b2f76665c 100644 --- a/source/blender/bmesh/operators/bmo_mirror.c +++ b/source/blender/bmesh/operators/bmo_mirror.c @@ -53,8 +53,8 @@ void bmo_mirror_exec(BMesh *bm, BMOperator *op) float dist = BMO_slot_float_get(op->slots_in, "merge_dist"); int i, ototvert /*, ototedge */; int axis = BMO_slot_int_get(op->slots_in, "axis"); - int mirroru = BMO_slot_bool_get(op->slots_in, "mirror_u"); - int mirrorv = BMO_slot_bool_get(op->slots_in, "mirror_v"); + bool mirror_u = BMO_slot_bool_get(op->slots_in, "mirror_u"); + bool mirror_v = BMO_slot_bool_get(op->slots_in, "mirror_v"); BMOpSlot *slot_targetmap; ototvert = bm->totvert; @@ -97,7 +97,7 @@ void bmo_mirror_exec(BMesh *bm, BMOperator *op) v = BM_iter_step(&iter); } - if (mirroru || mirrorv) { + if (mirror_u || mirror_v) { BMFace *f; BMLoop *l; MLoopUV *luv; @@ -109,9 +109,9 @@ void bmo_mirror_exec(BMesh *bm, BMOperator *op) totlayer = CustomData_number_of_layers(&bm->ldata, CD_MLOOPUV); for (i = 0; i < totlayer; i++) { luv = CustomData_bmesh_get_n(&bm->ldata, l->head.data, CD_MLOOPUV, i); - if (mirroru) + if (mirror_u) luv->uv[0] = 1.0f - luv->uv[0]; - if (mirrorv) + if (mirror_v) luv->uv[1] = 1.0f - luv->uv[1]; } } diff --git a/source/blender/bmesh/operators/bmo_primitive.c b/source/blender/bmesh/operators/bmo_primitive.c index c582f710f43..011002718d3 100644 --- a/source/blender/bmesh/operators/bmo_primitive.c +++ b/source/blender/bmesh/operators/bmo_primitive.c @@ -420,7 +420,7 @@ void bmo_create_icosphere_exec(BMesh *bm, BMOperator *op) v2 = eva[icoface[a][1]]; v3 = eva[icoface[a][2]]; - eftemp = BM_face_create_quad_tri(bm, v1, v2, v3, NULL, NULL, FALSE); + eftemp = BM_face_create_quad_tri(bm, v1, v2, v3, NULL, NULL, false); BM_ITER_ELEM (l, &liter, eftemp, BM_LOOPS_OF_FACE) { BMO_elem_flag_enable(bm, l->e, EDGE_MARK); @@ -438,7 +438,7 @@ void bmo_create_icosphere_exec(BMesh *bm, BMOperator *op) "cuts=%i " "use_grid_fill=%b use_sphere=%b", EDGE_MARK, dia, (1 << (subdiv - 1)) - 1, - TRUE, TRUE); + true, true); BMO_op_exec(bm, &bmop); BMO_slot_buffer_flag_enable(bm, bmop.slots_out, "geom.out", BM_VERT, VERT_MARK); @@ -488,14 +488,14 @@ void bmo_create_monkey_exec(BMesh *bm, BMOperator *op) tv[monkeyf[i][1] + i - monkeyo], tv[monkeyf[i][2] + i - monkeyo], (monkeyf[i][3] != monkeyf[i][2]) ? tv[monkeyf[i][3] + i - monkeyo] : NULL, - NULL, FALSE); + NULL, false); BM_face_create_quad_tri(bm, tv[monkeynv + monkeyf[i][2] + i - monkeyo], tv[monkeynv + monkeyf[i][1] + i - monkeyo], tv[monkeynv + monkeyf[i][0] + i - monkeyo], (monkeyf[i][3] != monkeyf[i][2]) ? tv[monkeynv + monkeyf[i][3] + i - monkeyo] : NULL, - NULL, FALSE); + NULL, false); } MEM_freeN(tv); @@ -508,8 +508,8 @@ void bmo_create_circle_exec(BMesh *bm, BMOperator *op) { const float dia = BMO_slot_float_get(op->slots_in, "diameter"); const int segs = BMO_slot_int_get(op->slots_in, "segments"); - const int cap_ends = BMO_slot_bool_get(op->slots_in, "cap_ends"); - const int cap_tris = BMO_slot_bool_get(op->slots_in, "cap_tris"); + const bool cap_ends = BMO_slot_bool_get(op->slots_in, "cap_ends"); + const bool cap_tris = BMO_slot_bool_get(op->slots_in, "cap_tris"); BMVert *v1, *lastv1 = NULL, *cent1, *firstv1 = NULL; float vec[3], mat[4][4], phi, phid; @@ -547,7 +547,7 @@ void bmo_create_circle_exec(BMesh *bm, BMOperator *op) if (a && cap_ends) { BMFace *f; - f = BM_face_create_quad_tri(bm, cent1, lastv1, v1, NULL, NULL, FALSE); + f = BM_face_create_quad_tri(bm, cent1, lastv1, v1, NULL, NULL, false); BMO_elem_flag_enable(bm, f, FACE_NEW); } @@ -565,7 +565,7 @@ void bmo_create_circle_exec(BMesh *bm, BMOperator *op) if (cap_ends) { BMFace *f; - f = BM_face_create_quad_tri(bm, cent1, v1, firstv1, NULL, NULL, FALSE); + f = BM_face_create_quad_tri(bm, cent1, v1, firstv1, NULL, NULL, false); BMO_elem_flag_enable(bm, f, FACE_NEW); } @@ -584,8 +584,8 @@ void bmo_create_cone_exec(BMesh *bm, BMOperator *op) float dia2 = BMO_slot_float_get(op->slots_in, "diameter2"); float depth = BMO_slot_float_get(op->slots_in, "depth"); int segs = BMO_slot_int_get(op->slots_in, "segments"); - int cap_ends = BMO_slot_bool_get(op->slots_in, "cap_ends"); - int cap_tris = BMO_slot_bool_get(op->slots_in, "cap_tris"); + const bool cap_ends = BMO_slot_bool_get(op->slots_in, "cap_ends"); + const bool cap_tris = BMO_slot_bool_get(op->slots_in, "cap_tris"); int a; if (!segs) @@ -634,12 +634,12 @@ void bmo_create_cone_exec(BMesh *bm, BMOperator *op) if (cap_ends) { BMFace *f; - f = BM_face_create_quad_tri(bm, cent1, lastv1, v1, NULL, NULL, FALSE); + f = BM_face_create_quad_tri(bm, cent1, lastv1, v1, NULL, NULL, false); BMO_elem_flag_enable(bm, f, FACE_NEW); - f = BM_face_create_quad_tri(bm, cent2, v2, lastv2, NULL, NULL, FALSE); + f = BM_face_create_quad_tri(bm, cent2, v2, lastv2, NULL, NULL, false); BMO_elem_flag_enable(bm, f, FACE_NEW); } - BM_face_create_quad_tri(bm, lastv1, lastv2, v2, v1, NULL, FALSE); + BM_face_create_quad_tri(bm, lastv1, lastv2, v2, v1, NULL, false); } else { firstv1 = v1; @@ -656,9 +656,9 @@ void bmo_create_cone_exec(BMesh *bm, BMOperator *op) if (cap_ends) { BMFace *f; - f = BM_face_create_quad_tri(bm, cent1, v1, firstv1, NULL, NULL, FALSE); + f = BM_face_create_quad_tri(bm, cent1, v1, firstv1, NULL, NULL, false); BMO_elem_flag_enable(bm, f, FACE_NEW); - f = BM_face_create_quad_tri(bm, cent2, firstv2, v2, NULL, NULL, FALSE); + f = BM_face_create_quad_tri(bm, cent2, firstv2, v2, NULL, NULL, false); BMO_elem_flag_enable(bm, f, FACE_NEW); } @@ -666,7 +666,7 @@ void bmo_create_cone_exec(BMesh *bm, BMOperator *op) BMO_op_callf(bm, op->flag, "dissolve_faces faces=%ff", FACE_NEW); } - BM_face_create_quad_tri(bm, v1, v2, firstv2, firstv1, NULL, FALSE); + BM_face_create_quad_tri(bm, v1, v2, firstv2, firstv1, NULL, false); BMO_op_callf(bm, op->flag, "remove_doubles verts=%fv dist=%f", VERT_MARK, 0.000001); BMO_slot_buffer_from_enabled_flag(bm, op, op->slots_out, "verts.out", BM_VERT, VERT_MARK); @@ -738,14 +738,14 @@ void bmo_create_cube_exec(BMesh *bm, BMOperator *op) BMO_elem_flag_enable(bm, v8, VERT_MARK); /* the four sides */ - BM_face_create_quad_tri(bm, v5, v6, v2, v1, NULL, FALSE); - BM_face_create_quad_tri(bm, v6, v7, v3, v2, NULL, FALSE); - BM_face_create_quad_tri(bm, v7, v8, v4, v3, NULL, FALSE); - BM_face_create_quad_tri(bm, v8, v5, v1, v4, NULL, FALSE); + BM_face_create_quad_tri(bm, v5, v6, v2, v1, NULL, false); + BM_face_create_quad_tri(bm, v6, v7, v3, v2, NULL, false); + BM_face_create_quad_tri(bm, v7, v8, v4, v3, NULL, false); + BM_face_create_quad_tri(bm, v8, v5, v1, v4, NULL, false); /* top/bottom */ - BM_face_create_quad_tri(bm, v1, v2, v3, v4, NULL, FALSE); - BM_face_create_quad_tri(bm, v8, v7, v6, v5, NULL, FALSE); + BM_face_create_quad_tri(bm, v1, v2, v3, v4, NULL, false); + BM_face_create_quad_tri(bm, v8, v7, v6, v5, NULL, false); BMO_slot_buffer_from_enabled_flag(bm, op, op->slots_out, "verts.out", BM_VERT, VERT_MARK); } diff --git a/source/blender/bmesh/operators/bmo_removedoubles.c b/source/blender/bmesh/operators/bmo_removedoubles.c index 2f7011e6731..7beac676868 100644 --- a/source/blender/bmesh/operators/bmo_removedoubles.c +++ b/source/blender/bmesh/operators/bmo_removedoubles.c @@ -41,7 +41,7 @@ static void remdoubles_splitface(BMFace *f, BMesh *bm, BMOperator *op, BMOpSlot BMIter liter; BMLoop *l; BMVert *v2, *doub; - int split = FALSE; + bool split = false; BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) { v2 = BMO_slot_map_elem_get(slot_targetmap, l->v); @@ -52,14 +52,14 @@ static void remdoubles_splitface(BMFace *f, BMesh *bm, BMOperator *op, BMOpSlot (v2 != l->next->v)) { doub = l->v; - split = TRUE; + split = true; break; } } if (split && doub != v2) { BMLoop *nl; - BMFace *f2 = BM_face_split(bm, f, doub, v2, &nl, NULL, FALSE); + BMFace *f2 = BM_face_split(bm, f, doub, v2, &nl, NULL, false); remdoubles_splitface(f, bm, op, slot_targetmap); remdoubles_splitface(f2, bm, op, slot_targetmap); @@ -87,12 +87,12 @@ int remdoubles_face_overlaps(BMesh *bm, BMVert **varr, amount = BM_verts_in_face(bm, f, varr, len); if (amount >= len) { if (overlapface) *overlapface = f; - return TRUE; + return true; } f = BM_iter_step(&vertfaces); } } - return FALSE; + return false; } #endif diff --git a/source/blender/bmesh/operators/bmo_similar.c b/source/blender/bmesh/operators/bmo_similar.c index 548e1adf17d..baabcffd162 100644 --- a/source/blender/bmesh/operators/bmo_similar.c +++ b/source/blender/bmesh/operators/bmo_similar.c @@ -185,21 +185,21 @@ void bmo_similar_faces_exec(BMesh *bm, BMOperator *op) for (i = 0; i < num_total; i++) { fm = f_ext[i].f; if (!BMO_elem_flag_test(bm, fm, FACE_MARK) && !BM_elem_flag_test(fm, BM_ELEM_HIDDEN)) { - int cont = TRUE; - for (idx = 0; idx < num_sels && cont == TRUE; idx++) { + bool cont = true; + for (idx = 0; idx < num_sels && cont == true; idx++) { fs = f_ext[indices[idx]].f; switch (type) { case SIMFACE_MATERIAL: if (fm->mat_nr == fs->mat_nr) { BMO_elem_flag_enable(bm, fm, FACE_MARK); - cont = FALSE; + cont = false; } break; case SIMFACE_IMAGE: if (f_ext[i].t == f_ext[indices[idx]].t) { BMO_elem_flag_enable(bm, fm, FACE_MARK); - cont = FALSE; + cont = false; } break; @@ -207,7 +207,7 @@ void bmo_similar_faces_exec(BMesh *bm, BMOperator *op) angle = angle_normalized_v3v3(fs->no, fm->no); /* if the angle between the normals -> 0 */ if (angle <= thresh_radians) { BMO_elem_flag_enable(bm, fm, FACE_MARK); - cont = FALSE; + cont = false; } break; @@ -217,7 +217,7 @@ void bmo_similar_faces_exec(BMesh *bm, BMOperator *op) delta_fl = f_ext[i].d - f_ext[indices[idx]].d; if (bm_sel_similar_cmp_fl(delta_fl, thresh, compare)) { BMO_elem_flag_enable(bm, fm, FACE_MARK); - cont = FALSE; + cont = false; } } break; @@ -226,7 +226,7 @@ void bmo_similar_faces_exec(BMesh *bm, BMOperator *op) delta_fl = f_ext[i].area - f_ext[indices[idx]].area; if (bm_sel_similar_cmp_fl(delta_fl, thresh, compare)) { BMO_elem_flag_enable(bm, fm, FACE_MARK); - cont = FALSE; + cont = false; } break; @@ -234,7 +234,7 @@ void bmo_similar_faces_exec(BMesh *bm, BMOperator *op) delta_i = fm->len - fs->len; if (bm_sel_similar_cmp_i(delta_i, compare)) { BMO_elem_flag_enable(bm, fm, FACE_MARK); - cont = FALSE; + cont = false; } break; @@ -242,7 +242,7 @@ void bmo_similar_faces_exec(BMesh *bm, BMOperator *op) delta_fl = f_ext[i].perim - f_ext[indices[idx]].perim; if (bm_sel_similar_cmp_fl(delta_fl, thresh, compare)) { BMO_elem_flag_enable(bm, fm, FACE_MARK); - cont = FALSE; + cont = false; } break; default: @@ -373,15 +373,15 @@ void bmo_similar_edges_exec(BMesh *bm, BMOperator *op) for (i = 0; i < num_total; i++) { e = e_ext[i].e; if (!BMO_elem_flag_test(bm, e, EDGE_MARK) && !BM_elem_flag_test(e, BM_ELEM_HIDDEN)) { - int cont = TRUE; - for (idx = 0; idx < num_sels && cont == TRUE; idx++) { + bool cont = true; + for (idx = 0; idx < num_sels && cont == true; idx++) { es = e_ext[indices[idx]].e; switch (type) { case SIMEDGE_LENGTH: delta_fl = e_ext[i].length - e_ext[indices[idx]].length; if (bm_sel_similar_cmp_fl(delta_fl, thresh, compare)) { BMO_elem_flag_enable(bm, e, EDGE_MARK); - cont = FALSE; + cont = false; } break; @@ -394,7 +394,7 @@ void bmo_similar_edges_exec(BMesh *bm, BMOperator *op) if (angle / (float)(M_PI / 2.0) <= thresh) { BMO_elem_flag_enable(bm, e, EDGE_MARK); - cont = FALSE; + cont = false; } break; @@ -402,7 +402,7 @@ void bmo_similar_edges_exec(BMesh *bm, BMOperator *op) delta_i = e_ext[i].faces - e_ext[indices[idx]].faces; if (bm_sel_similar_cmp_i(delta_i, compare)) { BMO_elem_flag_enable(bm, e, EDGE_MARK); - cont = FALSE; + cont = false; } break; @@ -411,12 +411,12 @@ void bmo_similar_edges_exec(BMesh *bm, BMOperator *op) if (e_ext[indices[idx]].faces == 2) { if (fabsf(e_ext[i].angle - e_ext[indices[idx]].angle) <= thresh) { BMO_elem_flag_enable(bm, e, EDGE_MARK); - cont = FALSE; + cont = false; } } } else { - cont = FALSE; + cont = false; } break; @@ -430,7 +430,7 @@ void bmo_similar_edges_exec(BMesh *bm, BMOperator *op) if (bm_sel_similar_cmp_fl(delta_fl, thresh, compare)) { BMO_elem_flag_enable(bm, e, EDGE_MARK); - cont = FALSE; + cont = false; } } break; @@ -445,7 +445,7 @@ void bmo_similar_edges_exec(BMesh *bm, BMOperator *op) if (bm_sel_similar_cmp_fl(delta_fl, thresh, compare)) { BMO_elem_flag_enable(bm, e, EDGE_MARK); - cont = FALSE; + cont = false; } } break; @@ -453,14 +453,14 @@ void bmo_similar_edges_exec(BMesh *bm, BMOperator *op) case SIMEDGE_SEAM: if (BM_elem_flag_test(e, BM_ELEM_SEAM) == BM_elem_flag_test(es, BM_ELEM_SEAM)) { BMO_elem_flag_enable(bm, e, EDGE_MARK); - cont = FALSE; + cont = false; } break; case SIMEDGE_SHARP: if (BM_elem_flag_test(e, BM_ELEM_SMOOTH) == BM_elem_flag_test(es, BM_ELEM_SMOOTH)) { BMO_elem_flag_enable(bm, e, EDGE_MARK); - cont = FALSE; + cont = false; } break; default: @@ -562,15 +562,15 @@ void bmo_similar_verts_exec(BMesh *bm, BMOperator *op) for (i = 0; i < num_total; i++) { v = v_ext[i].v; if (!BMO_elem_flag_test(bm, v, VERT_MARK) && !BM_elem_flag_test(v, BM_ELEM_HIDDEN)) { - int cont = TRUE; - for (idx = 0; idx < num_sels && cont == TRUE; idx++) { + bool cont = true; + for (idx = 0; idx < num_sels && cont == true; idx++) { vs = v_ext[indices[idx]].v; switch (type) { case SIMVERT_NORMAL: /* compare the angle between the normals */ if (angle_normalized_v3v3(v->no, vs->no) <= thresh_radians) { BMO_elem_flag_enable(bm, v, VERT_MARK); - cont = FALSE; + cont = false; } break; case SIMVERT_FACE: @@ -578,7 +578,7 @@ void bmo_similar_verts_exec(BMesh *bm, BMOperator *op) delta_i = v_ext[i].num_faces - v_ext[indices[idx]].num_faces; if (bm_sel_similar_cmp_i(delta_i, compare)) { BMO_elem_flag_enable(bm, v, VERT_MARK); - cont = FALSE; + cont = false; } break; @@ -586,7 +586,7 @@ void bmo_similar_verts_exec(BMesh *bm, BMOperator *op) if (v_ext[i].dvert != NULL && v_ext[indices[idx]].dvert != NULL) { if (defvert_find_shared(v_ext[i].dvert, v_ext[indices[idx]].dvert) != -1) { BMO_elem_flag_enable(bm, v, VERT_MARK); - cont = FALSE; + cont = false; } } break; @@ -595,7 +595,7 @@ void bmo_similar_verts_exec(BMesh *bm, BMOperator *op) delta_i = v_ext[i].num_edges - v_ext[indices[idx]].num_edges; if (bm_sel_similar_cmp_i(delta_i, compare)) { BMO_elem_flag_enable(bm, v, VERT_MARK); - cont = FALSE; + cont = false; } break; default: diff --git a/source/blender/bmesh/operators/bmo_smooth_laplacian.c b/source/blender/bmesh/operators/bmo_smooth_laplacian.c index ce584686757..ba755a866de 100644 --- a/source/blender/bmesh/operators/bmo_smooth_laplacian.c +++ b/source/blender/bmesh/operators/bmo_smooth_laplacian.c @@ -180,7 +180,7 @@ static void init_laplacian_matrix(LaplacianSystem *sys) float *v1, *v2, *v3, *v4; float w1, w2, w3, w4; int i, j; - int has_4_vert; + bool has_4_vert; unsigned int idv1, idv2, idv3, idv4, idv[4]; BMEdge *e; BMFace *f; @@ -297,7 +297,7 @@ static void fill_laplacian_matrix(LaplacianSystem *sys) float *v1, *v2, *v3, *v4; float w2, w3, w4; int i, j; - int has_4_vert; + bool has_4_vert; unsigned int idv1, idv2, idv3, idv4, idv[4]; BMEdge *e; @@ -537,7 +537,7 @@ void bmo_smooth_laplacian_vert_exec(BMesh *bm, BMOperator *op) { int i; int m_vertex_id; - int usex, usey, usez, preserve_volume; + bool usex, usey, usez, preserve_volume; float lambda_factor, lambda_border; float w; BMOIter siter; diff --git a/source/blender/bmesh/operators/bmo_subdivide.c b/source/blender/bmesh/operators/bmo_subdivide.c index 7407eb4423a..ff5fce8f5c5 100644 --- a/source/blender/bmesh/operators/bmo_subdivide.c +++ b/source/blender/bmesh/operators/bmo_subdivide.c @@ -90,7 +90,7 @@ static BMEdge *connect_smallest_face(BMesh *bm, BMVert *v1, BMVert *v2, BMFace * } if (curf) { - face = BM_face_split(bm, curf, v1, v2, &nl, NULL, FALSE); + face = BM_face_split(bm, curf, v1, v2, &nl, NULL, false); if (r_nf) *r_nf = face; return nl ? nl->e : NULL; @@ -715,8 +715,8 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op) BMFace *face; BLI_array_declare(verts); float smooth, fractal, along_normal; - int use_sphere, cornertype, use_single_edge, use_grid_fill, use_only_quads; - int skey, seed, i, j, matched, a, b, numcuts, totesel; + bool use_sphere, use_single_edge, use_grid_fill, use_only_quads; + int cornertype, skey, seed, i, j, matched, a, b, numcuts, totesel; BMO_slot_buffer_flag_enable(bm, op->slots_in, "edges", BM_EDGE, SUBD_SPLIT); @@ -983,7 +983,7 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op) BLI_array_grow_items(loops_split, numcuts); for (j = 0; j < numcuts; j++) { - int ok = TRUE; + bool ok = true; /* Check for special case: [#32500] * This edge pair could be used by more then one face, @@ -1006,7 +1006,7 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op) BLI_assert(other_loop->prev->v != loops[a]->v); BLI_assert(other_loop->next->v != loops[a]->v); - ok = FALSE; + ok = false; break; } } @@ -1014,7 +1014,7 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op) } - if (ok == TRUE) { + if (ok == true) { loops_split[j][0] = loops[a]; loops_split[j][1] = loops[b]; } @@ -1036,10 +1036,10 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op) for (j = 0; j < BLI_array_count(loops_split); j++) { if (loops_split[j][0]) { - BLI_assert(BM_edge_exists(loops_split[j][0]->v, loops_split[j][1]->v) == FALSE); + BLI_assert(BM_edge_exists(loops_split[j][0]->v, loops_split[j][1]->v) == NULL); /* BMFace *nf = */ /* UNUSED */ - BM_face_split(bm, face, loops_split[j][0]->v, loops_split[j][1]->v, &nl, NULL, FALSE); + BM_face_split(bm, face, loops_split[j][0]->v, loops_split[j][1]->v, &nl, NULL, false); } } @@ -1123,7 +1123,7 @@ void BM_mesh_esubdivide(BMesh *bm, const char edge_hflag, BMElem *ele; for (ele = BMO_iter_new(&iter, op.slots_out, "geom_inner.out", BM_EDGE | BM_VERT); ele; ele = BMO_iter_step(&iter)) { - BM_elem_select_set(bm, ele, TRUE); + BM_elem_select_set(bm, ele, true); } } else if (seltype == SUBDIV_SELECT_LOOPCUT) { @@ -1131,10 +1131,10 @@ void BM_mesh_esubdivide(BMesh *bm, const char edge_hflag, BMElem *ele; /* deselect input */ - BM_mesh_elem_hflag_disable_all(bm, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_SELECT, FALSE); + BM_mesh_elem_hflag_disable_all(bm, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_SELECT, false); for (ele = BMO_iter_new(&iter, op.slots_out, "geom_inner.out", BM_EDGE | BM_VERT); ele; ele = BMO_iter_step(&iter)) { - BM_elem_select_set(bm, ele, TRUE); + BM_elem_select_set(bm, ele, true); if (ele->head.htype == BM_VERT) { BMEdge *e; @@ -1145,13 +1145,13 @@ void BM_mesh_esubdivide(BMesh *bm, const char edge_hflag, BM_elem_flag_test(e->v1, BM_ELEM_SELECT) && BM_elem_flag_test(e->v2, BM_ELEM_SELECT)) { - BM_edge_select_set(bm, e, TRUE); + BM_edge_select_set(bm, e, true); } else if (BM_elem_flag_test(e, BM_ELEM_SELECT) && (!BM_elem_flag_test(e->v1, BM_ELEM_SELECT) || !BM_elem_flag_test(e->v2, BM_ELEM_SELECT))) { - BM_edge_select_set(bm, e, FALSE); + BM_edge_select_set(bm, e, false); } } } diff --git a/source/blender/bmesh/operators/bmo_symmetrize.c b/source/blender/bmesh/operators/bmo_symmetrize.c index 172f0d40b27..0bfc81f83cf 100644 --- a/source/blender/bmesh/operators/bmo_symmetrize.c +++ b/source/blender/bmesh/operators/bmo_symmetrize.c @@ -176,7 +176,7 @@ static void symm_split_asymmetric_edges(Symm *symm) plane_co[symm->axis][0], plane_co[symm->axis][1], plane_co[symm->axis][2], - &lambda, TRUE); + &lambda, true); BLI_assert(r); madd_v3_v3v3fl(co, e->v1->co, edge_dir, lambda); @@ -244,7 +244,7 @@ typedef struct { int len; /* True only if none of the polygon's edges were split */ - int already_symmetric; + bool already_symmetric; BMFace *src_face; } SymmPoly; @@ -261,11 +261,11 @@ static void symm_poly_with_splits(const Symm *symm, /* Count vertices and check for edge splits */ out->len = f->len; - out->already_symmetric = TRUE; + out->already_symmetric = true; BM_ITER_ELEM (l, &iter, f, BM_LOOPS_OF_FACE) { if (BLI_ghash_haskey(symm->edge_split_map, l->e)) { out->len++; - out->already_symmetric = FALSE; + out->already_symmetric = false; } } @@ -332,11 +332,11 @@ static BMVert *symm_poly_mirror_dst(const Symm *symm, return NULL; } -static int symm_poly_next_crossing(const Symm *symm, - const SymmPoly *sp, - int start, - int *l1, - int *l2) +static bool symm_poly_next_crossing(const Symm *symm, + const SymmPoly *sp, + int start, + int *l1, + int *l2) { int i; @@ -347,12 +347,12 @@ static int symm_poly_next_crossing(const Symm *symm, if ((symm_poly_co_side(symm, sp, *l1) == SYMM_SIDE_KILL) ^ (symm_poly_co_side(symm, sp, *l2) == SYMM_SIDE_KILL)) { - return TRUE; + return true; } } BLI_assert(!"symm_poly_next_crossing failed"); - return FALSE; + return false; } static BMFace *symm_face_create_v(BMesh *bm, BMFace *example, @@ -378,7 +378,7 @@ static BMFace *symm_face_create_v(BMesh *bm, BMFace *example, f_new = BM_face_create(bm, fv, fe, len, BM_CREATE_NO_DOUBLE); if (example) BM_elem_attrs_copy(bm, bm, example, f_new); - BM_face_select_set(bm, f_new, TRUE); + BM_face_select_set(bm, f_new, true); BMO_elem_flag_enable(bm, f_new, SYMM_OUTPUT_GEOM); return f_new; @@ -465,15 +465,15 @@ static void symm_mirror_polygons(Symm *symm) BMO_ITER (f, &oiter, symm->op->slots_in, "input", BM_FACE) { BMIter iter; BMLoop *l; - int mirror_all = TRUE, ignore_all = TRUE; + bool mirror_all = true, ignore_all = true; /* Check if entire polygon can be mirrored or ignored */ BM_ITER_ELEM (l, &iter, f, BM_LOOPS_OF_FACE) { const SymmSide side = symm_co_side(symm, l->v->co); if (side == SYMM_SIDE_KILL) - mirror_all = FALSE; + mirror_all = false; else if (side == SYMM_SIDE_KEEP) - ignore_all = FALSE; + ignore_all = false; } if (mirror_all) { diff --git a/source/blender/bmesh/operators/bmo_triangulate.c b/source/blender/bmesh/operators/bmo_triangulate.c index 663ee463a2c..744f706681d 100644 --- a/source/blender/bmesh/operators/bmo_triangulate.c +++ b/source/blender/bmesh/operators/bmo_triangulate.c @@ -52,7 +52,7 @@ void bmo_triangulate_exec(BMesh *bm, BMOperator *op) float (*projectverts)[3] = NULL; BLI_array_declare(projectverts); int i; - const int use_beauty = BMO_slot_bool_get(op->slots_in, "use_beauty"); + const bool use_beauty = BMO_slot_bool_get(op->slots_in, "use_beauty"); BMOpSlot *slot_facemap_out = BMO_slot_get(op->slots_out, "face_map.out"); for (face = BMO_iter_new(&siter, op->slots_in, "faces", BM_FACE); face; face = BMO_iter_step(&siter)) { @@ -138,7 +138,7 @@ void bmo_beautify_fill_exec(BMesh *bm, BMOperator *op) fac2 = opp1 / (len2 + len3 + len6) + opp2 / (len4 + len1 + len6); if (fac1 > fac2) { - e = BM_edge_rotate(bm, e, FALSE, BM_EDGEROT_CHECK_EXISTS); + e = BM_edge_rotate(bm, e, false, BM_EDGEROT_CHECK_EXISTS); if (e) { BMO_elem_flag_enable(bm, e, ELE_NEW); @@ -195,7 +195,7 @@ void bmo_triangle_fill_exec(BMesh *bm, BMOperator *op) for (sf_tri = sf_ctx.fillfacebase.first; sf_tri; sf_tri = sf_tri->next) { BMFace *f = BM_face_create_quad_tri(bm, sf_tri->v1->tmp.p, sf_tri->v2->tmp.p, sf_tri->v3->tmp.p, NULL, - NULL, TRUE); + NULL, true); BMLoop *l; BMIter liter; diff --git a/source/blender/bmesh/operators/bmo_unsubdivide.c b/source/blender/bmesh/operators/bmo_unsubdivide.c index fae7db3d175..784e695efb0 100644 --- a/source/blender/bmesh/operators/bmo_unsubdivide.c +++ b/source/blender/bmesh/operators/bmo_unsubdivide.c @@ -55,5 +55,5 @@ void bmo_unsubdivide_exec(BMesh *bm, BMOperator *op) } /* do all the real work here */ - BM_mesh_decimate_unsubdivide_ex(bm, iterations, TRUE); + BM_mesh_decimate_unsubdivide_ex(bm, iterations, true); } diff --git a/source/blender/bmesh/operators/bmo_utils.c b/source/blender/bmesh/operators/bmo_utils.c index 64dbf0cc0e7..37dbfdd9ffe 100644 --- a/source/blender/bmesh/operators/bmo_utils.c +++ b/source/blender/bmesh/operators/bmo_utils.c @@ -122,8 +122,8 @@ void bmo_rotate_edges_exec(BMesh *bm, BMOperator *op) { BMOIter siter; BMEdge *e, *e2; - const int use_ccw = BMO_slot_bool_get(op->slots_in, "use_ccw"); - const int is_single = BMO_slot_buffer_count(op->slots_in, "edges") == 1; + const bool use_ccw = BMO_slot_bool_get(op->slots_in, "use_ccw"); + const bool is_single = BMO_slot_buffer_count(op->slots_in, "edges") == 1; short check_flag = is_single ? BM_EDGEROT_CHECK_EXISTS : BM_EDGEROT_CHECK_EXISTS | BM_EDGEROT_CHECK_DEGENERATE; @@ -140,8 +140,8 @@ void bmo_rotate_edges_exec(BMesh *bm, BMOperator *op) if (BM_edge_face_pair(e, &fa, &fb)) { /* check we're untouched */ - if (BMO_elem_flag_test(bm, fa, FACE_TAINT) == FALSE && - BMO_elem_flag_test(bm, fb, FACE_TAINT) == FALSE) + if (BMO_elem_flag_test(bm, fa, FACE_TAINT) == false && + BMO_elem_flag_test(bm, fb, FACE_TAINT) == false) { if (!(e2 = BM_edge_rotate(bm, e, use_ccw, check_flag))) { @@ -172,14 +172,14 @@ void bmo_rotate_edges_exec(BMesh *bm, BMOperator *op) #define SEL_FLAG 1 #define SEL_ORIG 2 -static void bmo_region_extend_extend(BMesh *bm, BMOperator *op, int usefaces) +static void bmo_region_extend_extend(BMesh *bm, BMOperator *op, const bool use_faces) { BMVert *v; BMEdge *e; BMIter eiter; BMOIter siter; - if (!usefaces) { + if (!use_faces) { BMO_ITER (v, &siter, op->slots_in, "geom", BM_VERT) { BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) { if (!BM_elem_flag_test(e, BM_ELEM_HIDDEN)) @@ -216,14 +216,14 @@ static void bmo_region_extend_extend(BMesh *bm, BMOperator *op, int usefaces) } } -static void bmo_region_extend_constrict(BMesh *bm, BMOperator *op, int usefaces) +static void bmo_region_extend_constrict(BMesh *bm, BMOperator *op, const bool use_faces) { BMVert *v; BMEdge *e; BMIter eiter; BMOIter siter; - if (!usefaces) { + if (!use_faces) { BMO_ITER (v, &siter, op->slots_in, "geom", BM_VERT) { BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) { if (!BM_elem_flag_test(e, BM_ELEM_HIDDEN)) @@ -265,8 +265,8 @@ static void bmo_region_extend_constrict(BMesh *bm, BMOperator *op, int usefaces) void bmo_region_extend_exec(BMesh *bm, BMOperator *op) { - int use_faces = BMO_slot_bool_get(op->slots_in, "use_faces"); - int constrict = BMO_slot_bool_get(op->slots_in, "use_constrict"); + const bool use_faces = BMO_slot_bool_get(op->slots_in, "use_faces"); + const bool constrict = BMO_slot_bool_get(op->slots_in, "use_constrict"); BMO_slot_buffer_flag_enable(bm, op->slots_in, "geom", BM_ALL_NOLOOP, SEL_ORIG); @@ -314,7 +314,8 @@ void bmo_recalc_face_normals_exec(BMesh *bm, BMOperator *op) BLI_array_declare(fstack); BMLoop *l, *l2; float maxx, maxx_test, cent[3]; - int i, i_max, flagflip = BMO_slot_bool_get(op->slots_in, "use_flip"); + int i, i_max; + const bool use_flip = BMO_slot_bool_get(op->slots_in, "use_flip"); startf = NULL; maxx = -1.0e10; @@ -349,7 +350,7 @@ void bmo_recalc_face_normals_exec(BMesh *bm, BMOperator *op) BM_face_normal_flip(bm, startf); BMO_elem_flag_toggle(bm, startf, FACE_FLIP); - if (flagflip) + if (use_flip) BM_elem_flag_toggle(startf, BM_ELEM_TAG); } @@ -381,11 +382,11 @@ void bmo_recalc_face_normals_exec(BMesh *bm, BMOperator *op) BM_face_normal_flip(bm, l2->f); BMO_elem_flag_toggle(bm, l2->f, FACE_FLIP); - if (flagflip) + if (use_flip) BM_elem_flag_toggle(l2->f, BM_ELEM_TAG); } else if (BM_elem_flag_test(l2->f, BM_ELEM_TAG) || BM_elem_flag_test(l->f, BM_ELEM_TAG)) { - if (flagflip) { + if (use_flip) { BM_elem_flag_disable(l->f, BM_ELEM_TAG); BM_elem_flag_disable(l2->f, BM_ELEM_TAG); } @@ -489,11 +490,11 @@ void bmo_rotate_uvs_exec(BMesh *bm, BMOperator *op) BMFace *fs; /* current face */ BMIter l_iter; /* iteration loop */ - const int use_ccw = BMO_slot_bool_get(op->slots_in, "use_ccw"); + const bool use_ccw = BMO_slot_bool_get(op->slots_in, "use_ccw"); BMO_ITER (fs, &fs_iter, op->slots_in, "faces", BM_FACE) { if (CustomData_has_layer(&(bm->ldata), CD_MLOOPUV)) { - if (use_ccw == FALSE) { /* same loops direction */ + if (use_ccw == false) { /* same loops direction */ BMLoop *lf; /* current face loops */ MLoopUV *f_luv; /* first face loop uv */ float p_uv[2]; /* previous uvs */ @@ -594,11 +595,11 @@ void bmo_rotate_colors_exec(BMesh *bm, BMOperator *op) BMFace *fs; /* current face */ BMIter l_iter; /* iteration loop */ - const int use_ccw = BMO_slot_bool_get(op->slots_in, "use_ccw"); + const bool use_ccw = BMO_slot_bool_get(op->slots_in, "use_ccw"); BMO_ITER (fs, &fs_iter, op->slots_in, "faces", BM_FACE) { if (CustomData_has_layer(&(bm->ldata), CD_MLOOPCOL)) { - if (use_ccw == FALSE) { /* same loops direction */ + if (use_ccw == false) { /* same loops direction */ BMLoop *lf; /* current face loops */ MLoopCol *f_lcol; /* first face loop color */ MLoopCol p_col; /* previous color */ diff --git a/source/blender/bmesh/operators/bmo_wireframe.c b/source/blender/bmesh/operators/bmo_wireframe.c index 7401704310f..0d603faf3c4 100644 --- a/source/blender/bmesh/operators/bmo_wireframe.c +++ b/source/blender/bmesh/operators/bmo_wireframe.c @@ -134,34 +134,34 @@ static void bm_vert_boundary_tangent(BMVert *v, float r_no[3], float r_no_face[3 } /* check if we are the only tagged loop-face around this edge */ -static int bm_loop_is_radial_boundary(BMLoop *l_first) +static bool bm_loop_is_radial_boundary(BMLoop *l_first) { BMLoop *l = l_first->radial_next; if (l == l_first) { - return TRUE; /* a real boundary */ + return true; /* a real boundary */ } else { do { if (BM_elem_flag_test(l->f, BM_ELEM_TAG)) { - return FALSE; + return false; } } while ((l = l->radial_next) != l_first); } - return TRUE; + return true; } extern float BM_vert_calc_mean_tagged_edge_length(BMVert *v); void bmo_wireframe_exec(BMesh *bm, BMOperator *op) { - const int use_boundary = BMO_slot_bool_get(op->slots_in, "use_boundary"); - const int use_even_offset = BMO_slot_bool_get(op->slots_in, "use_even_offset"); - const int use_relative_offset = BMO_slot_bool_get(op->slots_in, "use_relative_offset"); - const int use_crease = (BMO_slot_bool_get(op->slots_in, "use_crease") && - CustomData_has_layer(&bm->edata, CD_CREASE)); - const float depth = BMO_slot_float_get(op->slots_in, "thickness"); - const float inset = depth; + const bool use_boundary = BMO_slot_bool_get(op->slots_in, "use_boundary"); + const bool use_even_offset = BMO_slot_bool_get(op->slots_in, "use_even_offset"); + const bool use_relative_offset = BMO_slot_bool_get(op->slots_in, "use_relative_offset"); + const bool use_crease = (BMO_slot_bool_get(op->slots_in, "use_crease") && + CustomData_has_layer(&bm->edata, CD_CREASE)); + const float depth = BMO_slot_float_get(op->slots_in, "thickness"); + const float inset = depth; const int totvert_orig = bm->totvert; @@ -203,7 +203,7 @@ void bmo_wireframe_exec(BMesh *bm, BMOperator *op) } /* setup tags, all faces and verts will be tagged which will be duplicated */ - BM_mesh_elem_hflag_disable_all(bm, BM_FACE, BM_ELEM_TAG, FALSE); + BM_mesh_elem_hflag_disable_all(bm, BM_FACE, BM_ELEM_TAG, false); BMO_ITER (f_src, &oiter, op->slots_in, "faces", BM_FACE) { verts_loop_tot += f_src->len; @@ -239,13 +239,13 @@ void bmo_wireframe_exec(BMesh *bm, BMOperator *op) } /* conflicts with BM_vert_calc_mean_tagged_edge_length */ - if (use_relative_offset == FALSE) { + if (use_relative_offset == false) { BM_elem_flag_disable(v_src, BM_ELEM_TAG); } } if (use_relative_offset) { - BM_mesh_elem_hflag_disable_all(bm, BM_VERT, BM_ELEM_TAG, FALSE); + BM_mesh_elem_hflag_disable_all(bm, BM_VERT, BM_ELEM_TAG, false); } verts_loop = MEM_mallocN(sizeof(BMVert **) * verts_loop_tot, __func__); @@ -332,7 +332,7 @@ void bmo_wireframe_exec(BMesh *bm, BMOperator *op) BMVert *v_pos1 = verts_pos[i_1]; BMVert *v_pos2 = verts_pos[i_2]; - f_new = BM_face_create_quad_tri(bm, v_l1, v_l2, v_neg2, v_neg1, f_src, FALSE); + f_new = BM_face_create_quad_tri(bm, v_l1, v_l2, v_neg2, v_neg1, f_src, false); BM_elem_flag_enable(f_new, BM_ELEM_TAG); l_new = BM_FACE_FIRST_LOOP(f_new); @@ -341,7 +341,7 @@ void bmo_wireframe_exec(BMesh *bm, BMOperator *op) BM_elem_attrs_copy(bm, bm, l_next, l_new->next); BM_elem_attrs_copy(bm, bm, l_next, l_new->next->next); - f_new = BM_face_create_quad_tri(bm, v_l2, v_l1, v_pos1, v_pos2, f_src, FALSE); + f_new = BM_face_create_quad_tri(bm, v_l2, v_l1, v_pos1, v_pos2, f_src, false); BM_elem_flag_enable(f_new, BM_ELEM_TAG); l_new = BM_FACE_FIRST_LOOP(f_new); @@ -357,7 +357,7 @@ void bmo_wireframe_exec(BMesh *bm, BMOperator *op) BMVert *v_b1 = verts_boundary[i_1]; BMVert *v_b2 = verts_boundary[i_2]; - f_new = BM_face_create_quad_tri(bm, v_b2, v_b1, v_neg1, v_neg2, f_src, FALSE); + f_new = BM_face_create_quad_tri(bm, v_b2, v_b1, v_neg1, v_neg2, f_src, false); BM_elem_flag_enable(f_new, BM_ELEM_TAG); l_new = BM_FACE_FIRST_LOOP(f_new); @@ -366,7 +366,7 @@ void bmo_wireframe_exec(BMesh *bm, BMOperator *op) BM_elem_attrs_copy(bm, bm, l, l_new->next); BM_elem_attrs_copy(bm, bm, l, l_new->next->next); - f_new = BM_face_create_quad_tri(bm, v_b1, v_b2, v_pos2, v_pos1, f_src, FALSE); + f_new = BM_face_create_quad_tri(bm, v_b1, v_b2, v_pos2, v_pos1, f_src, false); BM_elem_flag_enable(f_new, BM_ELEM_TAG); l_new = BM_FACE_FIRST_LOOP(f_new); |