diff options
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r-- | source/blender/editors/mesh/editface.c | 2 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_select.c | 22 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_utils.c | 13 | ||||
-rw-r--r-- | source/blender/editors/mesh/mesh_data.c | 10 |
4 files changed, 21 insertions, 26 deletions
diff --git a/source/blender/editors/mesh/editface.c b/source/blender/editors/mesh/editface.c index d6ae2497cbb..c12b2f57f1a 100644 --- a/source/blender/editors/mesh/editface.c +++ b/source/blender/editors/mesh/editface.c @@ -126,7 +126,7 @@ void paintface_flush_flags(Object *ob) } } -void paintface_hide(Object *ob, const int unselected) +void paintface_hide(Object *ob, const bool unselected) { Mesh *me; MPoly *mpoly; diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c index 0bdd7093976..b31656894b4 100644 --- a/source/blender/editors/mesh/editmesh_select.c +++ b/source/blender/editors/mesh/editmesh_select.c @@ -104,7 +104,7 @@ void EDBM_select_mirrored(Object *UNUSED(obedit), BMEditMesh *em, bool extend) EDBM_verts_mirror_cache_end(em); } -void EDBM_automerge(Scene *scene, Object *obedit, int update) +void EDBM_automerge(Scene *scene, Object *obedit, bool update) { if ((scene->toolsettings->automerge) && @@ -377,13 +377,11 @@ static void findnearestvert__doClosest(void *userData, BMVert *eve, const float -static unsigned int findnearestvert__backbufIndextest(void *handle, unsigned int index) +static bool findnearestvert__backbufIndextest(void *handle, unsigned int index) { BMEditMesh *em = (BMEditMesh *)handle; BMVert *eve = BM_vert_at_index(em->bm, index - 1); - - if (eve && BM_elem_flag_test(eve, BM_ELEM_SELECT)) return 0; - return 1; + return !(eve && BM_elem_flag_test(eve, BM_ELEM_SELECT)); } /** * findnearestvert @@ -2306,7 +2304,7 @@ void EDBM_select_swap(BMEditMesh *em) /* exported for UV */ // if (EM_texFaceCheck()) } -int EDBM_select_interior_faces(BMEditMesh *em) +bool EDBM_select_interior_faces(BMEditMesh *em) { BMesh *bm = em->bm; BMIter iter; @@ -2914,7 +2912,7 @@ static void deselect_nth_active(BMEditMesh *em, BMVert **r_eve, BMEdge **r_eed, } } -static int edbm_deselect_nth(BMEditMesh *em, int nth, int offset) +static bool edbm_deselect_nth(BMEditMesh *em, int nth, int offset) { BMVert *v; BMEdge *e; @@ -2924,18 +2922,18 @@ static int edbm_deselect_nth(BMEditMesh *em, int nth, int offset) if (v) { walker_deselect_nth(em, nth, offset, &v->head); - return 1; + return true; } else if (e) { walker_deselect_nth(em, nth, offset, &e->head); - return 1; + return true; } else if (f) { walker_deselect_nth(em, nth, offset, &f->head); - return 1; + return true; } - return 0; + return false; } static int edbm_select_nth_exec(bContext *C, wmOperator *op) @@ -2948,7 +2946,7 @@ static int edbm_select_nth_exec(bContext *C, wmOperator *op) /* so input of offset zero ends up being (nth - 1) */ offset = (offset + (nth - 1)) % nth; - if (edbm_deselect_nth(em, nth, offset) == 0) { + if (edbm_deselect_nth(em, nth, offset) == false) { BKE_report(op->reports, RPT_ERROR, "Mesh has no active vert/edge/face"); return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c index 9020e133b33..5547df89463 100644 --- a/source/blender/editors/mesh/editmesh_utils.c +++ b/source/blender/editors/mesh/editmesh_utils.c @@ -816,7 +816,7 @@ UvMapVert *EDBM_uv_vert_map_at_index(UvVertMap *vmap, unsigned int v) /* A specialized vert map used by stitch operator */ -UvElementMap *EDBM_uv_element_map_create(BMEditMesh *em, int selected, int do_islands) +UvElementMap *EDBM_uv_element_map_create(BMEditMesh *em, const bool selected, const bool do_islands) { BMVert *ev; BMFace *efa; @@ -1070,7 +1070,7 @@ UvElement *ED_uv_element_get(UvElementMap *map, BMFace *efa, BMLoop *l) /* last_sel, use em->act_face otherwise get the last selected face in the editselections * at the moment, last_sel is mainly useful for making sure the space image dosnt flicker */ -MTexPoly *EDBM_mtexpoly_active_get(BMEditMesh *em, BMFace **r_act_efa, int sloppy, int selected) +MTexPoly *EDBM_mtexpoly_active_get(BMEditMesh *em, BMFace **r_act_efa, const bool sloppy, const bool selected) { BMFace *efa = NULL; @@ -1089,14 +1089,14 @@ MTexPoly *EDBM_mtexpoly_active_get(BMEditMesh *em, BMFace **r_act_efa, int slopp } /* can we edit UV's for this mesh?*/ -int EDBM_mtexpoly_check(BMEditMesh *em) +bool EDBM_mtexpoly_check(BMEditMesh *em) { /* some of these checks could be a touch overkill */ return em && em->bm->totface && CustomData_has_layer(&em->bm->pdata, CD_MTEXPOLY) && CustomData_has_layer(&em->bm->ldata, CD_MLOOPUV); } -int EDBM_vert_color_check(BMEditMesh *em) +bool EDBM_vert_color_check(BMEditMesh *em) { /* some of these checks could be a touch overkill */ return em && em->bm->totface && CustomData_has_layer(&em->bm->ldata, CD_MLOOPCOL); @@ -1265,11 +1265,12 @@ void EDBM_verts_mirror_apply(BMEditMesh *em, const int sel_from, const int sel_t /* swap is 0 or 1, if 1 it hides not selected */ -void EDBM_mesh_hide(BMEditMesh *em, int swap) +void EDBM_mesh_hide(BMEditMesh *em, bool swap) { BMIter iter; BMElem *ele; int itermode; + char hflag_swap = swap ? BM_ELEM_SELECT : 0; if (em == NULL) return; @@ -1281,7 +1282,7 @@ void EDBM_mesh_hide(BMEditMesh *em, int swap) itermode = BM_FACES_OF_MESH; BM_ITER_MESH (ele, &iter, em->bm, itermode) { - if (BM_elem_flag_test(ele, BM_ELEM_SELECT) ^ swap) + if (BM_elem_flag_test(ele, BM_ELEM_SELECT) ^ hflag_swap) BM_elem_hide_set(em->bm, ele, true); } diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c index cbaa80718ee..97650b3a318 100644 --- a/source/blender/editors/mesh/mesh_data.c +++ b/source/blender/editors/mesh/mesh_data.c @@ -220,7 +220,7 @@ static void delete_customdata_layer(Mesh *me, CustomDataLayer *layer) } /* without bContext, called in uvedit */ -int ED_mesh_uv_loop_reset_ex(struct Mesh *me, const int layernum) +void ED_mesh_uv_loop_reset_ex(struct Mesh *me, const int layernum) { BMEditMesh *em = me->edit_btmesh; MLoopUV *luv; @@ -323,20 +323,16 @@ int ED_mesh_uv_loop_reset_ex(struct Mesh *me, const int layernum) BLI_array_free(polylengths); DAG_id_tag_update(&me->id, 0); - - return 1; } -int ED_mesh_uv_loop_reset(struct bContext *C, struct Mesh *me) +void ED_mesh_uv_loop_reset(struct bContext *C, struct Mesh *me) { /* could be ldata or pdata */ CustomData *pdata = GET_CD_DATA(me, pdata); const int layernum = CustomData_get_active_layer_index(pdata, CD_MTEXPOLY); - int retval = ED_mesh_uv_loop_reset_ex(me, layernum); + ED_mesh_uv_loop_reset_ex(me, layernum); WM_event_add_notifier(C, NC_GEOM | ND_DATA, me); - - return retval; } /* note: keep in sync with ED_mesh_color_add */ |