diff options
Diffstat (limited to 'source/blender/editors/mesh/editface.c')
-rw-r--r-- | source/blender/editors/mesh/editface.c | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/source/blender/editors/mesh/editface.c b/source/blender/editors/mesh/editface.c index 260d01d726a..d6ae2497cbb 100644 --- a/source/blender/editors/mesh/editface.c +++ b/source/blender/editors/mesh/editface.c @@ -203,7 +203,8 @@ static void select_linked_tfaces_with_seams(int mode, Mesh *me, unsigned int ind MLoop *ml; MEdge *med; char *linkflag; - int a, b, do_it = TRUE, mark = 0; + int a, b, mark = 0; + bool do_it = true; ehash = BLI_edgehash_new(); seamhash = BLI_edgehash_new(); @@ -234,7 +235,7 @@ static void select_linked_tfaces_with_seams(int mode, Mesh *me, unsigned int ind } while (do_it) { - do_it = FALSE; + do_it = false; /* expand selection */ mp = me->mpoly; @@ -257,7 +258,7 @@ static void select_linked_tfaces_with_seams(int mode, Mesh *me, unsigned int ind if (mark) { linkflag[a] = 1; hash_add_face(ehash, mp, me->mloop + mp->loopstart); - do_it = TRUE; + do_it = true; } } } @@ -315,7 +316,7 @@ void paintface_select_linked(bContext *UNUSED(C), Object *ob, const int UNUSED(m paintface_flush_flags(ob); } -void paintface_deselect_all_visible(Object *ob, int action, short flush_flags) +void paintface_deselect_all_visible(Object *ob, int action, bool flush_flags) { Mesh *me; MPoly *mpoly; @@ -374,14 +375,15 @@ void paintface_deselect_all_visible(Object *ob, int action, short flush_flags) } } -int paintface_minmax(Object *ob, float r_min[3], float r_max[3]) +bool paintface_minmax(Object *ob, float r_min[3], float r_max[3]) { Mesh *me; MPoly *mp; MTexPoly *tf; MLoop *ml; MVert *mvert; - int a, b, ok = FALSE; + int a, b; + bool ok = false; float vec[3], bmat[3][3]; me = BKE_mesh_from_object(ob); @@ -404,7 +406,7 @@ int paintface_minmax(Object *ob, float r_min[3], float r_max[3]) minmax_v3v3_v3(r_min, r_max, vec); } - ok = TRUE; + ok = true; } return ok; @@ -483,7 +485,7 @@ void seam_mark_clear_tface(Scene *scene, short mode) } #endif -int paintface_mouse_select(struct bContext *C, Object *ob, const int mval[2], int extend, int deselect, int toggle) +bool paintface_mouse_select(struct bContext *C, Object *ob, const int mval[2], bool extend, bool deselect, bool toggle) { Mesh *me; MPoly *mpoly, *mpoly_sel; @@ -493,13 +495,13 @@ int paintface_mouse_select(struct bContext *C, Object *ob, const int mval[2], in me = BKE_mesh_from_object(ob); if (!ED_mesh_pick_face(C, ob, mval, &index, ED_MESH_PICK_DEFAULT_FACE_SIZE)) - return 0; + return false; if (index >= me->totpoly) - return 0; + return false; mpoly_sel = me->mpoly + index; - if (mpoly_sel->flag & ME_HIDE) return 0; + if (mpoly_sel->flag & ME_HIDE) return false; /* clear flags */ mpoly = me->mpoly; @@ -534,10 +536,10 @@ int paintface_mouse_select(struct bContext *C, Object *ob, const int mval[2], in paintface_flush_flags(ob); WM_event_add_notifier(C, NC_GEOM | ND_SELECT, ob->data); ED_region_tag_redraw(CTX_wm_region(C)); // XXX - should redraw all 3D views - return 1; + return true; } -int do_paintface_box_select(ViewContext *vc, rcti *rect, int select, int extend) +int do_paintface_box_select(ViewContext *vc, rcti *rect, bool select, bool extend) { Object *ob = vc->obact; Mesh *me; @@ -556,8 +558,8 @@ int do_paintface_box_select(ViewContext *vc, rcti *rect, int select, int extend) selar = MEM_callocN(me->totpoly + 1, "selar"); - if (extend == 0 && select) { - paintface_deselect_all_visible(vc->obact, SEL_DESELECT, FALSE); + if (extend == false && select) { + paintface_deselect_all_visible(vc->obact, SEL_DESELECT, false); mpoly = me->mpoly; for (a = 1; a <= me->totpoly; a++, mpoly++) { @@ -652,8 +654,8 @@ void paintvert_flush_flags(Object *ob) } } } -/* note: if the caller passes FALSE to flush_flags, then they will need to run paintvert_flush_flags(ob) themselves */ -void paintvert_deselect_all_visible(Object *ob, int action, short flush_flags) +/* note: if the caller passes false to flush_flags, then they will need to run paintvert_flush_flags(ob) themselves */ +void paintvert_deselect_all_visible(Object *ob, int action, bool flush_flags) { Mesh *me; MVert *mvert; @@ -712,7 +714,7 @@ void paintvert_deselect_all_visible(Object *ob, int action, short flush_flags) } } -void paintvert_select_ungrouped(Object *ob, short extend, short flush_flags) +void paintvert_select_ungrouped(Object *ob, bool extend, bool flush_flags) { Mesh *me = BKE_mesh_from_object(ob); MVert *mv; @@ -724,7 +726,7 @@ void paintvert_select_ungrouped(Object *ob, short extend, short flush_flags) } if (!extend) { - paintvert_deselect_all_visible(ob, SEL_DESELECT, FALSE); + paintvert_deselect_all_visible(ob, SEL_DESELECT, false); } dv = me->dvert; @@ -769,7 +771,7 @@ static int mirrtopo_vert_sort(const void *v1, const void *v2) return 0; } -int ED_mesh_mirrtopo_recalc_check(Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_topo_store) +bool ED_mesh_mirrtopo_recalc_check(Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_topo_store) { int totvert; int totedge; @@ -788,16 +790,16 @@ int ED_mesh_mirrtopo_recalc_check(Mesh *me, const int ob_mode, MirrTopoStore_t * (totvert != mesh_topo_store->prev_vert_tot) || (totedge != mesh_topo_store->prev_edge_tot)) { - return TRUE; + return true; } else { - return FALSE; + return false; } } void ED_mesh_mirrtopo_init(Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_topo_store, - const short skip_em_vert_array_init) + const bool skip_em_vert_array_init) { MEdge *medge; BMEditMesh *em = me->edit_btmesh; @@ -900,7 +902,7 @@ void ED_mesh_mirrtopo_init(Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_to index_lookup = MEM_mallocN(totvert * sizeof(*index_lookup), "mesh_topo_lookup"); if (em) { - if (skip_em_vert_array_init == FALSE) { + if (skip_em_vert_array_init == false) { EDBM_index_arrays_ensure(em, BM_VERT); } } |