[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54057] trunk/blender/source/blender: style cleanup

Campbell Barton ideasman42 at gmail.com
Thu Jan 24 00:42:18 CET 2013


Revision: 54057
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54057
Author:   campbellbarton
Date:     2013-01-23 23:42:18 +0000 (Wed, 23 Jan 2013)
Log Message:
-----------
style cleanup

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/rigidbody.c
    trunk/blender/source/blender/editors/screen/area.c
    trunk/blender/source/blender/editors/space_node/drawnode.c
    trunk/blender/source/blender/makesdna/DNA_rigidbody_types.h
    trunk/blender/source/blender/makesrna/intern/rna_rigidbody.c
    trunk/blender/source/blender/rigidbody/rb_bullet_api.cpp

Modified: trunk/blender/source/blender/blenkernel/intern/rigidbody.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/rigidbody.c	2013-01-23 23:28:22 UTC (rev 54056)
+++ trunk/blender/source/blender/blenkernel/intern/rigidbody.c	2013-01-23 23:42:18 UTC (rev 54057)
@@ -466,7 +466,7 @@
 
 
 		RB_body_set_linear_factor(rbo->physics_object,
-								  (ob->protectflag & OB_LOCK_LOCX) == 0,
+		                          (ob->protectflag & OB_LOCK_LOCX) == 0,
 		                          (ob->protectflag & OB_LOCK_LOCY) == 0,
 		                          (ob->protectflag & OB_LOCK_LOCZ) == 0);
 		RB_body_set_angular_factor(rbo->physics_object,

Modified: trunk/blender/source/blender/editors/screen/area.c
===================================================================
--- trunk/blender/source/blender/editors/screen/area.c	2013-01-23 23:28:22 UTC (rev 54056)
+++ trunk/blender/source/blender/editors/screen/area.c	2013-01-23 23:42:18 UTC (rev 54057)
@@ -1882,7 +1882,7 @@
 	UI_ThemeColor(TH_TEXT_HI);
 	BLF_clipping(fontid, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
 	BLF_enable(fontid, BLF_CLIPPING);
-	BLF_position(fontid, rect.xmin + 0.6f * U.widget_unit, rect.ymin + 0.3f*U.widget_unit, 0.0f);
+	BLF_position(fontid, rect.xmin + 0.6f * U.widget_unit, rect.ymin + 0.3f * U.widget_unit, 0.0f);
 
 	BLF_draw(fontid, text, BLF_DRAW_STR_DUMMY_MAX);
 

Modified: trunk/blender/source/blender/editors/space_node/drawnode.c
===================================================================
--- trunk/blender/source/blender/editors/space_node/drawnode.c	2013-01-23 23:28:22 UTC (rev 54056)
+++ trunk/blender/source/blender/editors/space_node/drawnode.c	2013-01-23 23:42:18 UTC (rev 54057)
@@ -1169,9 +1169,9 @@
 		/* draw title (node label) */
 		BLI_strncpy(showname, node->label, sizeof(showname));
 		uiDefBut(node->block, LABEL, 0, showname,
-				 (int)(rct->xmin-NODE_DYS), (int)(rct->ymax),
-				 (short)512, (short)NODE_DY,
-				 NULL, 0, 0, 0, 0, "");
+		         (int)(rct->xmin - NODE_DYS), (int)(rct->ymax),
+		         (short)512, (short)NODE_DY,
+		         NULL, 0, 0, 0, 0, NULL);
 	}
 
 	/* only draw input socket. as they all are placed on the same position.

Modified: trunk/blender/source/blender/makesdna/DNA_rigidbody_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_rigidbody_types.h	2013-01-23 23:28:22 UTC (rev 54056)
+++ trunk/blender/source/blender/makesdna/DNA_rigidbody_types.h	2013-01-23 23:42:18 UTC (rev 54057)
@@ -136,19 +136,19 @@
 /* Flags for RigidBodyOb */
 typedef enum eRigidBodyOb_Flag {
 	/* rigidbody is kinematic (controlled by the animation system) */
-	RBO_FLAG_KINEMATIC			= (1<<0),
+	RBO_FLAG_KINEMATIC			= (1 << 0),
 	/* rigidbody needs to be validated (usually set after duplicating and not hooked up yet) */
-	RBO_FLAG_NEEDS_VALIDATE		= (1<<1),
+	RBO_FLAG_NEEDS_VALIDATE		= (1 << 1),
 	/* rigidbody shape needs refreshing (usually after exiting editmode) */
-	RBO_FLAG_NEEDS_RESHAPE		= (1<<2),
+	RBO_FLAG_NEEDS_RESHAPE		= (1 << 2),
 	/* rigidbody can be deactivated */
-	RBO_FLAG_USE_DEACTIVATION	= (1<<3),
+	RBO_FLAG_USE_DEACTIVATION	= (1 << 3),
 	/* rigidbody is deactivated at the beginning of simulation */
-	RBO_FLAG_START_DEACTIVATED	= (1<<4),
+	RBO_FLAG_START_DEACTIVATED	= (1 << 4),
 	/* rigidbody is not dynamically simulated */
-	RBO_FLAG_DISABLED			= (1<<5),
+	RBO_FLAG_DISABLED			= (1 << 5),
 	/* collision margin is not embedded (only used by convex hull shapes for now) */
-	RBO_FLAG_USE_MARGIN			= (1<<6)
+	RBO_FLAG_USE_MARGIN			= (1 << 6)
 } eRigidBodyOb_Flag;
 
 /* RigidBody Collision Shape */
