diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-09-26 02:05:40 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-09-26 02:05:40 +0400 |
commit | 3b2962f2ab755b9185381b9ff29c8abcd775c701 (patch) | |
tree | 6e43c356efa3bb72d346d38cf042689195a12bec /source | |
parent | 29ad5fc5e88ef262f36b8963b8e373de651041d1 (diff) |
remove redundant NULL checks in somepledeform modifier (dcut is never NULL).
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/modifiers/intern/MOD_simpledeform.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/source/blender/modifiers/intern/MOD_simpledeform.c b/source/blender/modifiers/intern/MOD_simpledeform.c index 5c570d8d1ef..44ebc76e4a1 100644 --- a/source/blender/modifiers/intern/MOD_simpledeform.c +++ b/source/blender/modifiers/intern/MOD_simpledeform.c @@ -72,7 +72,7 @@ static void simpleDeform_taper(const float factor, const float dcut[3], float r_ r_co[1] = y + y * scale; r_co[2] = z; - if (dcut) { + { r_co[0] += dcut[0]; r_co[1] += dcut[1]; r_co[2] += dcut[2]; @@ -90,7 +90,7 @@ static void simpleDeform_stretch(const float factor, const float dcut[3], float r_co[1] = y * scale; r_co[2] = z * (1.0f + factor); - if (dcut) { + { r_co[0] += dcut[0]; r_co[1] += dcut[1]; r_co[2] += dcut[2]; @@ -110,7 +110,7 @@ static void simpleDeform_twist(const float factor, const float *dcut, float r_co r_co[1] = x * sint + y * cost; r_co[2] = z; - if (dcut) { + { r_co[0] += dcut[0]; r_co[1] += dcut[1]; r_co[2] += dcut[2]; @@ -132,7 +132,7 @@ static void simpleDeform_bend(const float factor, const float dcut[3], float r_c r_co[2] = z; } - if (dcut) { + { r_co[0] += cost * dcut[0]; r_co[1] += sint * dcut[0]; r_co[2] += dcut[2]; @@ -163,7 +163,7 @@ static void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object smd->limit[0] = minf(smd->limit[0], smd->limit[1]); /* Upper limit >= than lower limit */ - //Calculate matrixs do convert between coordinate spaces + /* Calculate matrixs do convert between coordinate spaces */ if (smd->origin) { transf = &tmp_transf; @@ -176,10 +176,11 @@ static void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object } } - //Setup vars - limit_axis = (smd->mode == MOD_SIMPLEDEFORM_MODE_BEND) ? 0 : 2; //Bend limits on X.. all other modes limit on Z + /* Setup vars, + * Bend limits on X.. all other modes limit on Z */ + limit_axis = (smd->mode == MOD_SIMPLEDEFORM_MODE_BEND) ? 0 : 2; - //Update limits if needed + /* Update limits if needed */ { float lower = FLT_MAX; float upper = -FLT_MAX; @@ -199,7 +200,7 @@ static void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object smd_limit[1] = lower + (upper - lower) * smd->limit[1]; smd_limit[0] = lower + (upper - lower) * smd->limit[0]; - smd_factor = smd->factor / MAX2(FLT_EPSILON, smd_limit[1] - smd_limit[0]); + smd_factor = smd->factor / maxf(FLT_EPSILON, smd_limit[1] - smd_limit[0]); } modifier_get_vgroup(ob, dm, smd->vgroup_name, &dvert, &vgroup); @@ -235,7 +236,9 @@ static void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object simpleDeform_callback(smd_factor, dcut, co); /* apply deform */ interp_v3_v3v3(vertexCos[i], vertexCos[i], co, weight); /* Use vertex weight has coef of linear interpolation */ - if (transf) space_transform_invert(transf, vertexCos[i]); + if (transf) { + space_transform_invert(transf, vertexCos[i]); + } } } } |