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/bmo_utils.c | |
parent | 6cdbd1b1aaae0f8b3018ecf2648699a0ea6d6be8 (diff) |
use booleans for bmesh api.
Diffstat (limited to 'source/blender/bmesh/operators/bmo_utils.c')
-rw-r--r-- | source/blender/bmesh/operators/bmo_utils.c | 37 |
1 files changed, 19 insertions, 18 deletions
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 */ |