diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-28 09:03:24 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-28 09:03:24 +0400 |
commit | 07065b27b8b37316004f40896f436d26e066f25f (patch) | |
tree | 19713fa864612e094f21a881e9816a8e1bf42b7b /source/gameengine/Converter | |
parent | c9f677d24d9600d9ba07f1b258c49455bc348554 (diff) |
style cleanup
Diffstat (limited to 'source/gameengine/Converter')
8 files changed, 53 insertions, 53 deletions
diff --git a/source/gameengine/Converter/BL_ArmatureObject.cpp b/source/gameengine/Converter/BL_ArmatureObject.cpp index f4c437c04ec..f9ddc258cfe 100644 --- a/source/gameengine/Converter/BL_ArmatureObject.cpp +++ b/source/gameengine/Converter/BL_ArmatureObject.cpp @@ -146,7 +146,7 @@ void game_blend_poses(bPose *dst, bPose *src, float srcweight/*, short mode*/) float dstweight; int i; - switch (mode){ + switch (mode) { case ACTSTRIPMODE_BLEND: dstweight = 1.0F - srcweight; break; @@ -158,7 +158,7 @@ void game_blend_poses(bPose *dst, bPose *src, float srcweight/*, short mode*/) } schan= (bPoseChannel*)src->chanbase.first; - for (dchan = (bPoseChannel*)dst->chanbase.first; dchan; dchan=(bPoseChannel*)dchan->next, schan= (bPoseChannel*)schan->next){ + for (dchan = (bPoseChannel*)dst->chanbase.first; dchan; dchan=(bPoseChannel*)dchan->next, schan= (bPoseChannel*)schan->next) { // always blend on all channels since we don't know which one has been set /* quat interpolation done separate */ if (schan->rotmode == ROT_MODE_QUAT) { @@ -502,7 +502,7 @@ void BL_ArmatureObject::SetPose(bPose *pose) bool BL_ArmatureObject::SetActiveAction(BL_ActionActuator *act, short priority, double curtime) { - if (curtime != m_lastframe){ + if (curtime != m_lastframe) { m_activePriority = 9999; // compute the timestep for the underlying IK algorithm m_timestep = curtime-m_lastframe; diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 1805214c6a2..9c59bf78041 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -740,7 +740,7 @@ bool ConvertMaterial( int valid = 0; // check for tface tex to fallback on - if ( validface ){ + if ( validface ) { material->img[0] = (Image*)(tface->tpage); // ------------------------ if (material->img[0]) { @@ -2128,7 +2128,7 @@ void RBJconstraints(Object *ob)//not used #include "KX_IPhysicsController.h" #include "PHY_DynamicTypes.h" -KX_IPhysicsController* getPhId(CListValue* sumolist,STR_String busc){//not used +KX_IPhysicsController* getPhId(CListValue* sumolist,STR_String busc) {//not used for (int j=0;j<sumolist->GetCount();j++) { @@ -2180,7 +2180,7 @@ static void bl_ConvertBlenderObject_Single( ); MT_Vector3 eulxyz(blenderobject->rot); MT_Vector3 scale(blenderobject->size); - if (converter->addInitFromFrame){//rcruiz + if (converter->addInitFromFrame) {//rcruiz float eulxyzPrev[3]; blenderscene->r.cfra=blenderscene->r.sfra-1; //XXX update_for_newframe(); @@ -2277,7 +2277,7 @@ static void bl_ConvertBlenderObject_Single( logicbrick_conversionlist->Add(gameobj->AddRef()); - if (converter->addInitFromFrame){ + if (converter->addInitFromFrame) { posPrev=gameobj->NodeGetWorldPosition(); angor=gameobj->NodeGetWorldOrientation(); } @@ -2533,10 +2533,10 @@ void BL_ConvertBlenderObjects(struct Main* maggie, if (blenderobj->type==OB_MESH) { Mesh *me = (Mesh*)blenderobj->data; - if (me->dvert){ + if (me->dvert) { BL_DeformableGameObject *obj = (BL_DeformableGameObject*)converter->FindGameObject(blenderobj); - if (obj && BL_ModifierDeformer::HasArmatureDeformer(blenderobj) && blenderobj->parent && blenderobj->parent->type==OB_ARMATURE){ + if (obj && BL_ModifierDeformer::HasArmatureDeformer(blenderobj) && blenderobj->parent && blenderobj->parent->type==OB_ARMATURE) { KX_GameObject *par = converter->FindGameObject(blenderobj->parent); if (par && obj->GetDeformer()) ((BL_SkinDeformer*)obj->GetDeformer())->SetArmature((BL_ArmatureObject*) par); @@ -2722,7 +2722,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie, for (i=0;i<sumolist->GetCount();i++) { KX_GameObject* gameobj = (KX_GameObject*) sumolist->GetValue(i); - if (gameobj->IsDynamic()){ + if (gameobj->IsDynamic()) { gameobj->setLinearVelocity(inivel[i],false); gameobj->setAngularVelocity(iniang[i],false); } @@ -2744,11 +2744,11 @@ void BL_ConvertBlenderObjects(struct Main* maggie, if (conlist) { for (curcon = (bConstraint *)conlist->first; curcon; curcon=(bConstraint *)curcon->next) { - if (curcon->type==CONSTRAINT_TYPE_RIGIDBODYJOINT){ + if (curcon->type==CONSTRAINT_TYPE_RIGIDBODYJOINT) { bRigidBodyJointConstraint *dat=(bRigidBodyJointConstraint *)curcon->data; - if (!dat->child){ + if (!dat->child) { PHY_IPhysicsController* physctr2 = 0; diff --git a/source/gameengine/Converter/BL_DeformableGameObject.cpp b/source/gameengine/Converter/BL_DeformableGameObject.cpp index f6d9b4a5065..dd4c51b5403 100644 --- a/source/gameengine/Converter/BL_DeformableGameObject.cpp +++ b/source/gameengine/Converter/BL_DeformableGameObject.cpp @@ -60,7 +60,7 @@ CValue* BL_DeformableGameObject::GetReplica() bool BL_DeformableGameObject::SetActiveAction(BL_ShapeActionActuator *act, short priority, double curtime) { - if (curtime != m_lastframe){ + if (curtime != m_lastframe) { m_activePriority = 9999; m_lastframe= curtime; m_activeAct = NULL; diff --git a/source/gameengine/Converter/BL_MeshDeformer.cpp b/source/gameengine/Converter/BL_MeshDeformer.cpp index f2c30193613..682ff57be6b 100644 --- a/source/gameengine/Converter/BL_MeshDeformer.cpp +++ b/source/gameengine/Converter/BL_MeshDeformer.cpp @@ -225,7 +225,7 @@ void BL_MeshDeformer::RecalcNormals() void BL_MeshDeformer::VerifyStorage() { /* Ensure that we have the right number of verts assigned */ - if (m_tvtot!=m_bmesh->totvert){ + if (m_tvtot!=m_bmesh->totvert) { if (m_transverts) delete [] m_transverts; if (m_transnors) diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.cpp b/source/gameengine/Converter/BL_ShapeActionActuator.cpp index a730041cdae..13e79b13304 100644 --- a/source/gameengine/Converter/BL_ShapeActionActuator.cpp +++ b/source/gameengine/Converter/BL_ShapeActionActuator.cpp @@ -222,22 +222,22 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame) priority = m_priority; /* Determine pre-incrementation behavior and set appropriate flags */ - switch (m_playtype){ + switch (m_playtype) { case ACT_ACTION_MOTION: - if (bNegativeEvent){ + if (bNegativeEvent) { keepgoing=false; apply=false; }; break; case ACT_ACTION_FROM_PROP: - if (bNegativeEvent){ + if (bNegativeEvent) { apply=false; keepgoing=false; } break; case ACT_ACTION_LOOP_END: - if (bPositiveEvent){ - if (!(m_flag & ACT_FLAG_LOCKINPUT)){ + if (bPositiveEvent) { + if (!(m_flag & ACT_FLAG_LOCKINPUT)) { m_flag &= ~ACT_FLAG_KEYUP; m_flag &= ~ACT_FLAG_REVERSE; m_flag |= ACT_FLAG_LOCKINPUT; @@ -245,20 +245,20 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame) m_starttime = curtime; } } - if (bNegativeEvent){ + if (bNegativeEvent) { m_flag |= ACT_FLAG_KEYUP; } break; case ACT_ACTION_LOOP_STOP: - if (bPositiveEvent){ - if (!(m_flag & ACT_FLAG_LOCKINPUT)){ + if (bPositiveEvent) { + if (!(m_flag & ACT_FLAG_LOCKINPUT)) { m_flag &= ~ACT_FLAG_REVERSE; m_flag &= ~ACT_FLAG_KEYUP; m_flag |= ACT_FLAG_LOCKINPUT; SetStartTime(curtime); } } - if (bNegativeEvent){ + if (bNegativeEvent) { m_flag |= ACT_FLAG_KEYUP; m_flag &= ~ACT_FLAG_LOCKINPUT; keepgoing=false; @@ -266,8 +266,8 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame) } break; case ACT_ACTION_PINGPONG: - if (bPositiveEvent){ - if (!(m_flag & ACT_FLAG_LOCKINPUT)){ + if (bPositiveEvent) { + if (!(m_flag & ACT_FLAG_LOCKINPUT)) { m_flag &= ~ACT_FLAG_KEYUP; m_localtime = m_starttime; m_starttime = curtime; @@ -276,22 +276,22 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame) } break; case ACT_ACTION_FLIPPER: - if (bPositiveEvent){ - if (!(m_flag & ACT_FLAG_LOCKINPUT)){ + if (bPositiveEvent) { + if (!(m_flag & ACT_FLAG_LOCKINPUT)) { m_flag &= ~ACT_FLAG_REVERSE; m_flag |= ACT_FLAG_LOCKINPUT; SetStartTime(curtime); } } - else if (bNegativeEvent){ + else if (bNegativeEvent) { m_flag |= ACT_FLAG_REVERSE; m_flag &= ~ACT_FLAG_LOCKINPUT; SetStartTime(curtime); } break; case ACT_ACTION_PLAY: - if (bPositiveEvent){ - if (!(m_flag & ACT_FLAG_LOCKINPUT)){ + if (bPositiveEvent) { + if (!(m_flag & ACT_FLAG_LOCKINPUT)) { m_flag &= ~ACT_FLAG_REVERSE; m_localtime = m_starttime; m_starttime = curtime; @@ -304,8 +304,8 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame) } /* Perform increment */ - if (keepgoing){ - if (m_playtype == ACT_ACTION_MOTION){ + if (keepgoing) { + if (m_playtype == ACT_ACTION_MOTION) { MT_Point3 newpos; MT_Point3 deltapos; @@ -322,7 +322,7 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame) } /* Check if a wrapping response is needed */ - if (length){ + if (length) { if (m_localtime < m_startframe || m_localtime > m_endframe) { m_localtime = m_startframe + fmod(m_localtime, length); @@ -333,14 +333,14 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame) m_localtime = m_startframe; /* Perform post-increment tasks */ - switch (m_playtype){ + switch (m_playtype) { case ACT_ACTION_FROM_PROP: { CValue* propval = GetParent()->GetProperty(m_propname); if (propval) m_localtime = propval->GetNumber(); - if (bNegativeEvent){ + if (bNegativeEvent) { keepgoing=false; } } @@ -350,7 +350,7 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame) case ACT_ACTION_LOOP_STOP: break; case ACT_ACTION_PINGPONG: - if (wrap){ + if (wrap) { if (!(m_flag & ACT_FLAG_REVERSE)) m_localtime = m_endframe; else @@ -362,8 +362,8 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame) } break; case ACT_ACTION_FLIPPER: - if (wrap){ - if (!(m_flag & ACT_FLAG_REVERSE)){ + if (wrap) { + if (!(m_flag & ACT_FLAG_REVERSE)) { m_localtime=m_endframe; //keepgoing = false; } @@ -374,8 +374,8 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame) } break; case ACT_ACTION_LOOP_END: - if (wrap){ - if (m_flag & ACT_FLAG_KEYUP){ + if (wrap) { + if (m_flag & ACT_FLAG_KEYUP) { keepgoing = false; m_localtime = m_endframe; m_flag &= ~ACT_FLAG_LOCKINPUT; @@ -384,7 +384,7 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame) } break; case ACT_ACTION_PLAY: - if (wrap){ + if (wrap) { m_localtime = m_endframe; keepgoing = false; m_flag &= ~ACT_FLAG_LOCKINPUT; @@ -415,7 +415,7 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame) if (apply) { /* Priority test */ - if (obj->SetActiveAction(this, priority, curtime)){ + if (obj->SetActiveAction(this, priority, curtime)) { BL_ShapeDeformer *shape_deformer = dynamic_cast<BL_ShapeDeformer*>(obj->GetDeformer()); Key *key = NULL; @@ -430,7 +430,7 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame) else { ListBase tchanbase= {NULL, NULL}; - if (m_blendin && m_blendframe==0.0f){ + if (m_blendin && m_blendframe==0.0f) { // this is the start of the blending, remember the startup shape obj->GetShape(m_blendshape); m_blendstart = curtime; @@ -451,7 +451,7 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame) } else { // the key have changed, apply blending if needed - if (m_blendin && (m_blendframe<m_blendin)){ + if (m_blendin && (m_blendframe<m_blendin)) { newweight = (m_blendframe/(float)m_blendin); BlendShape(key, 1.0f - newweight); @@ -471,7 +471,7 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame) } } - if (!keepgoing){ + if (!keepgoing) { m_blendframe = 0.0f; } return keepgoing; diff --git a/source/gameengine/Converter/BL_SkinDeformer.cpp b/source/gameengine/Converter/BL_SkinDeformer.cpp index 85010ce1bbf..2aa97370330 100644 --- a/source/gameengine/Converter/BL_SkinDeformer.cpp +++ b/source/gameengine/Converter/BL_SkinDeformer.cpp @@ -305,7 +305,7 @@ void BL_SkinDeformer::BGEDeformVerts() bool BL_SkinDeformer::UpdateInternal(bool shape_applied) { /* See if the armature has been updated for this frame */ - if (PoseUpdated()){ + if (PoseUpdated()) { if (!shape_applied) { /* store verts locally */ diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp index d82a911b4ab..bbb990462bd 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp @@ -661,7 +661,7 @@ void KX_BlenderSceneConverter::ResetPhysicsObjectsAnimationIpo(bool clearIpo) Ipo* ipo = blenderObject->ipo;//findIpoForName(blenderObject->id.name+2); if (ipo) { //clear the curve data - if (clearIpo){//rcruiz + if (clearIpo) {//rcruiz IpoCurve *icu1; int numCurves = 0; @@ -671,7 +671,7 @@ void KX_BlenderSceneConverter::ResetPhysicsObjectsAnimationIpo(bool clearIpo) /*int i; BezTriple *bezt; - for ( bezt = tmpicu->bezt, i = 0; i < tmpicu->totvert; i++, bezt++){ + for ( bezt = tmpicu->bezt, i = 0; i < tmpicu->totvert; i++, bezt++) { printf("(%f,%f,%f),(%f,%f,%f),(%f,%f,%f)\n",bezt->vec[0][0],bezt->vec[0][1],bezt->vec[0][2],bezt->vec[1][0],bezt->vec[1][1],bezt->vec[1][2],bezt->vec[2][0],bezt->vec[2][1],bezt->vec[2][2]); }*/ @@ -705,15 +705,15 @@ void KX_BlenderSceneConverter::ResetPhysicsObjectsAnimationIpo(bool clearIpo) void KX_BlenderSceneConverter::resetNoneDynamicObjectToIpo() { - if (addInitFromFrame){ + if (addInitFromFrame) { KX_SceneList* scenes = m_ketsjiEngine->CurrentScenes(); int numScenes = scenes->size(); - if (numScenes>=0){ + if (numScenes>=0) { KX_Scene* scene = scenes->at(0); CListValue* parentList = scene->GetRootParentList(); - for (int ix=0;ix<parentList->GetCount();ix++){ + for (int ix=0;ix<parentList->GetCount();ix++) { KX_GameObject* gameobj = (KX_GameObject*)parentList->GetValue(ix); - if (!gameobj->IsDynamic()){ + if (!gameobj->IsDynamic()) { Object* blenderobject = gameobj->GetBlenderObject(); if (!blenderobject) continue; diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp index af7875e0b4f..07680297b7d 100644 --- a/source/gameengine/Converter/KX_ConvertActuators.cpp +++ b/source/gameengine/Converter/KX_ConvertActuators.cpp @@ -232,7 +232,7 @@ void BL_ConvertActuators(const char* maggiename, } case ACT_SHAPEACTION: { - if (blenderobject->type==OB_MESH){ + if (blenderobject->type==OB_MESH) { bActionActuator* actact = (bActionActuator*) bact->data; STR_String propname = (actact->name ? actact->name : ""); STR_String propframe = (actact->frameProp ? actact->frameProp : ""); |