[Bf-blender-cvs] [08d899d] master: Code cleanup: style

Campbell Barton noreply at git.blender.org
Sat May 3 16:42:00 CEST 2014


Commit: 08d899d1e7fe0c669954b197fef0e57269edfb79
Author: Campbell Barton
Date:   Sun May 4 00:04:12 2014 +1000
https://developer.blender.org/rB08d899d1e7fe0c669954b197fef0e57269edfb79

Code cleanup: style

===================================================================

M	source/blender/blenkernel/intern/linestyle.c
M	source/blender/editors/object/object_bake_api.c
M	source/blender/editors/space_buttons/buttons_context.c

===================================================================

diff --git a/source/blender/blenkernel/intern/linestyle.c b/source/blender/blenkernel/intern/linestyle.c
index b039593..8028bdb 100644
--- a/source/blender/blenkernel/intern/linestyle.c
+++ b/source/blender/blenkernel/intern/linestyle.c
@@ -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);
 	}
diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c
index 813e28b..0575a7b 100644
--- a/source/blender/editors/object/object_bake_api.c
+++ b/source/blender/editors/object/object_bake_api.c
@@ -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);
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c
index 3f5d7de..4b37ac6 100644
--- a/source/blender/editors/space_buttons/buttons_context.c
+++ b/source/blender/editors/space_buttons/buttons_context.c
@@ -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)
 {




More information about the Bf-blender-cvs mailing list