diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-04-01 04:34:00 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-04-01 08:22:28 +0400 |
commit | 617557b08ea94e2b65a1697ddf0b79651204d92b (patch) | |
tree | 50b24bab075b42fa20456140c9a9681cfb01325b /source/blender/editors/sculpt_paint | |
parent | 2c00ecc738c04dc5dc22d4a6b81a1e937526ba6d (diff) |
Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image.c | 4 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image_proj.c | 40 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_ops.c | 12 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_stroke.c | 2 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_utils.c | 6 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_vertex.c | 90 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 28 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_undo.c | 40 |
8 files changed, 111 insertions, 111 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 434aaaf8835..4cf59a575b9 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -808,13 +808,13 @@ void ED_space_image_paint_update(wmWindowManager *wm, ToolSettings *settings) wmWindow *win; ScrArea *sa; ImagePaintSettings *imapaint = &settings->imapaint; - int enabled = FALSE; + int enabled = false; for (win = wm->windows.first; win; win = win->next) for (sa = win->screen->areabase.first; sa; sa = sa->next) if (sa->spacetype == SPACE_IMAGE) if (((SpaceImage *)sa->spacedata.first)->mode == SI_MODE_PAINT) - enabled = TRUE; + enabled = true; if (enabled) { BKE_paint_init(&imapaint->paint, PAINT_CURSOR_TEXTURE_PAINT); diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index 488e00e16ee..c6de5749274 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -661,7 +661,7 @@ static int project_paint_occlude_ptv_clip(const ProjPaintState *ps, const MFace if (side) interp_v3_v3v3v3(wco, ps->dm_mvert[mf->v1].co, ps->dm_mvert[mf->v3].co, ps->dm_mvert[mf->v4].co, w); else interp_v3_v3v3v3(wco, ps->dm_mvert[mf->v1].co, ps->dm_mvert[mf->v2].co, ps->dm_mvert[mf->v3].co, w); - if (!ED_view3d_clipping_test(ps->rv3d, wco, TRUE)) { + if (!ED_view3d_clipping_test(ps->rv3d, wco, true)) { return 1; } @@ -2017,9 +2017,9 @@ static void project_bucket_clip_face( return; } - doubles = TRUE; - while (doubles == TRUE) { - doubles = FALSE; + doubles = true; + while (doubles == true) { + doubles = false; for (i = 1; i < (*tot); i++) { if (fabsf(isectVCosSS[i - 1][0] - isectVCosSS[i][0]) < PROJ_PIXEL_TOLERANCE && fabsf(isectVCosSS[i - 1][1] - isectVCosSS[i][1]) < PROJ_PIXEL_TOLERANCE) @@ -2029,7 +2029,7 @@ static void project_bucket_clip_face( isectVCosSS[j - 1][0] = isectVCosSS[j][0]; isectVCosSS[j - 1][1] = isectVCosSS[j][1]; } - doubles = TRUE; /* keep looking for more doubles */ + doubles = true; /* keep looking for more doubles */ (*tot)--; } } @@ -2308,8 +2308,8 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i /* Note about IsectPoly2Df_twoside, checking the face or uv flipping doesnt work, * could check the poly direction but better to do this */ - if ((do_backfacecull == TRUE && IsectPoly2Df(uv, uv_clip, uv_clip_tot)) || - (do_backfacecull == FALSE && IsectPoly2Df_twoside(uv, uv_clip, uv_clip_tot))) + if ((do_backfacecull == true && IsectPoly2Df(uv, uv_clip, uv_clip_tot)) || + (do_backfacecull == false && IsectPoly2Df_twoside(uv, uv_clip, uv_clip_tot))) { has_x_isect = has_isect = 1; @@ -2321,7 +2321,7 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i /* a pity we need to get the worldspace pixel location here */ if (do_clip || do_3d_mapping) { interp_v3_v3v3v3(wco, ps->dm_mvert[(*(&mf->v1 + i1))].co, ps->dm_mvert[(*(&mf->v1 + i2))].co, ps->dm_mvert[(*(&mf->v1 + i3))].co, w); - if (do_clip && ED_view3d_clipping_test(ps->rv3d, wco, TRUE)) { + if (do_clip && ED_view3d_clipping_test(ps->rv3d, wco, true)) { continue; /* Watch out that no code below this needs to run */ } } @@ -2329,7 +2329,7 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i /* Is this UV visible from the view? - raytrace */ /* project_paint_PickFace is less complex, use for testing */ //if (project_paint_PickFace(ps, pixelScreenCo, w, &side) == face_index) { - if ((ps->do_occlude == FALSE) || + if ((ps->do_occlude == false) || !project_bucket_point_occluded(ps, bucketFaceNodes, face_index, pixelScreenCo)) { mask = project_paint_uvpixel_mask(ps, face_index, side, w); @@ -2507,7 +2507,7 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i pixelScreenCo[2] = pixelScreenCo[2] / pixelScreenCo[3]; /* Use the depth for bucket point occlusion */ } - if ((ps->do_occlude == FALSE) || + if ((ps->do_occlude == false) || !project_bucket_point_occluded(ps, bucketFaceNodes, face_index, pixelScreenCo)) { /* Only bother calculating the weights if we intersect */ @@ -2547,7 +2547,7 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i if (side) interp_v3_v3v3v3(wco, ps->dm_mvert[mf->v1].co, ps->dm_mvert[mf->v3].co, ps->dm_mvert[mf->v4].co, w); else interp_v3_v3v3v3(wco, ps->dm_mvert[mf->v1].co, ps->dm_mvert[mf->v2].co, ps->dm_mvert[mf->v3].co, w); - if (do_clip && ED_view3d_clipping_test(ps->rv3d, wco, TRUE)) { + if (do_clip && ED_view3d_clipping_test(ps->rv3d, wco, true)) { continue; /* Watch out that no code below this needs to run */ } } @@ -2842,20 +2842,20 @@ static void project_paint_begin(ProjPaintState *ps) if (ps->source == PROJ_SRC_IMAGE_CAM) { /* using render mesh, assume only camera was rendered from */ ps->dm = mesh_create_derived_render(ps->scene, ps->ob, ps->scene->customdata_mask | CD_MASK_MTFACE); - ps->dm_release = TRUE; + ps->dm_release = true; } else if (ps->ob->derivedFinal && CustomData_has_layer(&ps->ob->derivedFinal->faceData, CD_MTFACE) && (ps->do_face_sel == false || CustomData_has_layer(&ps->ob->derivedFinal->polyData, CD_ORIGINDEX))) { ps->dm = ps->ob->derivedFinal; - ps->dm_release = FALSE; + ps->dm_release = false; } else { ps->dm = mesh_get_derived_final( ps->scene, ps->ob, ps->scene->customdata_mask | CD_MASK_MTFACE | (ps->do_face_sel ? CD_ORIGINDEX : 0)); - ps->dm_release = TRUE; + ps->dm_release = true; } if (!CustomData_has_layer(&ps->dm->faceData, CD_MTFACE) ) { @@ -2900,7 +2900,7 @@ static void project_paint_begin(ProjPaintState *ps) ps->dm_mtface_clone = CustomData_get_layer_n(&ps->dm->faceData, CD_MTFACE, layer_num); if (ps->dm_mtface_clone == NULL || ps->dm_mtface_clone == ps->dm_mtface) { - ps->do_layer_clone = FALSE; + ps->do_layer_clone = false; ps->dm_mtface_clone = NULL; } } @@ -2912,7 +2912,7 @@ static void project_paint_begin(ProjPaintState *ps) ps->dm_mtface_stencil = CustomData_get_layer_n(&ps->dm->faceData, CD_MTFACE, layer_num); if (ps->dm_mtface_stencil == NULL || ps->dm_mtface_stencil == ps->dm_mtface) { - ps->do_layer_stencil = FALSE; + ps->do_layer_stencil = false; ps->dm_mtface_stencil = NULL; } } @@ -3698,7 +3698,7 @@ static void do_projectpaint_soften_f(ProjPaintState *ps, ProjPixel *projPixel, f float co_ofs[2]; float rgba_tmp[4]; sub_v2_v2v2(co_ofs, projPixel->projCoSS, proj_pixel_soften_v2[i]); - if (project_paint_PickColor(ps, co_ofs, rgba_tmp, NULL, TRUE)) { + if (project_paint_PickColor(ps, co_ofs, rgba_tmp, NULL, true)) { add_v4_v4(rgba, rgba_tmp); accum_tot++; } @@ -3729,7 +3729,7 @@ static void do_projectpaint_soften(ProjPaintState *ps, ProjPixel *projPixel, flo float co_ofs[2]; float rgba_tmp[4]; sub_v2_v2v2(co_ofs, projPixel->projCoSS, proj_pixel_soften_v2[i]); - if (project_paint_PickColor(ps, co_ofs, rgba_tmp, NULL, TRUE)) { + if (project_paint_PickColor(ps, co_ofs, rgba_tmp, NULL, true)) { add_v4_v4(rgba, rgba_tmp); accum_tot++; } @@ -4263,7 +4263,7 @@ static void project_state_init(bContext *C, Object *ob, ProjPaintState *ps, int ps->normal_angle_range = ps->normal_angle - ps->normal_angle_inner; if (ps->normal_angle_range <= 0.0f) - ps->do_mask_normal = FALSE; /* no need to do blending */ + ps->do_mask_normal = false; /* no need to do blending */ return; } @@ -4486,7 +4486,7 @@ static int texture_paint_image_from_view_exec(bContext *C, wmOperator *op) if (w > maxsize) w = maxsize; if (h > maxsize) h = maxsize; - ibuf = ED_view3d_draw_offscreen_imbuf(CTX_data_scene(C), CTX_wm_view3d(C), CTX_wm_region(C), w, h, IB_rect, FALSE, R_ALPHAPREMUL, err_out); + ibuf = ED_view3d_draw_offscreen_imbuf(CTX_data_scene(C), CTX_wm_view3d(C), CTX_wm_region(C), w, h, IB_rect, false, R_ALPHAPREMUL, err_out); if (!ibuf) { /* Mostly happens when OpenGL offscreen buffer was failed to create, */ /* but could be other reasons. Should be handled in the future. nazgul */ diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c index eec666426b6..71a548d2f21 100644 --- a/source/blender/editors/sculpt_paint/paint_ops.c +++ b/source/blender/editors/sculpt_paint/paint_ops.c @@ -1165,11 +1165,11 @@ void ED_keymap_paint(wmKeyConfig *keyconf) /* multires switch */ kmi = WM_keymap_add_item(keymap, "OBJECT_OT_subdivision_set", PAGEUPKEY, KM_PRESS, 0, 0); RNA_int_set(kmi->ptr, "level", 1); - RNA_boolean_set(kmi->ptr, "relative", TRUE); + RNA_boolean_set(kmi->ptr, "relative", true); kmi = WM_keymap_add_item(keymap, "OBJECT_OT_subdivision_set", PAGEDOWNKEY, KM_PRESS, 0, 0); RNA_int_set(kmi->ptr, "level", -1); - RNA_boolean_set(kmi->ptr, "relative", TRUE); + RNA_boolean_set(kmi->ptr, "relative", true); ed_keymap_paint_brush_switch(keymap, "sculpt"); ed_keymap_paint_brush_size(keymap, "tool_settings.sculpt.brush.size"); @@ -1273,9 +1273,9 @@ void ED_keymap_paint(wmKeyConfig *keyconf) RNA_enum_set(kmi->ptr, "action", SEL_INVERT); WM_keymap_add_item(keymap, "VIEW3D_OT_select_border", BKEY, KM_PRESS, 0, 0); kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_select_lasso", EVT_TWEAK_A, KM_ANY, KM_CTRL, 0); - RNA_boolean_set(kmi->ptr, "deselect", FALSE); + RNA_boolean_set(kmi->ptr, "deselect", false); kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_select_lasso", EVT_TWEAK_A, KM_ANY, KM_SHIFT | KM_CTRL, 0); - RNA_boolean_set(kmi->ptr, "deselect", TRUE); + RNA_boolean_set(kmi->ptr, "deselect", true); WM_keymap_add_item(keymap, "VIEW3D_OT_select_circle", CKEY, KM_PRESS, 0, 0); /* Image/Texture Paint mode */ @@ -1314,9 +1314,9 @@ void ED_keymap_paint(wmKeyConfig *keyconf) kmi = WM_keymap_add_item(keymap, "PAINT_OT_face_select_all", IKEY, KM_PRESS, KM_CTRL, 0); RNA_enum_set(kmi->ptr, "action", SEL_INVERT); kmi = WM_keymap_add_item(keymap, "PAINT_OT_face_select_hide", HKEY, KM_PRESS, 0, 0); - RNA_boolean_set(kmi->ptr, "unselected", FALSE); + RNA_boolean_set(kmi->ptr, "unselected", false); kmi = WM_keymap_add_item(keymap, "PAINT_OT_face_select_hide", HKEY, KM_PRESS, KM_SHIFT, 0); - RNA_boolean_set(kmi->ptr, "unselected", TRUE); + RNA_boolean_set(kmi->ptr, "unselected", true); WM_keymap_add_item(keymap, "PAINT_OT_face_select_reveal", HKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "PAINT_OT_face_select_linked", LKEY, KM_PRESS, KM_CTRL, 0); diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index f96f0edf672..15f21cc44c8 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -257,7 +257,7 @@ static void paint_brush_update(bContext *C, Brush *brush, PaintMode mode, paint_calculate_rake_rotation(ups, mouse); } - stroke->brush_init = TRUE; + stroke->brush_init = true; } diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c index 4f9ca4c2675..5364ac6e26a 100644 --- a/source/blender/editors/sculpt_paint/paint_utils.c +++ b/source/blender/editors/sculpt_paint/paint_utils.c @@ -473,7 +473,7 @@ void PAINT_OT_face_select_linked_pick(wmOperatorType *ot) static int face_select_all_exec(bContext *C, wmOperator *op) { Object *ob = CTX_data_active_object(C); - paintface_deselect_all_visible(ob, RNA_enum_get(op->ptr, "action"), TRUE); + paintface_deselect_all_visible(ob, RNA_enum_get(op->ptr, "action"), true); ED_region_tag_redraw(CTX_wm_region(C)); return OPERATOR_FINISHED; } @@ -497,7 +497,7 @@ void PAINT_OT_face_select_all(wmOperatorType *ot) static int vert_select_all_exec(bContext *C, wmOperator *op) { Object *ob = CTX_data_active_object(C); - paintvert_deselect_all_visible(ob, RNA_enum_get(op->ptr, "action"), TRUE); + paintvert_deselect_all_visible(ob, RNA_enum_get(op->ptr, "action"), true); ED_region_tag_redraw(CTX_wm_region(C)); return OPERATOR_FINISHED; } @@ -528,7 +528,7 @@ static int vert_select_ungrouped_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - paintvert_select_ungrouped(ob, RNA_boolean_get(op->ptr, "extend"), TRUE); + paintvert_select_ungrouped(ob, RNA_boolean_get(op->ptr, "extend"), true); ED_region_tag_redraw(CTX_wm_region(C)); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index e058f924a7b..d90f9a80b37 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -91,12 +91,12 @@ static bool vertex_paint_use_fast_update_check(Object *ob) } } - return FALSE; + return false; } /* if the polygons from the mesh and the 'derivedFinal' match * we can assume that no modifiers are applied and that its worth adding tessellated faces - * so 'vertex_paint_use_fast_update_check()' returns TRUE */ + * so 'vertex_paint_use_fast_update_check()' returns true */ static bool vertex_paint_use_tessface_check(Object *ob, Mesh *me) { DerivedMesh *dm = ob->derivedFinal; @@ -105,7 +105,7 @@ static bool vertex_paint_use_tessface_check(Object *ob, Mesh *me) return (me->mpoly == CustomData_get_layer(&dm->polyData, CD_MPOLY)); } - return FALSE; + return false; } static void update_tessface_data(Object *ob, Mesh *me) @@ -226,7 +226,7 @@ static void do_shared_vertex_tesscol(Mesh *me, bool *mfacetag) mface = me->mface; mcol = (char *)me->mcol; for (a = me->totface; a > 0; a--, mface++, mcol += 16) { - if ((use_face_sel == FALSE) || (mface->flag & ME_FACE_SEL)) { + if ((use_face_sel == false) || (mface->flag & ME_FACE_SEL)) { scol = scolmain + 4 * mface->v1; scol[0]++; scol[1] += mcol[1]; scol[2] += mcol[2]; scol[3] += mcol[3]; scol = scolmain + 4 * mface->v2; @@ -255,7 +255,7 @@ static void do_shared_vertex_tesscol(Mesh *me, bool *mfacetag) mcol = (char *)me->mcol; mftag = mfacetag; for (a = me->totface; a > 0; a--, mface++, mcol += 16, mftag += 4) { - if ((use_face_sel == FALSE) || (mface->flag & ME_FACE_SEL)) { + if ((use_face_sel == false) || (mface->flag & ME_FACE_SEL)) { if (mftag[0]) { scol = scolmain + 4 * mface->v1; mcol[1] = scol[1]; mcol[2] = scol[2]; mcol[3] = scol[3]; @@ -297,7 +297,7 @@ static void do_shared_vertexcol(Mesh *me, bool *mlooptag, bool *mfacetag, const scol = MEM_callocN(sizeof(int) * me->totvert * 5, "scol"); for (i = 0, mp = me->mpoly; i < me->totpoly; i++, mp++) { - if ((use_face_sel == FALSE) || (mp->flag & ME_FACE_SEL)) { + if ((use_face_sel == false) || (mp->flag & ME_FACE_SEL)) { MLoop *ml = me->mloop + mp->loopstart; MLoopCol *lcol = me->mloopcol + mp->loopstart; for (j = 0; j < mp->totloop; j++, ml++, lcol++) { @@ -320,7 +320,7 @@ static void do_shared_vertexcol(Mesh *me, bool *mlooptag, bool *mfacetag, const } for (i = 0, mp = me->mpoly; i < me->totpoly; i++, mp++) { - if ((use_face_sel == FALSE) || (mp->flag & ME_FACE_SEL)) { + if ((use_face_sel == false) || (mp->flag & ME_FACE_SEL)) { MLoop *ml = me->mloop + mp->loopstart; MLoopCol *lcol = me->mloopcol + mp->loopstart; for (j = 0; j < mp->totloop; j++, ml++, lcol++) { @@ -1055,13 +1055,13 @@ static float wpaint_blend(VPaint *wp, float weight, float weight_prev, weight = wpaint_blend_tool(tool, weight, paintval, alpha); /* delay clamping until the end so multi-paint can function when the active group is at the limits */ - if (do_multipaint_totsel == FALSE) { + if (do_multipaint_totsel == false) { CLAMP(weight, 0.0f, 1.0f); } /* if no spray, clip result with orig weight & orig alpha */ if ((wp->flag & VP_SPRAY) == 0) { - if (do_multipaint_totsel == FALSE) { + if (do_multipaint_totsel == false) { float testw = wpaint_blend_tool(tool, weight_prev, paintval, brush_alpha_value); CLAMP(testw, 0.0f, 1.0f); @@ -1102,7 +1102,7 @@ static int weight_sample_invoke(bContext *C, wmOperator *op, const wmEvent *even ED_view3d_init_mats_rv3d(vc.obact, vc.rv3d); if (use_vert_sel) { - if (ED_mesh_pick_vert(C, vc.obact, event->mval, &index, ED_MESH_PICK_DEFAULT_VERT_SIZE, TRUE)) { + if (ED_mesh_pick_vert(C, vc.obact, event->mval, &index, ED_MESH_PICK_DEFAULT_VERT_SIZE, true)) { v_idx_best = index; } } @@ -1153,16 +1153,16 @@ void PAINT_OT_weight_sample(wmOperatorType *ot) } /* samples cursor location, and gives menu with vertex groups to activate */ -static int weight_paint_sample_enum_itemf__helper(const MDeformVert *dvert, const int defbase_tot, int *groups) +static bool weight_paint_sample_enum_itemf__helper(const MDeformVert *dvert, const int defbase_tot, int *groups) { /* this func fills in used vgroup's */ - int found = FALSE; + bool found = false; int i = dvert->totweight; MDeformWeight *dw; for (dw = dvert->dw; i > 0; dw++, i--) { if (dw->def_nr < defbase_tot) { - groups[dw->def_nr] = TRUE; - found = TRUE; + groups[dw->def_nr] = true; + found = true; } } return found; @@ -1182,7 +1182,7 @@ static EnumPropertyItem *weight_paint_sample_enum_itemf(bContext *C, PointerRNA const int defbase_tot = BLI_countlist(&vc.obact->defbase); const int use_vert_sel = (me->editflag & ME_EDIT_PAINT_VERT_SEL) != 0; int *groups = MEM_callocN(defbase_tot * sizeof(int), "groups"); - int found = FALSE; + bool found = false; unsigned int index; int mval[2] = {win->eventstate->x - vc.ar->winrct.xmin, @@ -1192,7 +1192,7 @@ static EnumPropertyItem *weight_paint_sample_enum_itemf(bContext *C, PointerRNA ED_view3d_init_mats_rv3d(vc.obact, vc.rv3d); if (use_vert_sel) { - if (ED_mesh_pick_vert(C, vc.obact, mval, &index, ED_MESH_PICK_DEFAULT_VERT_SIZE, TRUE)) { + if (ED_mesh_pick_vert(C, vc.obact, mval, &index, ED_MESH_PICK_DEFAULT_VERT_SIZE, true)) { MDeformVert *dvert = &me->dvert[index]; found |= weight_paint_sample_enum_itemf__helper(dvert, defbase_tot, groups); } @@ -1209,7 +1209,7 @@ static EnumPropertyItem *weight_paint_sample_enum_itemf(bContext *C, PointerRNA } } - if (found == FALSE) { + if (found == false) { MEM_freeN(groups); } else { @@ -1387,11 +1387,11 @@ static bool has_locked_group(MDeformVert *dvert, const int defbase_tot, for (i = dvert->totweight, dw = dvert->dw; i != 0; i--, dw++) { if (dw->def_nr < defbase_tot) { if (bone_groups[dw->def_nr] && lock_flags[dw->def_nr] && dw->weight > 0.0f) { - return TRUE; + return true; } } } - return FALSE; + return false; } static bool has_locked_group_selected(int defbase_tot, const bool *defbase_sel, const bool *lock_flags) @@ -1412,14 +1412,14 @@ static bool has_unselected_unlocked_bone_group(int defbase_tot, bool *defbase_se { int i; if (defbase_tot == selected) { - return FALSE; + return false; } for (i = 0; i < defbase_tot; i++) { if (vgroup_validmap[i] && !defbase_sel[i] && !lock_flags[i]) { - return TRUE; + return true; } } - return FALSE; + return false; } #endif @@ -1488,7 +1488,7 @@ static float redistribute_change(MDeformVert *ndv, const int defbase_tot, if (change_status[ndw->def_nr] == change_me) { oldval = ndw->weight; /* if auto normalize is active, don't worry about upper bounds */ - if (do_auto_normalize == FALSE && ndw->weight + change > 1) { + if (do_auto_normalize == false && ndw->weight + change > 1) { totchange -= 1.0f - ndw->weight; ndw->weight = 1.0f; /* stop the changes to this group */ @@ -1707,7 +1707,7 @@ typedef struct WeightPaintInfo { } WeightPaintInfo; /* fresh start to make multi-paint and locking modular */ -/* returns TRUE if it thinks you need to reset the weights due to +/* returns true if it thinks you need to reset the weights due to * normalizing while multi-painting * * note: this assumes dw->def_nr range has been checked by the caller @@ -1753,19 +1753,19 @@ static int apply_mp_locks_normalize(Mesh *me, const WeightPaintInfo *wpi, if (neww > oldw) { if (tdw->weight <= oldw) { MEM_freeN(dv_test.dw); - return TRUE; + return true; } } else { if (tdw->weight >= oldw) { MEM_freeN(dv_test.dw); - return TRUE; + return true; } } } } MEM_freeN(dv_test.dw); - return FALSE; + return false; } /* within the current dvert index, get the dw that is selected and has a weight @@ -1875,11 +1875,11 @@ static void do_weight_paint_vertex( /* If there are no locks or multipaint, * then there is no need to run the more complicated checks */ - if ((do_multipaint_totsel == FALSE) && - (wpi->lock_flags == NULL || has_locked_group(dv, wpi->defbase_tot, wpi->vgroup_validmap, wpi->lock_flags) == FALSE)) + if ((do_multipaint_totsel == false) && + (wpi->lock_flags == NULL || has_locked_group(dv, wpi->defbase_tot, wpi->vgroup_validmap, wpi->lock_flags) == false)) { dw->weight = wpaint_blend(wp, dw->weight, dw_prev->weight, alpha, paintweight, - wpi->brush_alpha_value, wpi->do_flip, FALSE); + wpi->brush_alpha_value, wpi->do_flip, false); /* WATCH IT: take care of the ordering of applying mirror -> normalize, * can give wrong results [#26193], least confusing if normalize is done last */ @@ -2149,11 +2149,11 @@ static bool wpaint_ensure_data(bContext *C, wmOperator *op) Mesh *me = BKE_mesh_from_object(ob); if (scene->obedit) { - return FALSE; + return false; } if (me == NULL || me->totpoly == 0) { - return FALSE; + return false; } /* if nothing was added yet, we make dverts and a vertex deform group */ @@ -2191,10 +2191,10 @@ static bool wpaint_ensure_data(bContext *C, wmOperator *op) /* ensure we don't try paint onto an invalid group */ if (ob->actdef <= 0) { BKE_report(op->reports, RPT_WARNING, "No active vertex group for painting, aborting"); - return FALSE; + return false; } - return TRUE; + return true; } static bool wpaint_stroke_test_start(bContext *C, wmOperator *op, const float UNUSED(mouse[2])) @@ -2209,8 +2209,8 @@ static bool wpaint_stroke_test_start(bContext *C, wmOperator *op, const float UN float mat[4][4], imat[4][4]; - if (wpaint_ensure_data(C, op) == FALSE) { - return FALSE; + if (wpaint_ensure_data(C, op) == false) { + return false; } { @@ -2219,7 +2219,7 @@ static bool wpaint_stroke_test_start(bContext *C, wmOperator *op, const float UN bDeformGroup *dg = BLI_findlink(&ob->defbase, (ob->actdef - 1)); if (dg->flag & DG_LOCK_WEIGHT) { BKE_report(op->reports, RPT_WARNING, "Active group is locked, aborting"); - return FALSE; + return false; } } @@ -2256,7 +2256,7 @@ static bool wpaint_stroke_test_start(bContext *C, wmOperator *op, const float UN wpd->vgroup_mirror = wpaint_mirror_vgroup_ensure(ob, wpd->vgroup_active); } - return TRUE; + return true; } static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, PointerRNA *itemptr) @@ -2611,7 +2611,7 @@ static int weight_paint_set_exec(bContext *C, wmOperator *op) Brush *brush = BKE_paint_brush(&ts->wpaint->paint); float vgroup_weight = BKE_brush_weight_get(scene, brush); - if (wpaint_ensure_data(C, op) == FALSE) { + if (wpaint_ensure_data(C, op) == false) { return OPERATOR_CANCELLED; } @@ -2823,11 +2823,11 @@ static bool vpaint_stroke_test_start(bContext *C, struct wmOperator *op, const f * if not we can skip face map trickyness */ if (vertex_paint_use_fast_update_check(ob)) { vpaint_build_poly_facemap(vpd, me); - vpd->use_fast_update = TRUE; + vpd->use_fast_update = true; /* printf("Fast update!\n");*/ } else { - vpd->use_fast_update = FALSE; + vpd->use_fast_update = false; /* printf("No fast update!\n");*/ } @@ -3024,7 +3024,7 @@ static void vpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P ED_region_tag_redraw(vc->ar); - if (vpd->use_fast_update == FALSE) { + if (vpd->use_fast_update == false) { /* recalculate modifier stack to get new colors, slow, * avoid this if we can! */ DAG_id_tag_update(ob->data, 0); @@ -3206,7 +3206,7 @@ static void gradientVert__mapFunc(void *userData, int index, const float co[3], DMGradient_userData *grad_data = userData; Mesh *me = grad_data->me; - if (grad_data->use_select == FALSE || (me->mvert[index].flag & SELECT)) { + if (grad_data->use_select == false || (me->mvert[index].flag & SELECT)) { DMGradient_vertStore *vs = &grad_data->vert_cache[index]; /* run first pass only, could be split into its own mapFunc @@ -3356,7 +3356,7 @@ static int paint_weight_gradient_exec(bContext *C, wmOperator *op) vert_cache = gesture->userdata; } else { - if (wpaint_ensure_data(C, op) == FALSE) { + if (wpaint_ensure_data(C, op) == false) { return OPERATOR_CANCELLED; } @@ -3404,7 +3404,7 @@ static int paint_weight_gradient_invoke(bContext *C, wmOperator *op, const wmEve { int ret; - if (wpaint_ensure_data(C, op) == FALSE) { + if (wpaint_ensure_data(C, op) == false) { return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 441ce0f29b6..15a1cfdbdd3 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -1723,7 +1723,7 @@ static void smooth(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode, static void do_smooth_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode) { SculptSession *ss = ob->sculpt; - smooth(sd, ob, nodes, totnode, ss->cache->bstrength, FALSE); + smooth(sd, ob, nodes, totnode, ss->cache->bstrength, false); } static void do_mask_brush_draw(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode) @@ -1768,7 +1768,7 @@ static void do_mask_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode) do_mask_brush_draw(sd, ob, nodes, totnode); break; case BRUSH_MASK_SMOOTH: - smooth(sd, ob, nodes, totnode, ss->cache->bstrength, TRUE); + smooth(sd, ob, nodes, totnode, ss->cache->bstrength, true); break; } } @@ -3243,10 +3243,10 @@ static void do_brush_action(Sculpt *sd, Object *ob, Brush *brush) brush->autosmooth_factor > 0) { if (brush->flag & BRUSH_INVERSE_SMOOTH_PRESSURE) { - smooth(sd, ob, nodes, totnode, brush->autosmooth_factor * (1 - ss->cache->pressure), FALSE); + smooth(sd, ob, nodes, totnode, brush->autosmooth_factor * (1 - ss->cache->pressure), false); } else { - smooth(sd, ob, nodes, totnode, brush->autosmooth_factor, FALSE); + smooth(sd, ob, nodes, totnode, brush->autosmooth_factor, false); } } @@ -4239,7 +4239,7 @@ static void sculpt_stroke_modifiers_check(const bContext *C, Object *ob) Brush *brush = BKE_paint_brush(&sd->paint); sculpt_update_mesh_elements(CTX_data_scene(C), sd, ob, - sculpt_any_smooth_mode(brush, ss->cache, 0), FALSE); + sculpt_any_smooth_mode(brush, ss->cache, 0), false); } } @@ -4263,17 +4263,17 @@ static void sculpt_raycast_cb(PBVHNode *node, void *data_v, float *tmin) if (BKE_pbvh_node_get_tmin(node) < *tmin) { SculptRaycastData *srd = data_v; float (*origco)[3] = NULL; - int use_origco = FALSE; + bool use_origco = false; if (srd->original && srd->ss->cache) { if (BKE_pbvh_type(srd->ss->pbvh) == PBVH_BMESH) { - use_origco = TRUE; + use_origco = true; } else { /* intersect with coordinates from before we started stroke */ SculptUndoNode *unode = sculpt_undo_get_node(node); origco = (unode) ? unode->co : NULL; - use_origco = origco ? TRUE : FALSE; + use_origco = origco ? true : false; } } @@ -4394,10 +4394,10 @@ static int sculpt_brush_stroke_init(bContext *C, wmOperator *op) Brush *brush = BKE_paint_brush(&sd->paint); int mode = RNA_enum_get(op->ptr, "mode"); int is_smooth = 0; - int need_mask = FALSE; + int need_mask = false; if (brush->sculpt_tool == SCULPT_TOOL_MASK) { - need_mask = TRUE; + need_mask = true; } view3d_operator_needs_opengl(C); @@ -4554,7 +4554,7 @@ static void sculpt_stroke_update_step(bContext *C, struct PaintStroke *UNUSED(st if (ss->modifiers_active) sculpt_flush_stroke_deform(sd, ob); - ss->cache->first_time = FALSE; + ss->cache->first_time = false; /* Cleanup */ sculpt_flush_update(C); @@ -4801,7 +4801,7 @@ void sculpt_update_after_dynamic_topology_toggle(bContext *C) Sculpt *sd = scene->toolsettings->sculpt; /* Create the PBVH */ - sculpt_update_mesh_elements(scene, sd, ob, FALSE, FALSE); + sculpt_update_mesh_elements(scene, sd, ob, false, false); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); } @@ -4878,7 +4878,7 @@ void sculpt_dynamic_topology_disable(bContext *C, BKE_mesh_update_customdata_pointers(me, false); } else { - sculptsession_bm_to_me(ob, TRUE); + sculptsession_bm_to_me(ob, true); } /* Clear data */ @@ -5046,7 +5046,7 @@ static void sculpt_init_session(Scene *scene, Object *ob) { ob->sculpt = MEM_callocN(sizeof(SculptSession), "sculpt session"); - sculpt_update_mesh_elements(scene, scene->toolsettings->sculpt, ob, 0, FALSE); + sculpt_update_mesh_elements(scene, scene->toolsettings->sculpt, ob, 0, false); } int ED_sculpt_mask_layers_ensure(Object *ob, MultiresModifierData *mmd) diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c index 03321cd1a85..5adef17c6ad 100644 --- a/source/blender/editors/sculpt_paint/sculpt_undo.c +++ b/source/blender/editors/sculpt_paint/sculpt_undo.c @@ -114,7 +114,7 @@ static int sculpt_undo_restore_coords(bContext *C, DerivedMesh *dm, SculptUndoNo if (kb) { ob->shapenr = BLI_findindex(&key->block, kb) + 1; - sculpt_update_mesh_elements(scene, sd, ob, 0, FALSE); + sculpt_update_mesh_elements(scene, sd, ob, 0, false); WM_event_add_notifier(C, NC_OBJECT | ND_DATA, ob); } else { @@ -273,11 +273,11 @@ static void sculpt_undo_bmesh_restore_generic(bContext *C, { if (unode->applied) { BM_log_undo(ss->bm, ss->bm_log); - unode->applied = FALSE; + unode->applied = false; } else { BM_log_redo(ss->bm, ss->bm_log); - unode->applied = TRUE; + unode->applied = true; } if (unode->type == SCULPT_UNDO_MASK) { @@ -330,7 +330,7 @@ static void sculpt_undo_bmesh_restore_begin(bContext *C, { if (unode->applied) { sculpt_dynamic_topology_disable(C, unode); - unode->applied = FALSE; + unode->applied = false; } else { sculpt_undo_bmesh_enable(ob, unode); @@ -338,7 +338,7 @@ static void sculpt_undo_bmesh_restore_begin(bContext *C, /* Restore the mesh from the first log entry */ BM_log_redo(ss->bm, ss->bm_log); - unode->applied = TRUE; + unode->applied = true; } } @@ -353,19 +353,19 @@ static void sculpt_undo_bmesh_restore_end(bContext *C, /* Restore the mesh from the last log entry */ BM_log_undo(ss->bm, ss->bm_log); - unode->applied = FALSE; + unode->applied = false; } else { /* Disable dynamic topology sculpting */ sculpt_dynamic_topology_disable(C, NULL); - unode->applied = TRUE; + unode->applied = true; } } /* Handle all dynamic-topology updates * - * Returns TRUE if this was a dynamic-topology undo step, otherwise - * returns FALSE to indicate the non-dyntopo code should run. */ + * Returns true if this was a dynamic-topology undo step, otherwise + * returns false to indicate the non-dyntopo code should run. */ static int sculpt_undo_bmesh_restore(bContext *C, SculptUndoNode *unode, Object *ob, @@ -374,21 +374,21 @@ static int sculpt_undo_bmesh_restore(bContext *C, switch (unode->type) { case SCULPT_UNDO_DYNTOPO_BEGIN: sculpt_undo_bmesh_restore_begin(C, unode, ob, ss); - return TRUE; + return true; case SCULPT_UNDO_DYNTOPO_END: sculpt_undo_bmesh_restore_end(C, unode, ob, ss); - return TRUE; + return true; default: if (ss->bm_log) { sculpt_undo_bmesh_restore_generic(C, unode, ob, ss); - return TRUE; + return true; } break; } - return FALSE; + return false; } static void sculpt_undo_restore(bContext *C, ListBase *lb) @@ -399,15 +399,15 @@ static void sculpt_undo_restore(bContext *C, ListBase *lb) DerivedMesh *dm; SculptSession *ss = ob->sculpt; SculptUndoNode *unode; - int update = FALSE, rebuild = FALSE; - int need_mask = FALSE; + int update = false, rebuild = false; + int need_mask = false; for (unode = lb->first; unode; unode = unode->next) { if (strcmp(unode->idname, ob->id.name) == 0) { if (unode->type == SCULPT_UNDO_MASK) { /* is possible that we can't do the mask undo (below) * because of the vertex count */ - need_mask = TRUE; + need_mask = true; break; } } @@ -442,15 +442,15 @@ static void sculpt_undo_restore(bContext *C, ListBase *lb) switch (unode->type) { case SCULPT_UNDO_COORDS: if (sculpt_undo_restore_coords(C, dm, unode)) - update = TRUE; + update = true; break; case SCULPT_UNDO_HIDDEN: if (sculpt_undo_restore_hidden(C, dm, unode)) - rebuild = TRUE; + rebuild = true; break; case SCULPT_UNDO_MASK: if (sculpt_undo_restore_mask(C, dm, unode)) - update = TRUE; + update = true; break; case SCULPT_UNDO_DYNTOPO_BEGIN: @@ -713,7 +713,7 @@ static SculptUndoNode *sculpt_undo_bmesh_push(Object *ob, BLI_strncpy(unode->idname, ob->id.name, sizeof(unode->idname)); unode->type = type; - unode->applied = TRUE; + unode->applied = true; if (type == SCULPT_UNDO_DYNTOPO_END) { unode->bm_entry = BM_log_entry_add(ss->bm_log); |