Cleanup: style
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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++;
|
||||
}
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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!
|
||||
*/
|
||||
{
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user