From 44a43afd0e858a8a3d563ff0a1a7b6b8043bd8f3 Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Fri, 29 Mar 2013 15:18:22 +0000 Subject: Slight cleanup for 2d painting. Cache is always enabled (used one of the bookkeeping variables from when the code was shared with texture painting) Also texonly now is always zero, probably another leftover from 2d/3d painting entanglement era. --- source/blender/editors/sculpt_paint/paint_image_2d.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/source/blender/editors/sculpt_paint/paint_image_2d.c b/source/blender/editors/sculpt_paint/paint_image_2d.c index a45209de643..52aa44575cb 100644 --- a/source/blender/editors/sculpt_paint/paint_image_2d.c +++ b/source/blender/editors/sculpt_paint/paint_image_2d.c @@ -87,11 +87,8 @@ BLI_INLINE unsigned char f_to_char(const float val) #define IMAPAINT_FLOAT_RGB_COPY(a, b) copy_v3_v3(a, b) typedef struct BrushPainterCache { - short enabled; - int size; /* size override, if 0 uses 2*BKE_brush_size_get(brush) */ short flt; /* need float imbuf? */ - short texonly; /* no alpha, color or fallof, only texture in imbuf */ int lastsize; float lastalpha; @@ -157,10 +154,9 @@ static BrushPainter *brush_painter_2d_new(Scene *scene, Brush *brush) } -static void brush_painter_2d_require_imbuf(BrushPainter *painter, short flt, short texonly, int size) +static void brush_painter_2d_require_imbuf(BrushPainter *painter, short flt, int size) { - if ((painter->cache.flt != flt) || (painter->cache.size != size) || - ((painter->cache.texonly != texonly) && texonly)) + if ((painter->cache.flt != flt) || (painter->cache.size != size)) { if (painter->cache.ibuf) IMB_freeImBuf(painter->cache.ibuf); if (painter->cache.maskibuf) IMB_freeImBuf(painter->cache.maskibuf); @@ -176,8 +172,6 @@ static void brush_painter_2d_require_imbuf(BrushPainter *painter, short flt, sho painter->cache.size = size; painter->cache.flt = flt; - painter->cache.texonly = texonly; - painter->cache.enabled = 1; } static void brush_painter_2d_free(BrushPainter *painter) @@ -738,10 +732,9 @@ int paint_2d_stroke(void *ps, const int prev_mval[2], const int mval[2], int era /* OCIO_TODO: float buffers are now always linear, so always use color correction * this should probably be changed when texture painting color space is supported */ - brush_painter_2d_require_imbuf(painter, ((ibuf->rect_float) ? 1 : 0), 0, 0); + brush_painter_2d_require_imbuf(painter, ((ibuf->rect_float) ? 1 : 0), 0); - if (painter->cache.enabled) - brush_painter_2d_refresh_cache(painter, newuv, is_data == false); + brush_painter_2d_refresh_cache(painter, newuv, is_data == false); if (paint_2d_op(s, painter->cache.ibuf, olduv, newuv)) { imapaint_image_update(s->sima, s->image, ibuf, false); -- cgit v1.2.3