Code cleanup: style
authorCampbell Barton <ideasman42@gmail.com>
Mon, 24 Mar 2014 01:59:36 +0000 (12:59 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 24 Mar 2014 02:14:19 +0000 (13:14 +1100)
source/blender/blenkernel/intern/pbvh_intern.h
source/blender/blenlib/intern/math_easing.c
source/blender/editors/animation/keyframes_edit.c
source/blender/editors/interface/interface_widgets.c
source/blender/editors/sculpt_paint/paint_intern.h
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/editors/sculpt_paint/paint_vertex_proj.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/makesrna/intern/rna_fcurve.c

index 75d2a8333a1cdcd5a7101cdc52859c5f9465ebfc..1230d3a90b6c8c54541963161accc9ed346159ca 100644 (file)
@@ -181,12 +181,14 @@ bool ray_face_intersection(const float ray_start[3], const float ray_normal[3],
 void pbvh_update_BB_redraw(PBVH *bvh, PBVHNode **nodes, int totnode, int flag);
 
 /* pbvh_bmesh.c */
-int pbvh_bmesh_node_raycast(PBVHNode *node, const float ray_start[3],
-                                                       const float ray_normal[3], float *dist,
-                                                       int use_original);
-
-int pbvh_bmesh_node_raycast_detail(PBVHNode *node, const float ray_start[3],
-                                                       const float ray_normal[3], float *detail, float *dist);
+int pbvh_bmesh_node_raycast(
+        PBVHNode *node, const float ray_start[3],
+        const float ray_normal[3], float *dist,
+        int use_original);
+
+int pbvh_bmesh_node_raycast_detail(
+        PBVHNode *node, const float ray_start[3],
+        const float ray_normal[3], float *detail, float *dist);
 
 void pbvh_bmesh_normals_update(PBVHNode **nodes, int totnode);
 
index a630250d2baa8a2d2481d97920a986623c0aa941..d3ccf5ea85d2c2003034adf0cc06c820d5ac0514 100644 (file)
@@ -227,7 +227,7 @@ float ExpoEaseInOut(float time, float begin, float change, float duration)
        if (time == duration)
                return begin + change;
        if ((time /= duration / 2) < 1)
-               return change/2 * pow(2, 10 * (time - 1)) + begin;
+               return change / 2 * pow(2, 10 * (time - 1)) + begin;
        --time;
        return change / 2 * (-pow(2, -10 * time) + 2) + begin;
 }
@@ -275,7 +275,7 @@ float QuartEaseInOut(float time, float begin, float change, float duration)
        if ((time /= duration / 2) < 1)
                return change / 2 * time * time * time * time + begin;
        time -= 2;
-       return -change/2 * ( time * time * time * time - 2) + begin;
+       return -change / 2 * ( time * time * time * time - 2) + begin;
 }
 
 float QuintEaseIn(float time, float begin, float change, float duration)
@@ -291,7 +291,7 @@ float QuintEaseOut(float time, float begin, float change, float duration)
 float QuintEaseInOut(float time, float begin, float change, float duration)
 {
        if ((time /= duration / 2) < 1)
-                return change/2 * time * time * time * time * time + begin;
+                return change / 2 * time * time * time * time * time + begin;
        time -= 2;
        return change / 2 * (time * time * time * time * time + 2) + begin;
 }
index b14bbe821e8421ad773145598aeb5802dba02ab6..e5929d0ad8e4514fd79ba4ebe39277f318c43cd6 100644 (file)
@@ -988,7 +988,7 @@ static short set_bezt_quint(KeyframeEditData *UNUSED(ked), BezTriple *bezt)
 static short set_bezt_sine(KeyframeEditData *UNUSED(ked), BezTriple *bezt)
 {
        if (bezt->f2 & SELECT)
-               bezt->ipo= BEZT_IPO_SINE;
+               bezt->ipo = BEZT_IPO_SINE;
        return 0;
 }
 
