style cleanup: also remove unused defines in paint_image.c
This commit is contained in:
@@ -69,10 +69,12 @@ float BKE_brush_curve_strength_clamp(struct Brush *br, float p, const float len)
|
||||
float BKE_brush_curve_strength(struct Brush *br, float p, const float len); /* used for sculpt */
|
||||
|
||||
/* sampling */
|
||||
void BKE_brush_sample_tex(const struct Scene *scene, struct Brush *brush, const float sampleco[3], float rgba[4], const int thread, struct ImagePool *pool);
|
||||
float BKE_brush_sample_tex_3D(const Scene *scene, struct Brush *br,const float point[3],
|
||||
float rgba[3], struct ImagePool *pool);
|
||||
float BKE_brush_sample_tex_2D(const struct Scene *scene, struct Brush *brush, const float xy[2], float rgba[4], struct ImagePool *pool);
|
||||
void BKE_brush_sample_tex(const struct Scene *scene, struct Brush *brush, const float sampleco[3],
|
||||
float rgba[4], const int thread, struct ImagePool *pool);
|
||||
float BKE_brush_sample_tex_3D(const Scene *scene, struct Brush *br, const float point[3],
|
||||
float rgba[3], struct ImagePool *pool);
|
||||
float BKE_brush_sample_tex_2D(const struct Scene *scene, struct Brush *brush, const float xy[2],
|
||||
float rgba[4], struct ImagePool *pool);
|
||||
void BKE_brush_imbuf_new(const struct Scene *scene, struct Brush *brush, short flt, short texfalloff, int size,
|
||||
struct ImBuf **imbuf, int use_color_correction);
|
||||
|
||||
|
||||
@@ -516,9 +516,9 @@ void BKE_brush_sample_tex(const Scene *scene, Brush *brush, const float sampleco
|
||||
|
||||
/* Return a multiplier for brush strength on a particular vertex. */
|
||||
float BKE_brush_sample_tex_3D(const Scene *scene, Brush *br,
|
||||
const float point[3],
|
||||
float rgba[3],
|
||||
struct ImagePool *pool)
|
||||
const float point[3],
|
||||
float rgba[3],
|
||||
struct ImagePool *pool)
|
||||
{
|
||||
UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings;
|
||||
MTex *mtex = &br->mtex;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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:
|
||||
;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user