diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-03-13 09:23:53 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-03-13 09:23:53 +0400 |
commit | 839b07fe316c07e14780dcfc8121d10ef6053f67 (patch) | |
tree | 95576574c9cb680d87add40e9e4e1b714f3a30ec /source/blender/editors/sculpt_paint | |
parent | acd3bef34e6a6b30df694f931dc0c622ca083f59 (diff) |
style cleanup: also remove unused defines in paint_image.c
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_stroke.c | 21 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 54 |
3 files changed, 38 insertions, 41 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 969efaf0bb7..f68848452d3 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -103,10 +103,6 @@ #define IMAPAINT_TILE_BITS 6 #define IMAPAINT_TILE_SIZE (1 << IMAPAINT_TILE_BITS) -#define IMAPAINT_TILE_NUMBER(size) (((size) + IMAPAINT_TILE_SIZE - 1) >> IMAPAINT_TILE_BITS) - -#define PROJ_VIEW_DATA_ID "view_data" -#define PROJ_VIEW_DATA_SIZE (4 * 4 + 4 * 4 + 3) /* viewmat + winmat + clipsta + clipend + is_ortho */ typedef struct UndoImageTile { struct UndoImageTile *next, *prev; diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index a7e97e55ca6..61ec0257833 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -204,14 +204,15 @@ static void paint_brush_update(bContext *C, Brush *brush, PaintMode mode, halfway[1] = dy * 0.5f + stroke->initial_mouse[1]; if (stroke->get_location) { - if(stroke->get_location(C, out, halfway)) { + if (stroke->get_location(C, out, halfway)) { hit = true; } - } else { + } + else { hit = true; } } - if(hit) { + if (hit) { copy_v2_v2(ups->anchored_initial_mouse, halfway); copy_v2_v2(ups->tex_mouse, halfway); ups->anchored_size /= 2.0f; @@ -464,12 +465,12 @@ bool paint_space_stroke_enabled(Brush *br, PaintMode mode) /* return true if the brush size can change during paint (normally used for pressure) */ bool paint_supports_dynamic_size(Brush *br, PaintMode mode) { - if(br->flag & BRUSH_ANCHORED) + if (br->flag & BRUSH_ANCHORED) return false; - switch(mode) { + switch (mode) { case PAINT_SCULPT: - if(ELEM4(br->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_THUMB, SCULPT_TOOL_ROTATE, SCULPT_TOOL_SNAKE_HOOK)) + if (ELEM4(br->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_THUMB, SCULPT_TOOL_ROTATE, SCULPT_TOOL_SNAKE_HOOK)) return false; default: ; @@ -480,13 +481,13 @@ bool paint_supports_dynamic_size(Brush *br, PaintMode mode) /* return true if the brush size can change during paint (normally used for pressure) */ bool paint_supports_moving_texture(Brush *br, PaintMode mode) { - if(br->flag & BRUSH_ANCHORED) + if (br->flag & BRUSH_ANCHORED) return false; - switch(mode) { + switch (mode) { case PAINT_SCULPT: - if(ELEM4(br->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_THUMB, SCULPT_TOOL_ROTATE, SCULPT_TOOL_SNAKE_HOOK)) - return false; + if (ELEM4(br->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_THUMB, SCULPT_TOOL_ROTATE, SCULPT_TOOL_SNAKE_HOOK)) + return false; default: ; } diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 7a6096b32d4..c8544e0495d 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -317,8 +317,8 @@ typedef struct { /* Initialize a SculptOrigVertData for accessing original vertex data; * handles BMesh, mesh, and multires */ static void sculpt_orig_vert_data_unode_init(SculptOrigVertData *data, - Object *ob, - SculptUndoNode *unode) + Object *ob, + SculptUndoNode *unode) { SculptSession *ss = ob->sculpt; BMesh *bm = ss->bm; @@ -339,19 +339,18 @@ static void sculpt_orig_vert_data_unode_init(SculptOrigVertData *data, /* Initialize a SculptOrigVertData for accessing original vertex data; * handles BMesh, mesh, and multires */ static void sculpt_orig_vert_data_init(SculptOrigVertData *data, - Object *ob, - PBVHNode *node) + Object *ob, + PBVHNode *node) { SculptUndoNode *unode; unode = sculpt_undo_push_node(ob, node, SCULPT_UNDO_COORDS); sculpt_orig_vert_data_unode_init(data, ob, unode); - } /* Update a SculptOrigVertData for a particular vertex from the PBVH * iterator */ static void sculpt_orig_vert_data_update(SculptOrigVertData *orig_data, - PBVHVertexIter *iter) + PBVHVertexIter *iter) { if (orig_data->unode->type == SCULPT_UNDO_COORDS) { if (orig_data->coords) { @@ -388,30 +387,30 @@ static void sculpt_orig_vert_data_update(SculptOrigVertData *orig_data, Others, like smooth, are better without. Same goes for alt- key smoothing. */ static int sculpt_stroke_dynamic_topology(const SculptSession *ss, - const Brush *brush) + const Brush *brush) { return ((BKE_pbvh_type(ss->pbvh) == PBVH_BMESH) && - (!ss->cache || (!ss->cache->alt_smooth)) && + (!ss->cache || (!ss->cache->alt_smooth)) && - /* Requires mesh restore, which doesn't work with - * dynamic-topology */ - !(brush->flag & BRUSH_ANCHORED) && - !(brush->flag & BRUSH_RESTORE_MESH) && + /* Requires mesh restore, which doesn't work with + * dynamic-topology */ + !(brush->flag & BRUSH_ANCHORED) && + !(brush->flag & BRUSH_RESTORE_MESH) && + + (!ELEM6(brush->sculpt_tool, + /* These brushes, as currently coded, cannot + * support dynamic topology */ + SCULPT_TOOL_GRAB, + SCULPT_TOOL_ROTATE, + SCULPT_TOOL_THUMB, + SCULPT_TOOL_LAYER, - (!ELEM6(brush->sculpt_tool, - /* These brushes, as currently coded, cannot - * support dynamic topology */ - SCULPT_TOOL_GRAB, - SCULPT_TOOL_ROTATE, - SCULPT_TOOL_THUMB, - SCULPT_TOOL_LAYER, - - /* These brushes could handle dynamic topology, - * but user feedback indicates it's better not - * to */ - SCULPT_TOOL_SMOOTH, - SCULPT_TOOL_MASK))); + /* These brushes could handle dynamic topology, + * but user feedback indicates it's better not + * to */ + SCULPT_TOOL_SMOOTH, + SCULPT_TOOL_MASK))); } /*** paint mesh ***/ @@ -440,7 +439,7 @@ static void paint_mesh_restore_co(Sculpt *sd, Object *ob) for (n = 0; n < totnode; n++) { SculptUndoNode *unode; SculptUndoType type = (brush->sculpt_tool == SCULPT_TOOL_MASK ? - SCULPT_UNDO_MASK : SCULPT_UNDO_COORDS); + SCULPT_UNDO_MASK : SCULPT_UNDO_COORDS); if (ss->bm) { unode = sculpt_undo_push_node(ob, nodes[n], type); @@ -972,7 +971,8 @@ static float tex_strength(SculptSession *ss, Brush *br, avg = paint_get_tex_pixel(br, x, y, ss->tex_pool); avg += br->texture_sample_bias; - } else { + } + else { avg = BKE_brush_sample_tex_3D(scene, br, point_2d, rgba, ss->tex_pool); } } |