correct float -> double promotion warnings
This commit is contained in:
@@ -2584,13 +2584,13 @@ static void rna_def_modifier_weightvgedit(BlenderRNA *brna)
|
||||
|
||||
prop= RNA_def_property(srna, "use_add", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "edit_flags", MOD_WVG_EDIT_ADD2VG);
|
||||
RNA_def_property_ui_text(prop, "Add to VG", "Add vertices with weight over threshold "
|
||||
RNA_def_property_ui_text(prop, "Group Add", "Add vertices with weight over threshold "
|
||||
"to vgroup.");
|
||||
RNA_def_property_update(prop, 0, "rna_Modifier_update");
|
||||
|
||||
prop= RNA_def_property(srna, "use_remove", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "edit_flags", MOD_WVG_EDIT_REMFVG);
|
||||
RNA_def_property_ui_text(prop, "Rem from VG", "Remove vertices with weight below threshold "
|
||||
RNA_def_property_ui_text(prop, "Group Remove", "Remove vertices with weight below threshold "
|
||||
"from vgroup.");
|
||||
RNA_def_property_update(prop, 0, "rna_Modifier_update");
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ void weightvg_do_mask(int num, int *indices, float *org_w, float *new_w, Object
|
||||
int i;
|
||||
|
||||
/* If influence factor is null, nothing to do! */
|
||||
if (fact == 0.0) return;
|
||||
if (fact == 0.0f) return;
|
||||
|
||||
/* If we want to mask vgroup weights from a texture. */
|
||||
if (texture) {
|
||||
@@ -105,34 +105,34 @@ void weightvg_do_mask(int num, int *indices, float *org_w, float *new_w, Object
|
||||
/* Get the good channel value… */
|
||||
switch(tex_use_channel) {
|
||||
case MOD_WVG_MASK_TEX_USE_INT:
|
||||
org_w[i] = (new_w[i] * texres.tin * fact) + (org_w[i] * (1.0 - (texres.tin*fact)));
|
||||
org_w[i] = (new_w[i] * texres.tin * fact) + (org_w[i] * (1.0f - (texres.tin*fact)));
|
||||
break;
|
||||
case MOD_WVG_MASK_TEX_USE_RED:
|
||||
org_w[i] = (new_w[i] * texres.tr * fact) + (org_w[i] * (1.0 - (texres.tr*fact)));
|
||||
org_w[i] = (new_w[i] * texres.tr * fact) + (org_w[i] * (1.0f - (texres.tr*fact)));
|
||||
break;
|
||||
case MOD_WVG_MASK_TEX_USE_GREEN:
|
||||
org_w[i] = (new_w[i] * texres.tg * fact) + (org_w[i] * (1.0 - (texres.tg*fact)));
|
||||
org_w[i] = (new_w[i] * texres.tg * fact) + (org_w[i] * (1.0f - (texres.tg*fact)));
|
||||
break;
|
||||
case MOD_WVG_MASK_TEX_USE_BLUE:
|
||||
org_w[i] = (new_w[i] * texres.tb * fact) + (org_w[i] * (1.0 - (texres.tb*fact)));
|
||||
org_w[i] = (new_w[i] * texres.tb * fact) + (org_w[i] * (1.0f - (texres.tb*fact)));
|
||||
break;
|
||||
case MOD_WVG_MASK_TEX_USE_HUE:
|
||||
rgb_to_hsv(texres.tr, texres.tg, texres.tb, &h, &s, &v);
|
||||
org_w[i] = (new_w[i] * h * fact) + (org_w[i] * (1.0 - (h*fact)));
|
||||
org_w[i] = (new_w[i] * h * fact) + (org_w[i] * (1.0f - (h*fact)));
|
||||
break;
|
||||
case MOD_WVG_MASK_TEX_USE_SAT:
|
||||
rgb_to_hsv(texres.tr, texres.tg, texres.tb, &h, &s, &v);
|
||||
org_w[i] = (new_w[i] * s * fact) + (org_w[i] * (1.0 - (s*fact)));
|
||||
org_w[i] = (new_w[i] * s * fact) + (org_w[i] * (1.0f - (s*fact)));
|
||||
break;
|
||||
case MOD_WVG_MASK_TEX_USE_VAL:
|
||||
rgb_to_hsv(texres.tr, texres.tg, texres.tb, &h, &s, &v);
|
||||
org_w[i] = (new_w[i] * v * fact) + (org_w[i] * (1.0 - (v*fact)));
|
||||
org_w[i] = (new_w[i] * v * fact) + (org_w[i] * (1.0f - (v*fact)));
|
||||
break;
|
||||
case MOD_WVG_MASK_TEX_USE_ALPHA:
|
||||
org_w[i] = (new_w[i] * texres.ta * fact) + (org_w[i] * (1.0 - (texres.ta*fact)));
|
||||
org_w[i] = (new_w[i] * texres.ta * fact) + (org_w[i] * (1.0f - (texres.ta*fact)));
|
||||
break;
|
||||
default:
|
||||
org_w[i] = (new_w[i] * texres.tin * fact) + (org_w[i] * (1.0 - (texres.tin*fact)));
|
||||
org_w[i] = (new_w[i] * texres.tin * fact) + (org_w[i] * (1.0f - (texres.tin*fact)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -164,7 +164,7 @@ void weightvg_do_mask(int num, int *indices, float *org_w, float *new_w, Object
|
||||
else {
|
||||
/* Default "influence" behavior. */
|
||||
/* For each weight (vertex), make the mix between org and new weights. */
|
||||
const float ifact= 1.0-fact;
|
||||
const float ifact= 1.0f - fact;
|
||||
for (i = 0; i < num; i++) {
|
||||
org_w[i] = (new_w[i] * fact) + (org_w[i] * ifact);
|
||||
}
|
||||
@@ -189,7 +189,7 @@ void weightvg_update_vg(MDeformVert *dvert, int defgrp_idx, int num,
|
||||
MDeformWeight *newdw;
|
||||
|
||||
/* Never allow weights out of [0.0, 1.0] range. */
|
||||
CLAMP(w, 0.0, 1.0);
|
||||
CLAMP(w, 0.0f, 1.0f);
|
||||
|
||||
/* Let's first check to see if this vert is already in the weight group – if so
|
||||
* let's update it, or remove it if needed.
|
||||
|
||||
@@ -98,16 +98,16 @@ static float mix_weight(float weight, float weight2, char mix_mode)
|
||||
return (weight * weight2);
|
||||
else if (mix_mode == MOD_WVG_MIX_DIV) {
|
||||
/* Avoid dividing by zero (or really small values). */
|
||||
if (weight2 < 0.0 && weight2 > -MOD_WVG_ZEROFLOOR)
|
||||
if (weight2 < 0.0f && weight2 > -MOD_WVG_ZEROFLOOR)
|
||||
weight2 = -MOD_WVG_ZEROFLOOR;
|
||||
else if (weight2 >= 0.0 && 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)
|
||||
return (weight < weight2 ? weight2 - weight : weight - weight2);
|
||||
else if (mix_mode == MOD_WVG_MIX_AVG)
|
||||
return (weight + weight2) / 2.0;
|
||||
return (weight + weight2) * 0.5f;
|
||||
else return weight2;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user