Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/paint_vertex.c
| Show First 20 Lines • Show All 256 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| Brush *brush = BKE_paint_brush(&vp->paint); | Brush *brush = BKE_paint_brush(&vp->paint); | ||||
| uchar col[4]; | uchar col[4]; | ||||
| rgb_float_to_uchar(col, BKE_brush_color_get(scene, brush)); | rgb_float_to_uchar(col, BKE_brush_color_get(scene, brush)); | ||||
| col[3] = 255; /* alpha isn't used, could even be removed to speedup paint a little */ | col[3] = 255; /* alpha isn't used, could even be removed to speedup paint a little */ | ||||
| return *(uint *)col; | return *(uint *)col; | ||||
| } | } | ||||
| uint vpaint_get_current_alpha(Scene *scene, VPaint *vp) | |||||
| { | |||||
| Brush *brush = BKE_paint_brush(&vp->paint); | |||||
| float alpha = BKE_brush_alpha_get(scene, brush); | |||||
| return 255 * alpha; | |||||
| } | |||||
| /* wpaint has 'wpaint_blend' */ | /* wpaint has 'wpaint_blend' */ | ||||
| static uint vpaint_blend( | static uint vpaint_blend( | ||||
| const VPaint *vp, uint color_curr, uint color_orig, | const VPaint *vp, uint color_curr, uint color_orig, | ||||
| uint color_paint, const int alpha_i, | uint color_paint, const int alpha_i, | ||||
| /* pre scaled from [0-1] --> [0-255] */ | /* pre scaled from [0-1] --> [0-255] */ | ||||
| const int brush_alpha_value_i) | const int brush_alpha_value_i) | ||||
| { | { | ||||
| const Brush *brush = vp->paint.brush; | const Brush *brush = vp->paint.brush; | ||||
| ▲ Show 20 Lines • Show All 2,913 Lines • Show Last 20 Lines | |||||