From c36f20a7d2c3486f34ba73680881189c75cc3e7d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 8 Mar 2013 04:00:06 +0000 Subject: style cleanup --- source/blender/editors/sculpt_paint/paint_image.c | 6 ++++-- .../blender/editors/sculpt_paint/paint_image_2d.c | 9 +++++--- .../editors/sculpt_paint/paint_image_proj.c | 12 +++++++---- source/blender/editors/sculpt_paint/paint_stroke.c | 5 +++-- source/blender/editors/sculpt_paint/sculpt.c | 24 +++++++++++----------- 5 files changed, 33 insertions(+), 23 deletions(-) (limited to 'source/blender/editors/sculpt_paint') diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 87f08207d6c..3db25800a06 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -408,11 +408,13 @@ typedef struct UndoImageTile { * paint operation, but for now just give a public interface */ static ImagePaintPartialRedraw imapaintpartial = {0, 0, 0, 0, 0}; -ImagePaintPartialRedraw *get_imapaintpartial(void) { +ImagePaintPartialRedraw *get_imapaintpartial(void) +{ return &imapaintpartial; } -void set_imapaintpartial(struct ImagePaintPartialRedraw *ippr) { +void set_imapaintpartial(struct ImagePaintPartialRedraw *ippr) +{ imapaintpartial = *ippr; } diff --git a/source/blender/editors/sculpt_paint/paint_image_2d.c b/source/blender/editors/sculpt_paint/paint_image_2d.c index 194b36ac099..fead8a9d990 100644 --- a/source/blender/editors/sculpt_paint/paint_image_2d.c +++ b/source/blender/editors/sculpt_paint/paint_image_2d.c @@ -944,7 +944,8 @@ int paint_2d_stroke(void *ps, const int mval[2], float pressure, int eraser) return redraw; } -void *paint_2d_new_stroke(bContext *C, wmOperator *op) { +void *paint_2d_new_stroke(bContext *C, wmOperator *op) +{ Scene *scene = CTX_data_scene(C); ToolSettings *settings = scene->toolsettings; Brush *brush = paint_brush(&settings->imapaint.paint); @@ -980,7 +981,8 @@ void *paint_2d_new_stroke(bContext *C, wmOperator *op) { return s; } -void paint_2d_redraw (const bContext *C, void *ps, int final) { +void paint_2d_redraw (const bContext *C, void *ps, int final) +{ ImagePaintState *s = ps; if (final) { @@ -998,7 +1000,8 @@ void paint_2d_redraw (const bContext *C, void *ps, int final) { } } -void paint_2d_stroke_done(void *ps) { +void paint_2d_stroke_done(void *ps) +{ ImagePaintState *s = ps; paint_2d_canvas_free(s); diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index e594bf25d0c..c0f42ed2586 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -24,7 +24,7 @@ * ***** END GPL LICENSE BLOCK ***** */ -/** \file blender/editors/sculpt_paint/paint_image.c +/** \file blender/editors/sculpt_paint/paint_image_proj.c * \ingroup edsculpt * \brief Functions to paint images in 2D and 3D. */ @@ -4310,7 +4310,8 @@ static void paint_redraw(const bContext *C, PaintOperation *pop, int final) { if (pop->mode == PAINT_MODE_2D) { paint_2d_redraw(C, pop->custom_paint, final); - } else { + } + else { if (final) { /* compositor listener deals with updating */ WM_event_add_notifier(C, NC_IMAGE | NA_EDITED, NULL); @@ -4509,8 +4510,10 @@ static void paint_stroke_done(const bContext *C, struct PaintStroke *stroke) paint_brush_exit_tex(pop->ps.brush); project_paint_end(&pop->ps); - } else + } + else { paint_2d_stroke_done(pop->custom_paint); + } paint_redraw(C, pop, 1); undo_paint_push_end(UNDO_PAINT_IMAGE); @@ -4529,7 +4532,8 @@ static void paint_stroke_done(const bContext *C, struct PaintStroke *stroke) } } -static int paint_stroke_test_start(bContext * UNUSED(C), wmOperator * UNUSED(op), const float UNUSED(mouse[2])) { +static int paint_stroke_test_start(bContext *UNUSED(C), wmOperator *UNUSED(op), const float UNUSED(mouse[2])) +{ return true; } diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index 2146c74fb6d..0180f50fab6 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -287,7 +287,7 @@ PaintStroke *paint_stroke_new(bContext *C, stroke->brush = paint_brush(paint_get_active_from_context(C)); view3d_set_viewcontext(C, &stroke->vc); - if(stroke->vc.v3d) + if (stroke->vc.v3d) view3d_get_transformation(stroke->vc.ar, stroke->vc.rv3d, stroke->vc.obact, &stroke->mats); stroke->get_location = get_location; @@ -338,7 +338,8 @@ bool paint_supports_dynamic_size(Brush *br) !ELEM4(br->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_THUMB, SCULPT_TOOL_ROTATE, SCULPT_TOOL_SNAKE_HOOK); } -bool paint_supports_jitter(PaintMode mode) { +bool paint_supports_jitter(PaintMode mode) +{ return ELEM(mode, PAINT_SCULPT, PAINT_TEXTURE_PROJECTIVE); } diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index ecabb70d9d7..48c37c060ec 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -3205,8 +3205,8 @@ static void sculpt_combine_proxies(Sculpt *sd, Object *ob) if (use_orco) { if (ss->bm) { copy_v3_v3(val, - BM_log_original_vert_co(ss->bm_log, - vd.bm_vert)); + BM_log_original_vert_co(ss->bm_log, + vd.bm_vert)); } else copy_v3_v3(val, orco[vd.i]); @@ -3374,7 +3374,7 @@ static void sculpt_fix_noise_tear(Sculpt *sd, Object *ob) } static void do_symmetrical_brush_actions(Sculpt *sd, Object *ob, - BrushActionFunc action) + BrushActionFunc action) { Brush *brush = paint_brush(&sd->paint); SculptSession *ss = ob->sculpt; @@ -4317,9 +4317,9 @@ static void sculpt_stroke_update_step(bContext *C, struct PaintStroke *stroke, P sculpt_restore_mesh(sd, ob); BKE_pbvh_bmesh_detail_size_set(ss->pbvh, - (ss->cache->radius / - (float)ss->cache->pixel_radius) * - (float)sd->detail_size); + (ss->cache->radius / + (float)ss->cache->pixel_radius) * + (float)sd->detail_size); if (sculpt_stroke_dynamic_topology(ss, brush)) { do_symmetrical_brush_actions(sd, ob, sculpt_topology_update); @@ -4598,7 +4598,7 @@ void sculpt_dynamic_topology_enable(bContext *C) sculpt_pbvh_clear(ob); ss->bm_smooth_shading = (scene->toolsettings->sculpt->flags & - SCULPT_DYNTOPO_SMOOTH_SHADING); + SCULPT_DYNTOPO_SMOOTH_SHADING); /* Create triangles-only BMesh */ ss->bm = BM_mesh_create(&bm_mesh_allocsize_default); @@ -4624,7 +4624,7 @@ void sculpt_dynamic_topology_enable(bContext *C) * If 'unode' is given, the BMesh's data is copied out to the unode * before the BMesh is deleted so that it can be restored from */ void sculpt_dynamic_topology_disable(bContext *C, - SculptUndoNode *unode) + SculptUndoNode *unode) { Object *ob = CTX_data_active_object(C); SculptSession *ss = ob->sculpt; @@ -4647,13 +4647,13 @@ void sculpt_dynamic_topology_disable(bContext *C, me->totedge = unode->bm_enter_totedge; me->totface = 0; CustomData_copy(&unode->bm_enter_vdata, &me->vdata, CD_MASK_MESH, - CD_DUPLICATE, unode->bm_enter_totvert); + CD_DUPLICATE, unode->bm_enter_totvert); CustomData_copy(&unode->bm_enter_edata, &me->edata, CD_MASK_MESH, - CD_DUPLICATE, unode->bm_enter_totedge); + CD_DUPLICATE, unode->bm_enter_totedge); CustomData_copy(&unode->bm_enter_ldata, &me->ldata, CD_MASK_MESH, - CD_DUPLICATE, unode->bm_enter_totloop); + CD_DUPLICATE, unode->bm_enter_totloop); CustomData_copy(&unode->bm_enter_pdata, &me->pdata, CD_MASK_MESH, - CD_DUPLICATE, unode->bm_enter_totpoly); + CD_DUPLICATE, unode->bm_enter_totpoly); mesh_update_customdata_pointers(me, FALSE); } -- cgit v1.2.3