@@ -250,26 +250,26 @@
 /* Flags for RigidBodyCon */
 typedef enum eRigidBodyCon_Flag {
 	/* constraint influences rigid body motion */
-	RBC_FLAG_ENABLED					= (1<<0),
+	RBC_FLAG_ENABLED					= (1 << 0),
 	/* constraint needs to be validated */
-	RBC_FLAG_NEEDS_VALIDATE				= (1<<1),
+	RBC_FLAG_NEEDS_VALIDATE				= (1 << 1),
 	/* allow constrained bodies to collide */
-	RBC_FLAG_DISABLE_COLLISIONS			= (1<<2),
+	RBC_FLAG_DISABLE_COLLISIONS			= (1 << 2),
 	/* constraint can break */
-	RBC_FLAG_USE_BREAKING				= (1<<3),
+	RBC_FLAG_USE_BREAKING				= (1 << 3),
 	/* constraint use custom number of constraint solver iterations */
-	RBC_FLAG_OVERRIDE_SOLVER_ITERATIONS	= (1<<4),
+	RBC_FLAG_OVERRIDE_SOLVER_ITERATIONS	= (1 << 4),
 	/* limits */
-	RBC_FLAG_USE_LIMIT_LIN_X			= (1<<5),
-	RBC_FLAG_USE_LIMIT_LIN_Y			= (1<<6),
-	RBC_FLAG_USE_LIMIT_LIN_Z			= (1<<7),
-	RBC_FLAG_USE_LIMIT_ANG_X			= (1<<8),
-	RBC_FLAG_USE_LIMIT_ANG_Y			= (1<<9),
-	RBC_FLAG_USE_LIMIT_ANG_Z			= (1<<10),
+	RBC_FLAG_USE_LIMIT_LIN_X			= (1 << 5),
+	RBC_FLAG_USE_LIMIT_LIN_Y			= (1 << 6),
+	RBC_FLAG_USE_LIMIT_LIN_Z			= (1 << 7),
+	RBC_FLAG_USE_LIMIT_ANG_X			= (1 << 8),
+	RBC_FLAG_USE_LIMIT_ANG_Y			= (1 << 9),
+	RBC_FLAG_USE_LIMIT_ANG_Z			= (1 << 10),
 	/* springs */
-	RBC_FLAG_USE_SPRING_X				= (1<<11),
-	RBC_FLAG_USE_SPRING_Y				= (1<<12),
-	RBC_FLAG_USE_SPRING_Z				= (1<<13)
+	RBC_FLAG_USE_SPRING_X				= (1 << 11),
+	RBC_FLAG_USE_SPRING_Y				= (1 << 12),
+	RBC_FLAG_USE_SPRING_Z				= (1 << 13)
 } eRigidBodyCon_Flag;
 
 /* ******************************** */

Modified: trunk/blender/source/blender/makesrna/intern/rna_rigidbody.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_rigidbody.c	2013-01-23 23:28:22 UTC (rev 54056)
+++ trunk/blender/source/blender/makesrna/intern/rna_rigidbody.c	2013-01-23 23:42:18 UTC (rev 54057)
@@ -538,13 +538,13 @@
 	/* groups */
 	prop = RNA_def_property(srna, "group", PROP_POINTER, PROP_NONE);
 	RNA_def_property_struct_type(prop, "Group");
-	RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
+	RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK);
 	RNA_def_property_ui_text(prop, "Group", "Group containing objects participating in this simulation");
 	RNA_def_property_update(prop, NC_SCENE, "rna_RigidBodyWorld_reset");
 
 	prop = RNA_def_property(srna, "constraints", PROP_POINTER, PROP_NONE);
 	RNA_def_property_struct_type(prop, "Group");
-	RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
+	RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK);
 	RNA_def_property_ui_text(prop, "Constraints", "Group containing rigid body constraint objects");
 	RNA_def_property_update(prop, NC_SCENE, "rna_RigidBodyWorld_reset");
 	

