Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2013-03-29 19:18:22 +0400
committerAntony Riakiotakis <kalast@gmail.com>2013-03-29 19:18:22 +0400
commit44a43afd0e858a8a3d563ff0a1a7b6b8043bd8f3 (patch)
tree76df3ed91810be53c2314a421b42c1b4390f2713
parent57666b3ff130c2fc69788ba1faaf6225f348a0bc (diff)
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.
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_2d.c15
1 files 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);