Cleanup: line length, indentation

This commit is contained in:
2016-01-21 09:05:52 +11:00
parent 5ef2ed23e1
commit aa69fb64ac
17 changed files with 47 additions and 36 deletions

View File

@@ -905,7 +905,9 @@ static float *editmesh_get_mirror_uv(BMEditMesh *em, int axis, float *uv, float
if (isnan(uv[0]) || !finite(uv[0]) || if (isnan(uv[0]) || !finite(uv[0]) ||
isnan(uv[1]) || !finite(uv[1]) isnan(uv[1]) || !finite(uv[1])
) )
{
return NULL; return NULL;
}
if (axis) { if (axis) {
vec[0] = uv[0]; vec[0] = uv[0];

View File

@@ -1078,7 +1078,8 @@ static bool weight_paint_sample_enum_itemf__helper(const MDeformVert *dvert, con
} }
return found; return found;
} }
static EnumPropertyItem *weight_paint_sample_enum_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free) static EnumPropertyItem *weight_paint_sample_enum_itemf(
bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free)
{ {
if (C) { if (C) {
wmWindow *win = CTX_wm_window(C); wmWindow *win = CTX_wm_window(C);
@@ -2080,9 +2081,11 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
wpd->do_multipaint ? wpaint_blur_weight_multi : wpaint_blur_weight_single; wpd->do_multipaint ? wpaint_blur_weight_multi : wpaint_blur_weight_single;
const float pressure = RNA_float_get(itemptr, "pressure"); const float pressure = RNA_float_get(itemptr, "pressure");
const float brush_size_pressure = BKE_brush_size_get(scene, brush) * (BKE_brush_use_size_pressure(scene, brush) ? pressure : 1.0f); const float brush_size_pressure =
BKE_brush_size_get(scene, brush) * (BKE_brush_use_size_pressure(scene, brush) ? pressure : 1.0f);
const float brush_alpha_value = BKE_brush_alpha_get(scene, brush); const float brush_alpha_value = BKE_brush_alpha_get(scene, brush);
const float brush_alpha_pressure = brush_alpha_value * (BKE_brush_use_alpha_pressure(scene, brush) ? pressure : 1.0f); const float brush_alpha_pressure =
brush_alpha_value * (BKE_brush_use_alpha_pressure(scene, brush) ? pressure : 1.0f);
/* intentionally don't initialize as NULL, make sure we initialize all members below */ /* intentionally don't initialize as NULL, make sure we initialize all members below */
WeightPaintInfo wpi; WeightPaintInfo wpi;
@@ -2176,7 +2179,8 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
#define WP_BLUR_ACCUM(v_idx_var) \ #define WP_BLUR_ACCUM(v_idx_var) \
{ \ { \
const unsigned int vidx = v_idx_var; \ const unsigned int vidx = v_idx_var; \
const float fac = calc_vp_strength_col_dl(wp, vc, wpd->vertexcosnos[vidx].co, mval, brush_size_pressure, NULL); \ const float fac = calc_vp_strength_col_dl( \
wp, vc, wpd->vertexcosnos[vidx].co, mval, brush_size_pressure, NULL); \
if (fac > 0.0f) { \ if (fac > 0.0f) { \
float weight = blur_weight_func(&me->dvert[vidx], &wpi); \ float weight = blur_weight_func(&me->dvert[vidx], &wpi); \
paintweight += weight * fac; \ paintweight += weight * fac; \
@@ -2704,8 +2708,10 @@ static void vpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
float mval[2]; float mval[2];
const float pressure = RNA_float_get(itemptr, "pressure"); const float pressure = RNA_float_get(itemptr, "pressure");
const float brush_size_pressure = BKE_brush_size_get(scene, brush) * (BKE_brush_use_size_pressure(scene, brush) ? pressure : 1.0f); const float brush_size_pressure =
const float brush_alpha_pressure = BKE_brush_alpha_get(scene, brush) * (BKE_brush_use_alpha_pressure(scene, brush) ? pressure : 1.0f); BKE_brush_size_get(scene, brush) * (BKE_brush_use_size_pressure(scene, brush) ? pressure : 1.0f);
const float brush_alpha_pressure =
BKE_brush_alpha_get(scene, brush) * (BKE_brush_use_alpha_pressure(scene, brush) ? pressure : 1.0f);
RNA_float_get_array(itemptr, "mouse", mval); RNA_float_get_array(itemptr, "mouse", mval);
@@ -3173,7 +3179,8 @@ static int paint_weight_gradient_invoke(bContext *C, wmOperator *op, const wmEve
if (ret & OPERATOR_RUNNING_MODAL) { if (ret & OPERATOR_RUNNING_MODAL) {
struct ARegion *ar = CTX_wm_region(C); struct ARegion *ar = CTX_wm_region(C);
if (ar->regiontype == RGN_TYPE_WINDOW) { if (ar->regiontype == RGN_TYPE_WINDOW) {
if (event->type == LEFTMOUSE && event->val == KM_PRESS) { /* TODO, hardcoded, extend WM_gesture_straightline_ */ /* TODO, hardcoded, extend WM_gesture_straightline_ */
if (event->type == LEFTMOUSE && event->val == KM_PRESS) {
wmGesture *gesture = op->customdata; wmGesture *gesture = op->customdata;
gesture->mode = 1; gesture->mode = 1;
} }

View File

@@ -1545,7 +1545,8 @@ BLI_INLINE bool spring_length(Implicit_Data *data, int i, int j, float r_extent[
/* /*
if (length>L) { if (length>L) {
if ((clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED) && if ((clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED) &&
( ((length-L)*100.0f/L) > clmd->sim_parms->maxspringlen )) { ( ((length-L)*100.0f/L) > clmd->sim_parms->maxspringlen ))
{
// cut spring! // cut spring!
s->flags |= CSPRING_FLAG_DEACTIVATE; s->flags |= CSPRING_FLAG_DEACTIVATE;
return false; return false;

View File

@@ -903,7 +903,8 @@ BLI_INLINE bool spring_length(Implicit_Data *data, int i, int j, float r_extent[
/* /*
if (length>L) { if (length>L) {
if ((clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED) && if ((clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED) &&
( ((length-L)*100.0f/L) > clmd->sim_parms->maxspringlen )) { ( ((length-L)*100.0f/L) > clmd->sim_parms->maxspringlen ))
{
// cut spring! // cut spring!
s->flags |= CSPRING_FLAG_DEACTIVATE; s->flags |= CSPRING_FLAG_DEACTIVATE;
return false; return false;