[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55224] trunk/blender/source/blender: style cleanup: also remove unused defines in paint_image.c

Campbell Barton ideasman42 at gmail.com
Wed Mar 13 06:23:54 CET 2013


Revision: 55224
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55224
Author:   campbellbarton
Date:     2013-03-13 05:23:53 +0000 (Wed, 13 Mar 2013)
Log Message:
-----------
style cleanup: also remove unused defines in paint_image.c

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/BKE_brush.h
    trunk/blender/source/blender/blenkernel/intern/brush.c
    trunk/blender/source/blender/editors/sculpt_paint/paint_image.c
    trunk/blender/source/blender/editors/sculpt_paint/paint_stroke.c
    trunk/blender/source/blender/editors/sculpt_paint/sculpt.c

Modified: trunk/blender/source/blender/blenkernel/BKE_brush.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_brush.h	2013-03-13 03:46:22 UTC (rev 55223)
+++ trunk/blender/source/blender/blenkernel/BKE_brush.h	2013-03-13 05:23:53 UTC (rev 55224)
@@ -69,10 +69,12 @@
 float BKE_brush_curve_strength(struct Brush *br, float p, const float len); /* used for sculpt */
 
 /* sampling */
-void BKE_brush_sample_tex(const struct Scene *scene, struct Brush *brush, const float sampleco[3], float rgba[4], const int thread, struct ImagePool *pool);
-float BKE_brush_sample_tex_3D(const Scene *scene, struct Brush *br,const float point[3],
-                               float rgba[3], struct ImagePool *pool);
-float BKE_brush_sample_tex_2D(const struct Scene *scene, struct Brush *brush, const float xy[2], float rgba[4], struct ImagePool *pool);
+void BKE_brush_sample_tex(const struct Scene *scene, struct Brush *brush, const float sampleco[3],
+                          float rgba[4], const int thread, struct ImagePool *pool);
+float BKE_brush_sample_tex_3D(const Scene *scene, struct Brush *br, const float point[3],
+                              float rgba[3], struct ImagePool *pool);
+float BKE_brush_sample_tex_2D(const struct Scene *scene, struct Brush *brush, const float xy[2],
+                              float rgba[4], struct ImagePool *pool);
 void BKE_brush_imbuf_new(const struct Scene *scene, struct Brush *brush, short flt, short texfalloff, int size,
                          struct ImBuf **imbuf, int use_color_correction);
 

