diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-10-21 11:58:38 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-10-21 11:58:38 +0400 |
commit | d599b643b7a1882ea79851e334d7ed133f362bb3 (patch) | |
tree | 4e4640c1b2e7cc82d9db81dbd98a39777dcbce7c /source/blender/blenkernel/intern | |
parent | f3ece5a108db0bdbefb4663ef4ebd9a7e039e263 (diff) |
style cleanup: bge, switch statements mostly.
also left bmesh decimator on in previous commit.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/cloth.c | 18 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/curve.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/implicit.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/material.c | 18 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/pointcache.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/smoke.c | 3 |
6 files changed, 22 insertions, 25 deletions
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index 1d23c374852..4e00e1bce0b 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -1050,29 +1050,25 @@ static void cloth_update_springs( ClothModifierData *clmd ) spring->stiffness = 0.0f; - if(spring->type == CLOTH_SPRING_TYPE_STRUCTURAL) - { + if (spring->type == CLOTH_SPRING_TYPE_STRUCTURAL) { spring->stiffness = (cloth->verts[spring->kl].struct_stiff + cloth->verts[spring->ij].struct_stiff) / 2.0f; } - else if(spring->type == CLOTH_SPRING_TYPE_SHEAR) - { + else if (spring->type == CLOTH_SPRING_TYPE_SHEAR) { spring->stiffness = (cloth->verts[spring->kl].shear_stiff + cloth->verts[spring->ij].shear_stiff) / 2.0f; } - else if(spring->type == CLOTH_SPRING_TYPE_BENDING) - { + else if (spring->type == CLOTH_SPRING_TYPE_BENDING) { spring->stiffness = (cloth->verts[spring->kl].bend_stiff + cloth->verts[spring->ij].bend_stiff) / 2.0f; } - else if(spring->type == CLOTH_SPRING_TYPE_GOAL) - { + else if (spring->type == CLOTH_SPRING_TYPE_GOAL) { /* Warning: Appending NEW goal springs does not work because implicit solver would need reset! */ /* Activate / Deactivate existing springs */ - if ((!(cloth->verts[spring->ij].flags & CLOTH_VERT_FLAG_PINNED)) && (cloth->verts[spring->ij].goal > ALMOST_ZERO)) + if ((!(cloth->verts[spring->ij].flags & CLOTH_VERT_FLAG_PINNED)) && + (cloth->verts[spring->ij].goal > ALMOST_ZERO)) { spring->flags &= ~CLOTH_SPRING_FLAG_DEACTIVATE; } - else - { + else { spring->flags |= CLOTH_SPRING_FLAG_DEACTIVATE; } } diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index e09e2eeb493..e7e645bd425 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -1476,7 +1476,7 @@ void BKE_curve_bevel_make(Scene *scene, Object *ob, ListBase *disp, int forRende } } else if (cu->ext1 == 0.0f && cu->ext2 == 0.0f) { - ; + /* pass */ } else if (cu->ext2 == 0.0f) { dl = MEM_callocN(sizeof(DispList), "makebevelcurve2"); diff --git a/source/blender/blenkernel/intern/implicit.c b/source/blender/blenkernel/intern/implicit.c index 787d5c65e9d..d1ef5d7376b 100644 --- a/source/blender/blenkernel/intern/implicit.c +++ b/source/blender/blenkernel/intern/implicit.c @@ -711,7 +711,7 @@ static void update_matrixS(ClothVertex *verts, int numverts, fmatrix3x3 *S) int i = 0; /* Clear matrix from old vertex constraints */ - for(i = 0; i < S[0].vcount; i++) + for (i = 0; i < S[0].vcount; i++) S[i].c = S[i].r = 0; /* Set new vertex constraints */ @@ -1662,7 +1662,7 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVec while (search) { // only handle active springs ClothSpring *spring = search->link; - if( !(spring->flags & CLOTH_SPRING_FLAG_DEACTIVATE)) + if (!(spring->flags & CLOTH_SPRING_FLAG_DEACTIVATE)) cloth_calc_spring_force(clmd, search->link, lF, lX, lV, dFdV, dFdX, time); search = search->next; diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 9951412063d..2f04df06d66 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -982,14 +982,16 @@ static void do_init_render_material(Material *ma, int r_mode, float *amb) if (ma->nodetree && ma->use_nodes) ntreeShaderGetTexcoMode(ma->nodetree, r_mode, &ma->texco, &ma->mode_l); - /* local group override */ - if((ma->shade_flag & MA_GROUP_LOCAL) && ma->id.lib && ma->group && ma->group->id.lib) { - Group *group; - - for(group= G.main->group.first; group; group= group->id.next) - if(!group->id.lib && strcmp(group->id.name, ma->group->id.name) == 0) - ma->group = group; - } + /* local group override */ + if ((ma->shade_flag & MA_GROUP_LOCAL) && ma->id.lib && ma->group && ma->group->id.lib) { + Group *group; + + for (group = G.main->group.first; group; group = group->id.next) { + if (!group->id.lib && strcmp(group->id.name, ma->group->id.name) == 0) { + ma->group = group; + } + } + } } static void init_render_nodetree(bNodeTree *ntree, Material *basemat, int r_mode, float *amb) diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 98dce0894a8..88f3eb15610 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -691,7 +691,7 @@ static int ptcache_smoke_read(PTCacheFile *pf, void *smoke_v) sds->dx = ch_dx; VECCOPY(sds->res, ch_res); sds->total_cells = ch_res[0]*ch_res[1]*ch_res[2]; - if(sds->flags & MOD_SMOKE_HIGHRES) { + if (sds->flags & MOD_SMOKE_HIGHRES) { smoke_reallocate_highres_fluid(sds, ch_dx, ch_res, 1); } } diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index c8d6ec73d28..4595b4bd78b 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -640,7 +640,6 @@ void smokeModifier_copy(struct SmokeModifierData *smd, struct SmokeModifierData tsmd->flow->flags = smd->flow->flags; } else if (tsmd->coll) { - ; /* leave it as initialized, collision settings is mostly caches */ } } @@ -699,7 +698,7 @@ static void obstacles_from_derivedmesh(Object *coll_ob, SmokeDomainSettings *sds numverts = dm->getNumVerts(dm); // DG TODO - // if(scs->type > SM_COLL_STATIC) + // if (scs->type > SM_COLL_STATIC) // if line above is used, the code is in trouble if the object moves but is declared as "does not move" { |