diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-22 02:15:10 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-22 12:48:16 +0300 |
commit | a25a7714c592dff1fc1b3b4b0888bf984fa9e6fd (patch) | |
tree | 31335c1e02de10d3c97f9fdbe98b71ebc410e451 /source/blender/modifiers/intern/MOD_weightvgmix.c | |
parent | 6cc09d006af4a89cea14485e8e3896bd38a80e4b (diff) |
Cleanup: style, use braces for modifiers
Diffstat (limited to 'source/blender/modifiers/intern/MOD_weightvgmix.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_weightvgmix.c | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/source/blender/modifiers/intern/MOD_weightvgmix.c b/source/blender/modifiers/intern/MOD_weightvgmix.c index f41689b741c..e509d1464f2 100644 --- a/source/blender/modifiers/intern/MOD_weightvgmix.c +++ b/source/blender/modifiers/intern/MOD_weightvgmix.c @@ -78,28 +78,37 @@ static float mix_weight(float weight, float weight2, char mix_mode) return weight2; } #endif - if (mix_mode == MOD_WVG_MIX_SET) + if (mix_mode == MOD_WVG_MIX_SET) { return weight2; - else if (mix_mode == MOD_WVG_MIX_ADD) + } + else if (mix_mode == MOD_WVG_MIX_ADD) { return (weight + weight2); - else if (mix_mode == MOD_WVG_MIX_SUB) + } + else if (mix_mode == MOD_WVG_MIX_SUB) { return (weight - weight2); - else if (mix_mode == MOD_WVG_MIX_MUL) + } + else if (mix_mode == MOD_WVG_MIX_MUL) { return (weight * weight2); + } else if (mix_mode == MOD_WVG_MIX_DIV) { /* Avoid dividing by zero (or really small values). */ - if (weight2 < 0.0f && weight2 > -MOD_WVG_ZEROFLOOR) + if (weight2 < 0.0f && weight2 > -MOD_WVG_ZEROFLOOR) { weight2 = -MOD_WVG_ZEROFLOOR; - else if (weight2 >= 0.0f && weight2 < MOD_WVG_ZEROFLOOR) + } + else if (weight2 >= 0.0f && weight2 < MOD_WVG_ZEROFLOOR) { weight2 = MOD_WVG_ZEROFLOOR; + } return (weight / weight2); } - else if (mix_mode == MOD_WVG_MIX_DIF) + else if (mix_mode == MOD_WVG_MIX_DIF) { return (weight < weight2 ? weight2 - weight : weight - weight2); - else if (mix_mode == MOD_WVG_MIX_AVG) + } + else if (mix_mode == MOD_WVG_MIX_AVG) { return (weight + weight2) * 0.5f; - else + } + else { return weight2; + } } /************************************** @@ -140,8 +149,9 @@ static bool dependsOnTime(ModifierData *md) { WeightVGMixModifierData *wmd = (WeightVGMixModifierData *)md; - if (wmd->mask_texture) + if (wmd->mask_texture) { return BKE_texture_dependsOnTime(wmd->mask_texture); + } return false; } |