Undo revision 23130 which was a merge with 2.5, a messy one because I did something...
[blender.git] / source / blender / editors / sculpt_paint / paint_image.c
index 870b66c..465aa28 100644 (file)
@@ -3707,7 +3707,7 @@ static void *do_projectpaint_thread(void *ph_v)
        ProjPaintImage *last_projIma= NULL;
        ImagePaintPartialRedraw *last_partial_redraw_cell;
        
-       float rgba[4], alpha, dist_nosqrt, dist;
+       float rgba[4], alpha, dist_nosqrt;
        
        float brush_size_sqared;
        float falloff;
@@ -3721,7 +3721,6 @@ static void *do_projectpaint_thread(void *ph_v)
        float co[2];
        float mask = 1.0f; /* airbrush wont use mask */
        unsigned short mask_short;
-       float size_half = ((float)ps->brush->size) * 0.5f;
        
        LinkNode *smearPixels = NULL;
        LinkNode *smearPixels_f = NULL;
@@ -3756,8 +3755,8 @@ static void *do_projectpaint_thread(void *ph_v)
                        dist_nosqrt = Vec2Lenf_nosqrt(projPixel->projCoSS, pos);
                        
                        /*if (dist < s->brush->size) {*/ /* correct but uses a sqrtf */
-                       if (dist_nosqrt < brush_size_sqared && (dist=sqrtf(dist_nosqrt)) < size_half) {
-                               falloff = brush_curve_strength(ps->brush, dist, size_half);
+                       if (dist_nosqrt < brush_size_sqared) {
+                               falloff = brush_sample_falloff_noalpha(ps->brush, sqrtf(dist_nosqrt));
                                if (falloff > 0.0f) {
                                        if (ps->is_texbrush) {
                                                brush_sample_tex(ps->brush, projPixel->projCoSS, rgba);
@@ -4720,7 +4719,7 @@ static void paint_apply_event(bContext *C, wmOperator *op, wmEvent *event)
                tablet= (wmtab->Active != EVT_TABLET_NONE);
                pressure= wmtab->Pressure;
                if(wmtab->Active == EVT_TABLET_ERASER)
-                       pop->s.blend= IMB_BLEND_ERASE_ALPHA;
+                       pop->s.blend= BRUSH_BLEND_ERASE_ALPHA;
        }
        else
                pressure= 1.0f;
@@ -5175,7 +5174,7 @@ static int texture_paint_toggle_exec(bContext *C, wmOperator *op)
                        me->mtface= CustomData_add_layer(&me->fdata, CD_MTFACE, CD_DEFAULT,
                                                         NULL, me->totface);
 
-               paint_init(&scene->toolsettings->imapaint.paint, PAINT_CURSOR_TEXTURE_PAINT);
+               paint_init(&scene->toolsettings->imapaint.paint, "Brush");
 
                if(U.glreslimit != 0)
                        GPU_free_images();
@@ -5184,7 +5183,7 @@ static int texture_paint_toggle_exec(bContext *C, wmOperator *op)
                toggle_paint_cursor(C, 1);
        }
 
-       DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
+       DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
        WM_event_add_notifier(C, NC_SCENE|ND_MODE, scene);
 
        return OPERATOR_FINISHED;