Code cleanup: style
authorCampbell Barton <ideasman42@gmail.com>
Sat, 3 May 2014 14:04:12 +0000 (00:04 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 3 May 2014 14:41:45 +0000 (00:41 +1000)
source/blender/blenkernel/intern/linestyle.c
source/blender/editors/object/object_bake_api.c
source/blender/editors/space_buttons/buttons_context.c

index b0395931ffed6b01740d3b8b84bc35807c87db52..8028bdbc32776cd528e97f700f3c826ae80593cb 100644 (file)
@@ -156,12 +156,12 @@ FreestyleLineStyle *BKE_copy_linestyle(FreestyleLineStyle *linestyle)
        BKE_free_linestyle(new_linestyle);
 
        for (a = 0; a < MAX_MTEX; a++) {
-               if (linestyle->mtex[a]) {
-                   new_linestyle->mtex[a] = MEM_mallocN(sizeof(MTex), "BKE_copy_linestyle");
-                   memcpy(new_linestyle->mtex[a], linestyle->mtex[a], sizeof(MTex));
-                   id_us_plus((ID *)new_linestyle->mtex[a]->tex);
-               }
-           }
+               if (linestyle->mtex[a]) {
+                       new_linestyle->mtex[a] = MEM_mallocN(sizeof(MTex), "BKE_copy_linestyle");
+                       memcpy(new_linestyle->mtex[a], linestyle->mtex[a], sizeof(MTex));
+                       id_us_plus((ID *)new_linestyle->mtex[a]->tex);
+               }
+       }
        if (linestyle->nodetree) {
                linestyle->nodetree = ntreeCopyTree(linestyle->nodetree);
        }
index 813e28b25ed1b03660702c8e7b4a06153752718f..0575a7bcbbec647098e73cdb3b5c118d6b098506 100644 (file)
@@ -367,13 +367,14 @@ typedef struct BakeAPIRender {
        bool ready;
 } BakeAPIRender;
 
-static int bake(Main *bmain, Scene *scene, Object *ob_low, ListBase *selected_objects, ReportList *reports,
-                               const ScenePassType pass_type, const int margin,
-                               const BakeSaveMode save_mode, const bool is_clear, const bool is_split_materials,
-                               const bool is_automatic_name, const bool use_selected_to_active,
-                               const float cage_extrusion, const int normal_space, const BakeNormalSwizzle normal_swizzle[],
-                               const char *custom_cage, const char *filepath, const int width, const int height,
-                               const char *identifier)
+static int bake(
+        Main *bmain, Scene *scene, Object *ob_low, ListBase *selected_objects, ReportList *reports,
+        const ScenePassType pass_type, const int margin,
+        const BakeSaveMode save_mode, const bool is_clear, const bool is_split_materials,
+        const bool is_automatic_name, const bool use_selected_to_active,
+        const float cage_extrusion, const int normal_space, const BakeNormalSwizzle normal_swizzle[],
+        const char *custom_cage, const char *filepath, const int width, const int height,
+        const char *identifier)
 {
        int op_result = OPERATOR_CANCELLED;
        bool ok = false;
@@ -886,11 +887,12 @@ static int bake_exec(bContext *C, wmOperator *op)
 
        bake_init_api_data(op, C, &bkr);
 
-       result = bake(bkr.main, bkr.scene, bkr.ob, &bkr.selected_objects, bkr.reports,
-                             bkr.pass_type, bkr.margin, bkr.save_mode,
-                             bkr.is_clear, bkr.is_split_materials, bkr.is_automatic_name, bkr.use_selected_to_active,
-                             bkr.cage_extrusion, bkr.normal_space, bkr.normal_swizzle,
-                                 bkr.custom_cage, bkr.filepath, bkr.width, bkr.height, bkr.identifier);
+       result = bake(
+               bkr.main, bkr.scene, bkr.ob, &bkr.selected_objects, bkr.reports,
+               bkr.pass_type, bkr.margin, bkr.save_mode,
+               bkr.is_clear, bkr.is_split_materials, bkr.is_automatic_name, bkr.use_selected_to_active,
+               bkr.cage_extrusion, bkr.normal_space, bkr.normal_swizzle,
+               bkr.custom_cage, bkr.filepath, bkr.width, bkr.height, bkr.identifier);
 
        BLI_freelistN(&bkr.selected_objects);
        return result;
@@ -900,12 +902,13 @@ static void bake_startjob(void *bkv, short *UNUSED(stop), short *UNUSED(do_updat
 {
        BakeAPIRender *bkr = (BakeAPIRender *)bkv;
 
-       bkr->result = bake(bkr->main, bkr->scene, bkr->ob, &bkr->selected_objects, bkr->reports,
-                                          bkr->pass_type, bkr->margin, bkr->save_mode,
-                                          bkr->is_clear, bkr->is_split_materials, bkr->is_automatic_name, bkr->use_selected_to_active,
-                                          bkr->cage_extrusion, bkr->normal_space, bkr->normal_swizzle,
-                                          bkr->custom_cage, bkr->filepath, bkr->width, bkr->height, bkr->identifier
-                                          );
+       bkr->result = bake(
+               bkr->main, bkr->scene, bkr->ob, &bkr->selected_objects, bkr->reports,
+               bkr->pass_type, bkr->margin, bkr->save_mode,
+               bkr->is_clear, bkr->is_split_materials, bkr->is_automatic_name, bkr->use_selected_to_active,
+               bkr->cage_extrusion, bkr->normal_space, bkr->normal_swizzle,
+               bkr->custom_cage, bkr->filepath, bkr->width, bkr->height, bkr->identifier
+               );
 }
 
 static void bake_freejob(void *bkv)
@@ -1018,7 +1021,7 @@ static int bake_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)
 
        /* setup job */
        wm_job = WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), scene, "Texture Bake",
-                                                WM_JOB_EXCL_RENDER | WM_JOB_PRIORITY | WM_JOB_PROGRESS, WM_JOB_TYPE_OBJECT_BAKE_TEXTURE);
+                            WM_JOB_EXCL_RENDER | WM_JOB_PRIORITY | WM_JOB_PROGRESS, WM_JOB_TYPE_OBJECT_BAKE_TEXTURE);
        WM_jobs_customdata_set(wm_job, bkr, bake_freejob);
        WM_jobs_timer(wm_job, 0.5, NC_IMAGE, 0); /* TODO - only draw bake image, can we enforce this */
        WM_jobs_callbacks(wm_job, bake_startjob, NULL, NULL, NULL);
index 3f5d7de5cd0d948d4a5590e0037022cc7d51a29a..4b37ac6b28186445a5c9cbd56d86c4a6551fd63c 100644 (file)
@@ -521,6 +521,7 @@ static int buttons_context_path_texture(ButsContextPath *path, ButsContextTextur
        return 0;
 }
 
+#ifdef WITH_FREESTYLE
 static bool buttons_context_linestyle_pinnable(const bContext *C)
 {
        Scene *scene = CTX_data_scene(C);
@@ -537,6 +538,7 @@ static bool buttons_context_linestyle_pinnable(const bContext *C)
        }
        return true;
 }
+#endif
 
 static int buttons_context_path(const bContext *C, ButsContextPath *path, int mainb, int flag)
 {