Modified: trunk/blender/source/blender/rigidbody/rb_bullet_api.cpp
===================================================================
--- trunk/blender/source/blender/rigidbody/rb_bullet_api.cpp	2013-01-23 23:28:22 UTC (rev 54056)
+++ trunk/blender/source/blender/rigidbody/rb_bullet_api.cpp	2013-01-23 23:42:18 UTC (rev 54057)
@@ -94,10 +94,10 @@
 
 struct rbFilterCallback : public btOverlapFilterCallback
 {
-	virtual bool	needBroadphaseCollision(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1) const
+	virtual bool needBroadphaseCollision(btBroadphaseProxy *proxy0, btBroadphaseProxy *proxy1) const
 	{
-		rbRigidBody *rb0 = (rbRigidBody*)((btRigidBody*)proxy0->m_clientObject)->getUserPointer();
-		rbRigidBody *rb1 = (rbRigidBody*)((btRigidBody*)proxy1->m_clientObject)->getUserPointer();
+		rbRigidBody *rb0 = (rbRigidBody *)((btRigidBody *)proxy0->m_clientObject)->getUserPointer();
+		rbRigidBody *rb1 = (rbRigidBody *)((btRigidBody *)proxy1->m_clientObject)->getUserPointer();
 		
 		bool collides;
 		collides = (proxy0->m_collisionFilterGroup & proxy1->m_collisionFilterMask) != 0;
@@ -135,19 +135,22 @@
 	world->collisionConfiguration = new btDefaultCollisionConfiguration();
 	
 	world->dispatcher = new btCollisionDispatcher(world->collisionConfiguration);
-	btGImpactCollisionAlgorithm::registerAlgorithm((btCollisionDispatcher*)world->dispatcher); // XXX: experimental
+	btGImpactCollisionAlgorithm::registerAlgorithm((btCollisionDispatcher *)world->dispatcher); // XXX: experimental
 	
 	world->pairCache = new btDbvtBroadphase();
 	
 	world->filterCallback = new rbFilterCallback();
 	world->pairCache->getOverlappingPairCache()->setOverlapFilterCallback(world->filterCallback);
-	
+
 	/* constraint solving */
 	world->constraintSolver = new btSequentialImpulseConstraintSolver();
-	
+
 	/* world */
-	world->dynamicsWorld = new btDiscreteDynamicsWorld(world->dispatcher,world->pairCache,world->constraintSolver,world->collisionConfiguration);
-	
+	world->dynamicsWorld = new btDiscreteDynamicsWorld(world->dispatcher,
+	                                                   world->pairCache,
+	                                                   world->constraintSolver,
+	                                                   world->collisionConfiguration);
+
 	RB_dworld_set_gravity(world, gravity);
 	
 	return world;
@@ -211,13 +214,13 @@
 void RB_dworld_export(rbDynamicsWorld *world, const char *filename)
 {
 	//create a large enough buffer. There is no method to pre-calculate the buffer size yet.
-	int maxSerializeBufferSize = 1024*1024*5;
+	int maxSerializeBufferSize = 1024 * 1024 * 5;
 	
 	btDefaultSerializer *serializer = new btDefaultSerializer(maxSerializeBufferSize);
 	world->dynamicsWorld->serialize(serializer);
 	
 	FILE *file = fopen(filename, "wb");
-	fwrite(serializer->getBufferPointer(),serializer->getCurrentBufferSize(),1, file);
+	fwrite(serializer->getBufferPointer(), serializer->getCurrentBufferSize(), 1, file);
 	fclose(file);
 }
 
@@ -280,7 +283,7 @@
 	/* manually remove constraint refs of the rigid body, normally this happens when removing constraints from the world
 	 * but since we delete everything when the world is rebult, we need to do it manually here */
 	for (int i = body->getNumConstraintRefs() - 1; i >= 0; i--) {
-		btTypedConstraint* con = body->getConstraintRef(i);
+		btTypedConstraint *con = body->getConstraintRef(i);
 		body->removeConstraintRef(con);
 	}
 	
@@ -321,7 +324,7 @@
 void RB_body_set_mass(rbRigidBody *object, float value)
 {
 	btRigidBody *body = object->body;
-	btVector3 localInertia(0,0,0);
+	btVector3 localInertia(0, 0, 0);
 	
 	/* calculate new inertia if non-zero mass */
 	if (value) {
@@ -510,7 +513,7 @@
 	btTransform trans;
 	ms->getWorldTransform(trans);
 	
-	trans.getOpenGLMatrix((btScalar*)m_out);
+	trans.getOpenGLMatrix((btScalar *)m_out);
 }
 
 void RB_body_set_loc_rot(rbRigidBody *object, const float loc[3], const float rot[4])
@@ -643,7 +646,7 @@

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list