index 68417f90f04c7ce9a519db3718ec73a923ff939a..4a830e3302725918e45e5f2b27d109193cff43bd 100644 (file)
@@ -2081,7 +2081,7 @@ static void ui_draw_but_HSVCIRCLE(uiBut *but, uiWidgetColors *wcol, const rcti *
         * lock the value of the color wheel to 1.
         * Useful for color correction tools where you're only interested in hue. */
        if (but->flag & UI_BUT_COLOR_LOCK) {
-               if(U.color_picker_type == USER_CP_CIRCLE_HSV)
+               if (U.color_picker_type == USER_CP_CIRCLE_HSV)
                        hsv[2] = 1.f;
                else
                        hsv[2] = 0.5f;
index e95632ef8c484eaa9f4dfc41741145ef5821c10b..5f951f72a21c99e31baf0a1b9633539341fcf6da 100644 (file)
@@ -126,8 +126,9 @@ typedef struct VertProjData {
 
 /* paint_vertex_proj.c */
 struct VertProjHandle;
-struct VertProjHandle *ED_vpaint_proj_handle_create(struct Scene *scene, struct Object *ob,
-               VertProjData **r_vcosnos);
+struct VertProjHandle *ED_vpaint_proj_handle_create(
+        struct Scene *scene, struct Object *ob,
+        VertProjData **r_vcosnos);
 void  ED_vpaint_proj_handle_update(
         struct VertProjHandle *vp_handle,
         /* runtime vars */
index 17e86b2738fd0f4fe350008f54bbbdaa56b3c690..c7bbf241e38bd757988743bd175af3c425a1892c 100644 (file)
@@ -910,8 +910,9 @@ static int sample_backbuf_area(ViewContext *vc, int *indexar, int totface, int x
 }
 
 /* whats _dl mean? */
-static float calc_vp_strength_col_dl(VPaint *vp, ViewContext *vc, const VertProjData *data, const int index,
-                                                                const float brush_size_pressure, float rgba[4])
+static float calc_vp_strength_col_dl(
+        VPaint *vp, ViewContext *vc, const VertProjData *data, const int index,
+        const float brush_size_pressure, float rgba[4])
 {
        float dist_sq = data->dists_sq[index];
        if (dist_sq <= brush_size_pressure * brush_size_pressure) {
@@ -939,10 +940,11 @@ static float calc_vp_strength_col_dl(VPaint *vp, ViewContext *vc, const VertProj
        return 0.0f;
 }
 
-static float calc_vp_alpha_col_dl(VPaint *vp, ViewContext *vc,
-                                                         float vpimat[3][3], const VertProjData *data,
-                                                         const int index,
-                              const float brush_size_pressure, const float brush_alpha_pressure, float rgba[4])
+static float calc_vp_alpha_col_dl(
+        VPaint *vp, ViewContext *vc,
+        float vpimat[3][3], const VertProjData *data,
+        const int index,
+        const float brush_size_pressure, const float brush_alpha_pressure, float rgba[4])
 {
        float strength = calc_vp_strength_col_dl(vp, vc, data, index, brush_size_pressure, rgba);
 
@@ -2842,7 +2844,7 @@ static bool vpaint_stroke_test_start(bContext *C, struct wmOperator *op, const f
 }
 
 static void vpaint_paint_poly(VPaint *vp, VPaintData *vpd, Mesh *me, const unsigned int index,
-                                                         const float brush_size_pressure, const float brush_alpha_pressure)
+                              const float brush_size_pressure, const float brush_alpha_pressure)
 {
        ViewContext *vc = &vpd->vc;
        Brush *brush = BKE_paint_brush(&vp->paint);
@@ -2892,8 +2894,8 @@ static void vpaint_paint_poly(VPaint *vp, VPaintData *vpd, Mesh *me, const unsig
                float rgba[4];
                unsigned int paintcol;
                alpha = calc_vp_alpha_col_dl(vp, vc, vpd->vpimat,
-                                                                vpd->data, ml->v,
-                                        brush_size_pressure, brush_alpha_pressure, rgba);
+                                            vpd->data, ml->v,
+                                            brush_size_pressure, brush_alpha_pressure, rgba);
 
                if (vpd->is_texbrush) {
                        float rgba_br[3];
index 3175a5a4235b10b843948d2ef3224a626313c456..1d98c39816eabd2974996a8d3ac66a95594fb201 100644 (file)
@@ -124,8 +124,9 @@ static void vpaint_proj_dm_map_cosnos_init(Scene *scene, Object *ob,
 
 /* Same as init but take mouse location into account */
 
-static void vpaint_proj_dm_map_cosnos_update__map_cb(void *userData, int index, const float co[3],
-                                                                                                        const float no_f[3], const short no_s[3])
+static void vpaint_proj_dm_map_cosnos_update__map_cb(
+        void *userData, int index, const float co[3],
+        const float no_f[3], const short no_s[3])
 {
        struct VertProjUpdate *vp_update = userData;
 
@@ -136,8 +137,8 @@ static void vpaint_proj_dm_map_cosnos_update__map_cb(void *userData, int index,
        float co_ss[2];  /* screenspace */
 
        if (ED_view3d_project_float_object(vp_update->ar,
-                                                                          co, co_ss,
-                                                                          V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_NEAR) == V3D_PROJ_RET_OK)
+                                          co, co_ss,
+                                          V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_NEAR) == V3D_PROJ_RET_OK)
        {
                const float dist_sq = len_squared_v2v2(vp_update->mval_fl, co_ss);
                if (dist_sq > data->dists_sq[index]) {
@@ -158,8 +159,9 @@ static void vpaint_proj_dm_map_cosnos_update__map_cb(void *userData, int index,
        }
 }
 
-static void vpaint_proj_dm_map_cosnos_update(struct VertProjHandle *vp_handle,
-                                                                                        ARegion *ar, const float mval_fl[2])
+static void vpaint_proj_dm_map_cosnos_update(
+        struct VertProjHandle *vp_handle,
+        ARegion *ar, const float mval_fl[2])
 {
        struct VertProjUpdate vp_update = {vp_handle, ar, mval_fl};
 
@@ -187,8 +189,9 @@ static void vpaint_proj_dm_map_cosnos_update(struct VertProjHandle *vp_handle,
 /* -------------------------------------------------------------------- */
 /* Public Functions */
 
-struct VertProjHandle *ED_vpaint_proj_handle_create(Scene *scene, Object *ob,
-                                                                                                       VertProjData **r_vcosnos)
+struct VertProjHandle *ED_vpaint_proj_handle_create(
+        Scene *scene, Object *ob,
+        VertProjData **r_vcosnos)
 {
        struct VertProjHandle *vp_handle = MEM_mallocN(sizeof(struct VertProjHandle), __func__);
        Mesh *me = ob->data;
index 1ddc48edf32bc7fe20006122ed2dc1addcdc944e..6334c167a027ed3683aacdd311ca962334449f85 100644 (file)
@@ -115,7 +115,7 @@ int system_physical_thread_count(void)
        size_t pcount_len;
        sysctlbyname("hw.physicalcpu", &pcount, &pcount_len, NULL, 0);
        return pcount;
-       }
+}
 #endif // __APPLE__
 
 void ED_sculpt_get_average_stroke(Object *ob, float stroke[3])
@@ -3793,7 +3793,7 @@ static void sculpt_omp_start(Sculpt *sd, SculptSession *ss)
                cache->num_threads = omp_get_num_procs();
 #endif
        }
-      else {
+       else {
                cache->num_threads = 1;
        }
        omp_set_num_threads(cache->num_threads);
@@ -4301,7 +4301,8 @@ static void sculpt_raycast_detail_cb(PBVHNode *node, void *data_v, float *tmin)
        if (BKE_pbvh_node_get_tmin(node) < *tmin) {
                SculptDetailRaycastData *srd = data_v;
                if (BKE_pbvh_bmesh_node_raycast_detail(node, srd->ray_start, srd->ray_normal,
-                                                                                          &srd->detail, &srd->dist)) {
+                                                      &srd->detail, &srd->dist))
+               {
                        srd->hit = 1;
                        *tmin = srd->dist;
                }
@@ -5262,8 +5263,7 @@ static int sculpt_detail_flood_fill_exec(bContext *C, wmOperator *UNUSED(op))
        size = max_fff(bb_max[0], bb_max[1], bb_max[2]);
 
        /* update topology size */
-       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);
 
        sculpt_undo_push_begin("Dynamic topology flood fill");
        sculpt_undo_push_node(ob, NULL, SCULPT_UNDO_COORDS);
@@ -5342,10 +5342,9 @@ static void sample_detail(bContext *C, int ss_co[2])
        srd.detail = sd->constant_detail;
 
        BKE_pbvh_raycast(ob->sculpt->pbvh, sculpt_raycast_detail_cb, &srd,
-                                        ray_start, ray_normal, false);
+                        ray_start, ray_normal, false);
 
-       if (srd.hit)
-       {
+       if (srd.hit) {
                sd->constant_detail = srd.detail * 100.0f;
        }
 }
@@ -5359,7 +5358,8 @@ static int sculpt_sample_detail_size_exec(bContext *C, wmOperator *op)
 }
 
 
-static int sculpt_sample_detail_size_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(e)) {
+static int sculpt_sample_detail_size_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(e))
+{
        ScrArea *sa = CTX_wm_area(C);
        ED_area_headerprint(sa, "Click on the mesh to set the detail");
        WM_cursor_modal_set(CTX_wm_window(C), BC_EYEDROPPER_CURSOR);
@@ -5367,8 +5367,8 @@ static int sculpt_sample_detail_size_invoke(bContext *C, wmOperator *op, const w
        return OPERATOR_RUNNING_MODAL;
 }
 
-static int sculpt_sample_detail_size_modal(bContext *C, wmOperator *op, const wmEvent *e) {
-
+static int sculpt_sample_detail_size_modal(bContext *C, wmOperator *op, const wmEvent *e)
+{
        switch (e->type) {
                case LEFTMOUSE:
                        if (e->val == KM_PRESS) {
index 81fa2ad62a486dd9263c5b767b26613ad44ad48d..43f60c4b35fd53280050481b2ce1d38760c67ddb 100644 (file)
@@ -1666,23 +1666,23 @@ static void rna_def_fkeyframe(BlenderRNA *brna)
        RNA_def_property_enum_items(prop, beztriple_interpolation_easing_items);
        RNA_def_property_ui_text(prop, "Easing", 
                                 "Which ends of the segment between this and the next keyframe easing "
-                                                        "interpolation is applied to");
-       RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
+                                "interpolation is applied to");
+       RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL);
 
        prop = RNA_def_property(srna, "back", PROP_FLOAT, PROP_NONE);
        RNA_def_property_float_sdna(prop, NULL, "back");
        RNA_def_property_ui_text(prop, "Back", "Amount of overshoot for 'back' easing");
-       RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
+       RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL);
 
        prop = RNA_def_property(srna, "amplitude", PROP_FLOAT, PROP_NONE);
        RNA_def_property_float_sdna(prop, NULL, "amplitude");
        RNA_def_property_ui_text(prop, "Amplitude", "Amplitude of bounces for elastic easing");
-       RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
+       RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL);
 
        prop = RNA_def_property(srna, "period", PROP_FLOAT, PROP_NONE);
        RNA_def_property_float_sdna(prop, NULL, "period");
        RNA_def_property_ui_text(prop, "Period", "Time between bounces for elastic easing");
-       RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
+       RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL);
        
        /* Vector values */
        prop = RNA_def_property(srna, "handle_left", PROP_FLOAT, PROP_COORDS); /* keyframes are dimensionless */