[Bf-blender-cvs] [8a21566] master: Cleanup

Campbell Barton noreply at git.blender.org
Fri Aug 29 07:35:49 CEST 2014


Commit: 8a215669e8668b81610903a80a0c11e1cf64ccac
Author: Campbell Barton
Date:   Fri Aug 29 15:35:19 2014 +1000
Branches: master
https://developer.blender.org/rB8a215669e8668b81610903a80a0c11e1cf64ccac

Cleanup

===================================================================

M	source/blender/blenlib/BLI_dial.h
M	source/blender/blenlib/intern/BLI_dial.c
M	source/blender/editors/sculpt_paint/paint_image.c
M	source/blender/editors/sculpt_paint/paint_image_proj.c

===================================================================

diff --git a/source/blender/blenlib/BLI_dial.h b/source/blender/blenlib/BLI_dial.h
index 61420f4..c8b57e8 100644
--- a/source/blender/blenlib/BLI_dial.h
+++ b/source/blender/blenlib/BLI_dial.h
@@ -52,8 +52,8 @@
 
 typedef struct Dial Dial;
 
-Dial * BLI_dial_initialize(float start_position[2], float threshold);
+Dial *BLI_dial_initialize(float start_position[2], float threshold);
 
 float BLI_dial_angle(Dial *dial, float current_position[2]);
 
-#endif /* __BLI_DIAL_H__ */
\ No newline at end of file
+#endif /* __BLI_DIAL_H__ */
diff --git a/source/blender/blenlib/intern/BLI_dial.c b/source/blender/blenlib/intern/BLI_dial.c
index 943e0b2..cfbb528 100644
--- a/source/blender/blenlib/intern/BLI_dial.c
+++ b/source/blender/blenlib/intern/BLI_dial.c
@@ -46,7 +46,7 @@ struct Dial {
 };
 
 
-Dial * BLI_dial_initialize(float start_position[2], float threshold)
+Dial *BLI_dial_initialize(float start_position[2], float threshold)
 {
 	Dial *dial = MEM_callocN(sizeof(Dial), "dial");
 	
@@ -79,13 +79,14 @@ float BLI_dial_angle(Dial *dial, float current_position[2])
 		sinval = cross_v2v2(current_direction, dial->initial_direction);
 		
 		/* clamp to avoid nans in acos */
-		angle = atan2(sinval, cosval);
+		angle = atan2f(sinval, cosval);
 		
 		/* change of sign, we passed the 180 degree threshold. This means we need to add a turn.
 		 * to distinguish between transition from 0 to -1 and -PI to +PI, use comparison with PI/2 */
-		if ((angle * dial->last_angle < 0.0f) && (fabsf(dial->last_angle) > (float)M_PI_2))
+		if ((angle * dial->last_angle < 0.0f) &&
+		    (fabsf(dial->last_angle) > (float)M_PI_2))
 		{
-			if (dial->last_angle < 0)
+			if (dial->last_angle < 0.0f)
 				dial->rotations--;
 			else
 				dial->rotations++;
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index f0176bc..0d65a28 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -1413,12 +1413,12 @@ void paint_proj_mesh_data_ensure(bContext *C, Object *ob, wmOperator *op)
 					Material *ma = BKE_material_add(CTX_data_main(C), "Material");
 					/* no material found, just assign to first slot */
 					assign_material(ob, ma, i, BKE_MAT_ASSIGN_USERPREF);
-					proj_paint_add_slot(C, ma, NULL);				
+					proj_paint_add_slot(C, ma, NULL);
 				}
 			}
 		}
 	}
-	else if (imapaint->mode == IMAGEPAINT_MODE_IMAGE){
+	else if (imapaint->mode == IMAGEPAINT_MODE_IMAGE) {
 		if (imapaint->canvas == NULL) {
 			int width;
 			int height;
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index 3c6fb5d..fbe0a69 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -4518,9 +4518,9 @@ static void project_state_init(bContext *C, Object *ob, ProjPaintState *ps, int
 	ps->do_material_slots = (settings->imapaint.mode == IMAGEPAINT_MODE_MATERIAL);
 	ps->stencil_ima = settings->imapaint.stencil;
 	ps->canvas_ima = (!ps->do_material_slots) ? 
-						 settings->imapaint.canvas : NULL;
+	                 settings->imapaint.canvas : NULL;
 	ps->clone_ima = (!ps->do_material_slots) ? 
-						 settings->imapaint.clone : NULL;
+	                settings->imapaint.clone : NULL;
 
 	/* setup projection painting data */
 	ps->do_backfacecull = (settings->imapaint.flag & IMAGEPAINT_PROJECT_BACKFACE) ? 0 : 1;




More information about the Bf-blender-cvs mailing list