From 8524aab99b8488c353ebebc6af2eeccd6d7d41b4 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 23 Jan 2016 12:44:03 +1300 Subject: Code Cleanup - More style cleanups and removing unneeded extra steps --- source/blender/blenkernel/intern/armature.c | 41 +++++++++++++---------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index 5b87c1dc2da..9ec3faa84b0 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -602,23 +602,18 @@ void b_bone_spline_setup(bPoseChannel *pchan, int rest, Mat4 result_array[MAX_BB } /* add extra rolls */ - float extraRoll1 = bone->roll1; - - if (bone->flag & BONE_ADD_PARENT_END_ROLL){ - extraRoll1 = extraRoll1 + prev->bone->roll2; - } - float extraRoll2 = bone->roll2; - - roll1 = roll1 + extraRoll1; - roll2 = roll2 + extraRoll2; - - /* extra curve x / y */ + roll1 += bone->roll1; + roll2 += bone->roll2; + + if (bone->flag & BONE_ADD_PARENT_END_ROLL) + roll1 += prev->bone->roll2; - h1[0] = h1[0] + bone->curveInX; - h1[2] = h1[2] + bone->curveInY; + /* extra curve x / y */ + h1[0] += bone->curveInX; + h1[2] += bone->curveInY; - h2[0] = h2[0] + bone->curveOutX; - h2[2] = h2[2] + bone->curveOutY; + h2[0] += bone->curveOutX; + h2[2] += bone->curveOutY; /* make curve */ if (bone->segments > MAX_BBONE_SUBDIV) @@ -645,21 +640,21 @@ void b_bone_spline_setup(bPoseChannel *pchan, int rest, Mat4 result_array[MAX_BB } float scaleFactorIn = 1.0; - if (a <= bone->segments - 1){ - scaleFactorIn = 1.0 + (bone->scaleIn - 1.0)*((1.0*(bone->segments - a - 1)) / (1.0*(bone->segments - 1))); + if (a <= bone->segments - 1) { + scaleFactorIn = 1.0f + (bone->scaleIn - 1.0f) * ((1.0f * (bone->segments - a - 1)) / (1.0f * (bone->segments - 1))); } - float scaleFactorOut = 1.0; - if (a >= 0){ - scaleFactorOut = 1.0 + (bone->scaleOut - 1.0)*((1.0*(a + 1)) / (1.0*(bone->segments - 1))); + float scaleFactorOut = 1.0f; + if (a >= 0) { + scaleFactorOut = 1.0 + (bone->scaleOut - 1.0f) * ((1.0f * (a + 1)) / (1.0f * (bone->segments - 1))); } float bscalemat[4][4], ibscalemat[4][4]; float bscale[3]; - bscale[0] = 1.0*scaleFactorIn*scaleFactorOut; - bscale[1] = 1.0 / bone->segments; - bscale[2] = 1.0*scaleFactorIn*scaleFactorOut; + bscale[0] = 1.0f * scaleFactorIn * scaleFactorOut; + bscale[1] = 1.0f / bone->segments; + bscale[2] = 1.0f * scaleFactorIn * scaleFactorOut; size_to_mat4(bscalemat, bscale); -- cgit v1.2.3