diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2014-04-13 19:14:45 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2014-04-13 19:14:45 +0400 |
commit | 5d79c2662e043c35feeb4a31f3c5eb288e93c9c1 (patch) | |
tree | 57c02e33dbd6885caeb690cddda50872254794cd /source/blender/editors/sculpt_paint/paint_image.c | |
parent | 301d7d2f63f3e9e5560500c225f9ae437075418f (diff) |
Cleanup:
Naming:
Change pressure to size_pressure, it notes correctly that this value is
updated and expected to be used for size updating only.
Change name of cursor function and since it is used for uv sculpting
only now move to the relevant file. Also cleanup unneeded functionality
from function.
Stroke:
Separate updating of stroke variables to invariants (updated when
stroke->init = false) and variants.
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_image.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image.c | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 2f4caeeef1b..69610645228 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -718,71 +718,6 @@ int get_imapaint_zoom(bContext *C, float *zoomx, float *zoomy) /************************ cursor drawing *******************************/ -void brush_drawcursor_texpaint_uvsculpt(bContext *C, int x, int y, void *UNUSED(customdata)) -{ -#define PX_SIZE_FADE_MAX 12.0f -#define PX_SIZE_FADE_MIN 4.0f - - Scene *scene = CTX_data_scene(C); - //Brush *brush = image_paint_brush(C); - Paint *paint = BKE_paint_get_active_from_context(C); - Brush *brush = BKE_paint_brush(paint); - - if (paint && brush && paint->flags & PAINT_SHOW_BRUSH) { - float zoomx, zoomy; - const float size = (float)BKE_brush_size_get(scene, brush); - short use_zoom; - float pixel_size; - float alpha = 0.5f; - - use_zoom = get_imapaint_zoom(C, &zoomx, &zoomy); - - if (use_zoom) { - pixel_size = size * max_ff(zoomx, zoomy); - } - else { - pixel_size = size; - } - - /* fade out the brush (cheap trick to work around brush interfering with sampling [#])*/ - if (pixel_size < PX_SIZE_FADE_MIN) { - return; - } - else if (pixel_size < PX_SIZE_FADE_MAX) { - alpha *= (pixel_size - PX_SIZE_FADE_MIN) / (PX_SIZE_FADE_MAX - PX_SIZE_FADE_MIN); - } - - glPushMatrix(); - - glTranslatef((float)x, (float)y, 0.0f); - - /* No need to scale for uv sculpting, on the contrary it might be useful to keep un-scaled */ - if (use_zoom) - glScalef(zoomx, zoomy, 1.0f); - - glColor4f(brush->add_col[0], brush->add_col[1], brush->add_col[2], alpha); - glEnable(GL_LINE_SMOOTH); - glEnable(GL_BLEND); - { - UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings; - /* hrmf, duplicate paint_draw_cursor logic here */ - if (ups->stroke_active && BKE_brush_use_size_pressure(scene, brush)) { - /* inner at full alpha */ - glutil_draw_lined_arc(0, (float)(M_PI * 2.0), size * ups->pressure_value, 40); - /* outer at half alpha */ - glColor4f(brush->add_col[0], brush->add_col[1], brush->add_col[2], alpha * 0.5f); - } - } - glutil_draw_lined_arc(0, (float)(M_PI * 2.0), size, 40); - glDisable(GL_BLEND); - glDisable(GL_LINE_SMOOTH); - - glPopMatrix(); - } -#undef PX_SIZE_FADE_MAX -#undef PX_SIZE_FADE_MIN -} - static void toggle_paint_cursor(bContext *C, int enable) { wmWindowManager *wm = CTX_wm_manager(C); |