[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55669] trunk/blender/source/blender/ editors/sculpt_paint/paint_image_2d.c: Slight cleanup for 2d painting.

Antony Riakiotakis kalast at gmail.com
Fri Mar 29 16:18:22 CET 2013


Revision: 55669
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55669
Author:   psy-fi
Date:     2013-03-29 15:18:22 +0000 (Fri, 29 Mar 2013)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/sculpt_paint/paint_image_2d.c

Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_image_2d.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_image_2d.c	2013-03-29 14:02:28 UTC (rev 55668)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_image_2d.c	2013-03-29 15:18:22 UTC (rev 55669)
@@ -87,11 +87,8 @@
 #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 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 @@
 
 	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 @@
 	/* 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);




More information about the Bf-blender-cvs mailing list