Modified: trunk/blender/source/blender/blenkernel/intern/brush.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/brush.c	2013-03-13 03:46:22 UTC (rev 55223)
+++ trunk/blender/source/blender/blenkernel/intern/brush.c	2013-03-13 05:23:53 UTC (rev 55224)
@@ -516,9 +516,9 @@
 
 /* Return a multiplier for brush strength on a particular vertex. */
 float BKE_brush_sample_tex_3D(const Scene *scene, Brush *br,
-                          const float point[3],
-						  float rgba[3],
-                          struct ImagePool *pool)
+                              const float point[3],
+                              float rgba[3],
+                              struct ImagePool *pool)
 {
 	UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings;
 	MTex *mtex = &br->mtex;

Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_image.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_image.c	2013-03-13 03:46:22 UTC (rev 55223)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_image.c	2013-03-13 05:23:53 UTC (rev 55224)
@@ -103,11 +103,7 @@
 
 #define IMAPAINT_TILE_BITS          6
 #define IMAPAINT_TILE_SIZE          (1 << IMAPAINT_TILE_BITS)
-#define IMAPAINT_TILE_NUMBER(size)  (((size) + IMAPAINT_TILE_SIZE - 1) >> IMAPAINT_TILE_BITS)
 
-#define PROJ_VIEW_DATA_ID "view_data"
-#define PROJ_VIEW_DATA_SIZE (4 * 4 + 4 * 4 + 3) /* viewmat + winmat + clipsta + clipend + is_ortho */
-
 typedef struct UndoImageTile {
 	struct UndoImageTile *next, *prev;
 

Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_stroke.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_stroke.c	2013-03-13 03:46:22 UTC (rev 55223)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_stroke.c	2013-03-13 05:23:53 UTC (rev 55224)
@@ -204,14 +204,15 @@
 			halfway[1] = dy * 0.5f + stroke->initial_mouse[1];
 
 			if (stroke->get_location) {
-				if(stroke->get_location(C, out, halfway)) {
+				if (stroke->get_location(C, out, halfway)) {
 					hit = true;
 				}
-			} else {
+			}
+			else {
 				hit = true;
 			}
 		}
-		if(hit) {
+		if (hit) {
 			copy_v2_v2(ups->anchored_initial_mouse, halfway);
 			copy_v2_v2(ups->tex_mouse, halfway);
 			ups->anchored_size /= 2.0f;
@@ -464,12 +465,12 @@
 /* return true if the brush size can change during paint (normally used for pressure) */
 bool paint_supports_dynamic_size(Brush *br, PaintMode mode)
 {
-	if(br->flag & BRUSH_ANCHORED)
+	if (br->flag & BRUSH_ANCHORED)
 		return false;
 
-	switch(mode) {
+	switch (mode) {
 		case PAINT_SCULPT:
-	       if(ELEM4(br->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_THUMB, SCULPT_TOOL_ROTATE, SCULPT_TOOL_SNAKE_HOOK))
+			if (ELEM4(br->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_THUMB, SCULPT_TOOL_ROTATE, SCULPT_TOOL_SNAKE_HOOK))
 			return false;
 		default:
 			;
@@ -480,13 +481,13 @@
 /* return true if the brush size can change during paint (normally used for pressure) */
 bool paint_supports_moving_texture(Brush *br, PaintMode mode)
 {
-	if(br->flag & BRUSH_ANCHORED)
+	if (br->flag & BRUSH_ANCHORED)
 		return false;
 
-	switch(mode) {
+	switch (mode) {
 		case PAINT_SCULPT:
-	       if(ELEM4(br->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_THUMB, SCULPT_TOOL_ROTATE, SCULPT_TOOL_SNAKE_HOOK))
-			return false;
+			if (ELEM4(br->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_THUMB, SCULPT_TOOL_ROTATE, SCULPT_TOOL_SNAKE_HOOK))
+				return false;
 		default:
 			;
 		}

Modified: trunk/blender/source/blender/editors/sculpt_paint/sculpt.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/sculpt.c	2013-03-13 03:46:22 UTC (rev 55223)
+++ trunk/blender/source/blender/editors/sculpt_paint/sculpt.c	2013-03-13 05:23:53 UTC (rev 55224)
@@ -317,8 +317,8 @@
 /* Initialize a SculptOrigVertData for accessing original vertex data;
  * handles BMesh, mesh, and multires */
 static void sculpt_orig_vert_data_unode_init(SculptOrigVertData *data,
-											 Object *ob,
-											 SculptUndoNode *unode)
+                                             Object *ob,
+                                             SculptUndoNode *unode)
 {
 	SculptSession *ss = ob->sculpt;
 	BMesh *bm = ss->bm;
@@ -339,19 +339,18 @@
 /* Initialize a SculptOrigVertData for accessing original vertex data;
  * handles BMesh, mesh, and multires */
 static void sculpt_orig_vert_data_init(SculptOrigVertData *data,
-									   Object *ob,
-									   PBVHNode *node)
+                                       Object *ob,
+                                       PBVHNode *node)
 {
 	SculptUndoNode *unode;
 	unode = sculpt_undo_push_node(ob, node, SCULPT_UNDO_COORDS);
 	sculpt_orig_vert_data_unode_init(data, ob, unode);
-									 
 }
 
 /* Update a SculptOrigVertData for a particular vertex from the PBVH
  * iterator */
 static void sculpt_orig_vert_data_update(SculptOrigVertData *orig_data,
-										 PBVHVertexIter *iter)
+                                         PBVHVertexIter *iter)
 {
 	if (orig_data->unode->type == SCULPT_UNDO_COORDS) {
 		if (orig_data->coords) {
@@ -388,30 +387,30 @@
    Others, like smooth, are better without. Same goes for alt-
    key smoothing. */
 static int sculpt_stroke_dynamic_topology(const SculptSession *ss,
-										  const Brush *brush)
+                                          const Brush *brush)
 {
 	return ((BKE_pbvh_type(ss->pbvh) == PBVH_BMESH) &&
 
-			(!ss->cache || (!ss->cache->alt_smooth)) &&
+	        (!ss->cache || (!ss->cache->alt_smooth)) &&
 
-			/* Requires mesh restore, which doesn't work with
-			 * dynamic-topology */
-			!(brush->flag & BRUSH_ANCHORED) &&
-			!(brush->flag & BRUSH_RESTORE_MESH) &&
+	        /* Requires mesh restore, which doesn't work with
+	         * dynamic-topology */
+	        !(brush->flag & BRUSH_ANCHORED) &&
+	        !(brush->flag & BRUSH_RESTORE_MESH) &&
+        
+	        (!ELEM6(brush->sculpt_tool,
+	                /* These brushes, as currently coded, cannot
+	                 * support dynamic topology */
+	                SCULPT_TOOL_GRAB,
+	                SCULPT_TOOL_ROTATE,
+	                SCULPT_TOOL_THUMB,
+	                SCULPT_TOOL_LAYER,
 
-			(!ELEM6(brush->sculpt_tool,
-					/* These brushes, as currently coded, cannot
-					 * support dynamic topology */
-					SCULPT_TOOL_GRAB,
-					SCULPT_TOOL_ROTATE,
-					SCULPT_TOOL_THUMB,
-					SCULPT_TOOL_LAYER,
-
-					/* These brushes could handle dynamic topology,
-					 * but user feedback indicates it's better not
-					 * to */
-					SCULPT_TOOL_SMOOTH,
-					SCULPT_TOOL_MASK)));
+	                /* These brushes could handle dynamic topology,
+	                 * but user feedback indicates it's better not
+	                 * to */
+	                SCULPT_TOOL_SMOOTH,
+	                SCULPT_TOOL_MASK)));
 }
 
 /*** paint mesh ***/
@@ -440,7 +439,7 @@
 	for (n = 0; n < totnode; n++) {
 		SculptUndoNode *unode;
 		SculptUndoType type = (brush->sculpt_tool == SCULPT_TOOL_MASK ?
-							   SCULPT_UNDO_MASK : SCULPT_UNDO_COORDS);
+		                       SCULPT_UNDO_MASK : SCULPT_UNDO_COORDS);
 
 		if (ss->bm) {
 			unode = sculpt_undo_push_node(ob, nodes[n], type);
@@ -972,7 +971,8 @@
 			avg = paint_get_tex_pixel(br, x, y, ss->tex_pool);
 
 			avg += br->texture_sample_bias;
-		} else {
+		}
+		else {
 			avg = BKE_brush_sample_tex_3D(scene, br, point_2d, rgba, ss->tex_pool);
 		}
 	}




More information about the Bf-blender-cvs mailing list