diff options
9 files changed, 30 insertions, 22 deletions
diff --git a/source/blender/blenfont/intern/blf_lang.c b/source/blender/blenfont/intern/blf_lang.c index 7206d71b3b8..99e1aa5d3e3 100644 --- a/source/blender/blenfont/intern/blf_lang.c +++ b/source/blender/blenfont/intern/blf_lang.c @@ -209,7 +209,7 @@ void BLF_lang_init(void) * Would also be good to find nicer way to check if LANG is correct. */ const char *lang = getenv("LANG"); - if(lang != NULL) { + if (lang != NULL) { char *old_locale = setlocale(LC_ALL, NULL); /* Make a copy so subsequenct setlocale() doesn't interfere. */ old_locale = BLI_strdup(old_locale); diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c index b71a4029690..4125451ead9 100644 --- a/source/blender/blenloader/intern/versioning_250.c +++ b/source/blender/blenloader/intern/versioning_250.c @@ -323,7 +323,7 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb) SpaceNla *snla = (SpaceNla *)sl; memcpy(&ar->v2d, &snla->v2d, sizeof(View2D)); - ar->v2d.tot.ymin = (float)(-sa->winy)/3.0f; + ar->v2d.tot.ymin = (float)(-sa->winy) / 3.0f; ar->v2d.tot.ymax = 0.0f; ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL); @@ -338,8 +338,8 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb) /* we totally reinit the view for the Action Editor, as some old instances had some weird cruft set */ ar->v2d.tot.xmin = -20.0f; - ar->v2d.tot.ymin = (float)(-sa->winy)/3.0f; - ar->v2d.tot.xmax = (float)((sa->winx > 120)? (sa->winx) : 120); + ar->v2d.tot.ymin = (float)(-sa->winy) / 3.0f; + ar->v2d.tot.xmax = (float)((sa->winx > 120) ? (sa->winx) : 120); ar->v2d.tot.ymax = 0.0f; ar->v2d.cur = ar->v2d.tot; diff --git a/source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cpp b/source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cpp index e3095f74b99..8133f392ac6 100644 --- a/source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cpp +++ b/source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cpp @@ -229,7 +229,7 @@ void PlaneDistortMaskOperation::executePixelSampled(float output[4], float x, fl sample_data->frameSpaceCorners[2]) || isect_point_tri_v2(point, sample_data->frameSpaceCorners[0], sample_data->frameSpaceCorners[2], - sample_data->frameSpaceCorners[3])) + sample_data->frameSpaceCorners[3])) { inside_counter++; } diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index 1216983fec9..ff82688def8 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -3279,7 +3279,7 @@ static void proj_paint_state_vert_flags_init(ProjPaintState *ps) #ifndef PROJ_DEBUG_NOSEAMBLEED static void project_paint_bleed_add_face_user( const ProjPaintState *ps, MemArena *arena, - const MFace *mf, const int face_index) + const MFace *mf, const int face_index) { /* add face user if we have bleed enabled, set the UV seam flags later */ /* annoying but we need to add all faces even ones we never use elsewhere */ diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 122acf3c941..69428c0f0d7 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -4248,14 +4248,14 @@ static void sculpt_stroke_update_step(bContext *C, struct PaintStroke *UNUSED(st sculpt_restore_mesh(sd, ob); if (sd->flags & SCULPT_DYNTOPO_DETAIL_CONSTANT) { - BKE_pbvh_bmesh_detail_size_set(ss->pbvh, - sd->constant_detail / 100.0f); + BKE_pbvh_bmesh_detail_size_set(ss->pbvh, sd->constant_detail / 100.0f); } else { - BKE_pbvh_bmesh_detail_size_set(ss->pbvh, - (ss->cache->radius / - (float)ups->pixel_radius) * - (float)(sd->detail_size * U.pixelsize)/ 0.4f); + BKE_pbvh_bmesh_detail_size_set( + ss->pbvh, + (ss->cache->radius / + (float)ups->pixel_radius) * + (float)(sd->detail_size * U.pixelsize) / 0.4f); } if (sculpt_stroke_dynamic_topology(ss, brush)) { diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index ac1c075e8d6..929929c7dd0 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1829,15 +1829,15 @@ static void view3d_draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d, ED_region_pixelspace(ar); glTranslatef(centx, centy, 0.0); - if(rv3d->persp != RV3D_CAMOB) { + if (rv3d->persp != RV3D_CAMOB) { glRotatef(RAD2DEGF(-bgpic->rotation), 0.0f, 0.0f, 1.0f); } - if(bgpic->flag & V3D_BGPIC_FLIP_X) { + if (bgpic->flag & V3D_BGPIC_FLIP_X) { zoomx *= -1.0f; x1 = x2; } - if(bgpic->flag & V3D_BGPIC_FLIP_Y) { + if (bgpic->flag & V3D_BGPIC_FLIP_Y) { zoomy *= -1.0f; y1 = y2; } diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index 53e20ec31ca..41049e8430a 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -1768,10 +1768,10 @@ static void gpu_lamp_calc_winmat(GPULamp *lamp) orthographic_m4(lamp->winmat, -wsize, wsize, -wsize, wsize, lamp->d, lamp->clipend); } else { - angle= saacos(lamp->spotsi); - temp= 0.5f*lamp->size*cosf(angle)/sinf(angle); - pixsize= (lamp->d)/temp; - wsize= pixsize*0.5f*lamp->size; + angle = saacos(lamp->spotsi); + temp = 0.5f * lamp->size * cosf(angle) / sinf(angle); + pixsize = lamp->d / temp; + wsize = pixsize * 0.5f * lamp->size; perspective_m4(lamp->winmat, -wsize, wsize, -wsize, wsize, lamp->d, lamp->clipend); } } diff --git a/source/blender/modifiers/intern/MOD_normal_edit.c b/source/blender/modifiers/intern/MOD_normal_edit.c index 39881f474b0..3bf60519530 100644 --- a/source/blender/modifiers/intern/MOD_normal_edit.c +++ b/source/blender/modifiers/intern/MOD_normal_edit.c @@ -164,14 +164,19 @@ static void normalEditModifier_do_radial( generate_vert_coordinates(dm, ob, smd->target, smd->offset, num_verts, cos, size); - /* size gives us our spheroid coefficients (A, B, C). + /** + * size gives us our spheroid coefficients ``(A, B, C)``. * Then, we want to find out for each vert its (a, b, c) triple (proportional to (A, B, C) one). * - * Ellipsoid basic equation: (x^2/a^2) + (y^2/b^2) + (z^2/c^2) = 1. + * Ellipsoid basic equation: ``(x^2/a^2) + (y^2/b^2) + (z^2/c^2) = 1.`` * Since we want to find (a, b, c) matching this equation and proportional to (A, B, C), we can do: + * <pre> * m = B / A * n = C / A + * </pre> + * * hence: + * <pre> * (x^2/a^2) + (y^2/b^2) + (z^2/c^2) = 1 * -> b^2*c^2*x^2 + a^2*c^2*y^2 + a^2*b^2*z^2 = a^2*b^2*c^2 * b = ma @@ -181,9 +186,12 @@ static void normalEditModifier_do_radial( * -> a^2 = (m^2*n^2*x^2 + n^2y^2 + m^2z^2) / (m^2*n^2) = x^2 + (y^2 / m^2) + (z^2 / n^2) * -> b^2 = (m^2*n^2*x^2 + n^2y^2 + m^2z^2) / (n^2) = (m^2 * x^2) + y^2 + (m^2 * z^2 / n^2) * -> c^2 = (m^2*n^2*x^2 + n^2y^2 + m^2z^2) / (m^2) = (n^2 * x^2) + (n^2 * y^2 / m^2) + z^2 + * </pre> * * All we have to do now is compute normal of the spheroid at that point: + * <pre> * n = (x / a^2, y / b^2, z / c^2) + * </pre> * And we are done! */ { diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 62f46cc78a3..4b8af999205 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -729,7 +729,7 @@ static int wm_operator_exec(bContext *C, wmOperator *op, const bool repeat, cons /* XXX Disabled the repeat check to address part 2 of #31840. * Carefully checked all calls to wm_operator_exec and WM_operator_repeat, don't see any reason * why this was needed, but worth to note it in case something turns bad. (mont29) */ - if (retval & (OPERATOR_FINISHED | OPERATOR_CANCELLED)/* && repeat == 0 */) + if (retval & (OPERATOR_FINISHED | OPERATOR_CANCELLED) /* && repeat == 0 */) wm_operator_reports(C, op, retval, false); if (retval & OPERATOR_FINISHED) { |