[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55196] trunk/blender/source/blender/ editors/sculpt_paint/paint_image_proj.c: Minor cleanup: We always use colour correction now for float buffers.

Antony Riakiotakis kalast at gmail.com
Mon Mar 11 19:40:44 CET 2013


Revision: 55196
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55196
Author:   psy-fi
Date:     2013-03-11 18:40:43 +0000 (Mon, 11 Mar 2013)
Log Message:
-----------
Minor cleanup: We always use colour correction now for float buffers. Get rid of flag variable. 

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

Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_image_proj.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_image_proj.c	2013-03-11 18:11:07 UTC (rev 55195)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_image_proj.c	2013-03-11 18:40:43 UTC (rev 55196)
@@ -3751,26 +3751,16 @@
 	}
 }
 
-static void do_projectpaint_draw_f(ProjPaintState *ps, ProjPixel *projPixel, float rgba[4], float alpha, float mask, int use_color_correction)
+static void do_projectpaint_draw_f(ProjPaintState *ps, ProjPixel *projPixel, float rgba[4], float alpha, float mask)
 {
 	if (ps->is_texbrush) {
 		/* rgba already holds a texture result here from higher level function */
-		if (use_color_correction) {
-			float rgba_br[3];
-			srgb_to_linearrgb_v3_v3(rgba_br, ps->brush->rgb);
-			mul_v3_v3(rgba, rgba_br);
-		}
-		else {
-			mul_v3_v3(rgba, ps->brush->rgb);
-		}
+		float rgba_br[3];
+		srgb_to_linearrgb_v3_v3(rgba_br, ps->brush->rgb);
+		mul_v3_v3(rgba, rgba_br);
 	}
 	else {
-		if (use_color_correction) {
-			srgb_to_linearrgb_v3_v3(rgba, ps->brush->rgb);
-		}
-		else {
-			copy_v3_v3(rgba, ps->brush->rgb);
-		}
+		srgb_to_linearrgb_v3_v3(rgba, ps->brush->rgb);
 		rgba[3] = 1.0;
 	}
 
@@ -3810,7 +3800,6 @@
 	float falloff;
 	int bucket_index;
 	int is_floatbuf = 0;
-	int use_color_correction = FALSE;
 	const short tool =  ps->tool;
 	rctf bucket_bounds;
 
@@ -3866,7 +3855,6 @@
 
 					last_projIma->touch = 1;
 					is_floatbuf = last_projIma->ibuf->rect_float ? 1 : 0;
-					use_color_correction = TRUE;
 				}
 				/* end copy */
 
@@ -3962,7 +3950,6 @@
 
 								last_projIma->touch = 1;
 								is_floatbuf = last_projIma->ibuf->rect_float ? 1 : 0;
-								use_color_correction = TRUE;
 							}
 							/* end copy */
 
@@ -3998,7 +3985,7 @@
 									else do_projectpaint_soften(ps, projPixel, alpha, mask, softenArena, &softenPixels);
 									break;
 								default:
-									if (is_floatbuf) do_projectpaint_draw_f(ps, projPixel, rgba, alpha, mask, use_color_correction);
+									if (is_floatbuf) do_projectpaint_draw_f(ps, projPixel, rgba, alpha, mask);
 									else do_projectpaint_draw(ps, projPixel, rgba, alpha, mask);
 									break;
 							}
@@ -4164,7 +4151,7 @@
 		/* disable for 3d mapping also because painting on mirrored mesh can create "stripes" */
 		ps->do_masking = (brush->flag & BRUSH_AIRBRUSH || brush->mtex.brush_map_mode == MTEX_MAP_MODE_VIEW ||
 		                  brush->mtex.brush_map_mode == MTEX_MAP_MODE_3D) ? false : true;
-		ps->is_texbrush = (brush->mtex.tex) ? 1 : 0;
+		ps->is_texbrush = (brush->mtex.tex && brush->imagepaint_tool == PAINT_TOOL_DRAW) ? 1 : 0;
 	}
 	else {
 		/* brush may be NULL*/




More information about the Bf-blender-cvs mailing list