diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2013-03-11 22:40:43 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2013-03-11 22:40:43 +0400 |
commit | 42b9c68534ce6ab0d948cf39cf35c813dc4686f0 (patch) | |
tree | f2aead0db55541e656f74262e5d433e94b0de9c6 /source/blender/editors | |
parent | 0a3382c8e032db528b1432c85d4aa516108b9f54 (diff) |
Minor cleanup: We always use colour correction now for float buffers. Get rid of flag variable.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image_proj.c | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index 8edb118ab73..cd10ef0fe2f 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -3751,26 +3751,16 @@ static void do_projectpaint_draw(ProjPaintState *ps, ProjPixel *projPixel, const } } -static void do_projectpaint_draw_f(ProjPaintState *ps, ProjPixel *projPixel, float rgba[4], float alpha, float mask, int use_color_correction) +static void do_projectpaint_draw_f(ProjPaintState *ps, ProjPixel *projPixel, float rgba[4], float alpha, float mask) { if (ps->is_texbrush) { /* rgba already holds a texture result here from higher level function */ - if (use_color_correction) { - float rgba_br[3]; - srgb_to_linearrgb_v3_v3(rgba_br, ps->brush->rgb); - mul_v3_v3(rgba, rgba_br); - } - else { - mul_v3_v3(rgba, ps->brush->rgb); - } + float rgba_br[3]; + srgb_to_linearrgb_v3_v3(rgba_br, ps->brush->rgb); + mul_v3_v3(rgba, rgba_br); } else { - if (use_color_correction) { - srgb_to_linearrgb_v3_v3(rgba, ps->brush->rgb); - } - else { - copy_v3_v3(rgba, ps->brush->rgb); - } + srgb_to_linearrgb_v3_v3(rgba, ps->brush->rgb); rgba[3] = 1.0; } @@ -3810,7 +3800,6 @@ static void *do_projectpaint_thread(void *ph_v) float falloff; int bucket_index; int is_floatbuf = 0; - int use_color_correction = FALSE; const short tool = ps->tool; rctf bucket_bounds; @@ -3866,7 +3855,6 @@ static void *do_projectpaint_thread(void *ph_v) last_projIma->touch = 1; is_floatbuf = last_projIma->ibuf->rect_float ? 1 : 0; - use_color_correction = TRUE; } /* end copy */ @@ -3962,7 +3950,6 @@ static void *do_projectpaint_thread(void *ph_v) last_projIma->touch = 1; is_floatbuf = last_projIma->ibuf->rect_float ? 1 : 0; - use_color_correction = TRUE; } /* end copy */ @@ -3998,7 +3985,7 @@ static void *do_projectpaint_thread(void *ph_v) else do_projectpaint_soften(ps, projPixel, alpha, mask, softenArena, &softenPixels); break; default: - if (is_floatbuf) do_projectpaint_draw_f(ps, projPixel, rgba, alpha, mask, use_color_correction); + if (is_floatbuf) do_projectpaint_draw_f(ps, projPixel, rgba, alpha, mask); else do_projectpaint_draw(ps, projPixel, rgba, alpha, mask); break; } @@ -4164,7 +4151,7 @@ static void project_state_init(bContext *C, Object *ob, ProjPaintState *ps) /* disable for 3d mapping also because painting on mirrored mesh can create "stripes" */ ps->do_masking = (brush->flag & BRUSH_AIRBRUSH || brush->mtex.brush_map_mode == MTEX_MAP_MODE_VIEW || brush->mtex.brush_map_mode == MTEX_MAP_MODE_3D) ? false : true; - ps->is_texbrush = (brush->mtex.tex) ? 1 : 0; + ps->is_texbrush = (brush->mtex.tex && brush->imagepaint_tool == PAINT_TOOL_DRAW) ? 1 : 0; } else { /* brush may be NULL*/ |