[Bf-blender-cvs] [a6a38e5] fracture_modifier: compile fixes after using more strict compilation settings, quiet some warnings effectively this way

Martin Felke noreply at git.blender.org
Sun Oct 19 23:05:39 CEST 2014


Commit: a6a38e56f4b5490bdda23d1af4edf9e762c79df1
Author: Martin Felke
Date:   Sun Oct 19 20:59:34 2014 +0200
Branches: fracture_modifier
https://developer.blender.org/rBa6a38e56f4b5490bdda23d1af4edf9e762c79df1

compile fixes after using more strict compilation settings, quiet some warnings effectively this way

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

M	source/blender/blenkernel/intern/fracture.c
M	source/blender/blenkernel/intern/fracture_util.c
M	source/blender/editors/object/object_modifier.c
M	source/blender/makesrna/intern/rna_modifier.c
M	source/blender/makesrna/intern/rna_rigidbody.c
M	source/blender/windowmanager/intern/wm_jobs.c

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

diff --git a/source/blender/blenkernel/intern/fracture.c b/source/blender/blenkernel/intern/fracture.c
index e01b75d..ec08dda 100644
--- a/source/blender/blenkernel/intern/fracture.c
+++ b/source/blender/blenkernel/intern/fracture.c
@@ -394,7 +394,6 @@ static void parse_cells(cell *cells, int expected_shards, ShardID parent_id, Fra
 	else if (algorithm == MOD_FRACTURE_BISECT || algorithm == MOD_FRACTURE_BISECT_FILL ||
 	         algorithm == MOD_FRACTURE_BISECT_FAST || algorithm == MOD_FRACTURE_BISECT_FAST_FILL)
 	{
-#define MYTAG (1 << 6)
 		bm_parent = shard_to_bmesh(p);
 		copy_v3_v3(centroid, p->centroid);
 	}
diff --git a/source/blender/blenkernel/intern/fracture_util.c b/source/blender/blenkernel/intern/fracture_util.c
index 621977a..98f591a 100644
--- a/source/blender/blenkernel/intern/fracture_util.c
+++ b/source/blender/blenkernel/intern/fracture_util.c
@@ -260,7 +260,6 @@ Shard *BKE_fracture_shard_boolean(Object *obj, DerivedMesh *dm_parent, Shard *ch
 Shard *BKE_fracture_shard_bisect(BMesh *bm_orig, Shard *child, float obmat[4][4], bool use_fill, bool clear_inner,
                                  bool clear_outer, int cutlimit, float centroid[3], short inner_mat_index)
 {
-	#define MYTAG (1 << 6)
 
 	Shard *output_s;
 	DerivedMesh *dm_child = BKE_shard_create_dm(child, false);
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index 549a5d3..c3333bd 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -2266,27 +2266,30 @@ static void fracture_free(void *customdata)
 	MEM_freeN(fj);
 }
 
-static int fracture_breakjob(void *customdata)
+static int fracture_breakjob(void *UNUSED(customdata))
 {
 	/* FractureJob *fj = (FractureJob *)customdata;
 	 * return *(fj->stop); */
 	return G.is_break; /* a workaround solution */
 }
 
-static float fracture_update(void *customdata)
+static void fracture_update(void *customdata)
 {
 	FractureJob *fj = customdata;
 	float progress;
 
 	if (fj->fmd->frac_mesh == NULL)
-		return 0.0f;
+		(*fj->progress) = 0.0f;
 
-	if (fracture_breakjob(fj))
+	if (fracture_breakjob(fj) && fj->fmd->frac_mesh)
 		fj->fmd->frac_mesh->cancel = 1;
 
-	/* *(fj->do_update) = true;  useless here...*/
-	progress = (float)(fj->fmd->frac_mesh->progress_counter) / (float)(fj->total_progress);
-	return progress;
+	/*(fj->do_update) = true;  useless here... because in wm_jobs.c its set to false again, preventing update*/
+	if (fj->fmd->frac_mesh)
+	{
+		progress = (float)(fj->fmd->frac_mesh->progress_counter) / (float)(fj->total_progress);
+		(*fj->progress) = progress;
+	}
 }
 
 static void fracture_startjob(void *customdata, short *stop, short *do_update, float *progress)
@@ -2320,12 +2323,12 @@ static void fracture_endjob(void *customdata)
 	fmd->refresh = false;
 }
 
-static bool fracture_poll(bContext *C)
+static int fracture_poll(bContext *C)
 {
 	return edit_modifier_poll_generic(C, &RNA_FractureModifier, 0);
 }
 
-static int fracture_refresh_exec(bContext *C, wmOperator *op)
+static int fracture_refresh_exec(bContext *C, wmOperator *UNUSED(op))
 {
 	Object *obact = ED_object_active_context(C);
 	Scene *scene = CTX_data_scene(C);
@@ -2383,7 +2386,7 @@ static int fracture_refresh_exec(bContext *C, wmOperator *op)
 	return OPERATOR_FINISHED;
 }
 
-static int fracture_refresh_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
+static int fracture_refresh_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
 {
 	if (WM_jobs_test(CTX_wm_manager(C), CTX_data_scene(C), WM_JOB_TYPE_OBJECT_FRACTURE))
 		return OPERATOR_CANCELLED;
@@ -2409,7 +2412,7 @@ void OBJECT_OT_fracture_refresh(wmOperatorType *ot)
 
 /****************** rigidbody constraint refresh operator *********************/
 
-static int rigidbody_refresh_constraints_exec(bContext *C, wmOperator *op)
+static int rigidbody_refresh_constraints_exec(bContext *C, wmOperator *UNUSED(op))
 {
 	Object *obact = ED_object_active_context(C);
 	FractureModifierData *rmd;
@@ -2429,7 +2432,7 @@ static int rigidbody_refresh_constraints_exec(bContext *C, wmOperator *op)
 	return OPERATOR_FINISHED;
 }
 
-static int rigidbody_refresh_constraints_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
+static int rigidbody_refresh_constraints_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
 {
 	if (edit_modifier_invoke_properties(C, op) || true)
 		return rigidbody_refresh_constraints_exec(C, op);
@@ -2453,7 +2456,7 @@ void OBJECT_OT_rigidbody_constraints_refresh(wmOperatorType *ot)
 	edit_modifier_properties(ot);
 }
 
-void convert_modifier_to_objects(ReportList *reports, Scene* scene, Object* ob, FractureModifierData *rmd)
+static void convert_modifier_to_objects(ReportList *reports, Scene* scene, Object* ob, FractureModifierData *rmd)
 {
 	Base *base_new, *base_old = BKE_scene_base_find(scene, ob);
 	Object *ob_new = NULL;
@@ -2465,7 +2468,6 @@ void convert_modifier_to_objects(ReportList *reports, Scene* scene, Object* ob,
 	KDTree* objtree = BLI_kdtree_new(count);
 	Object** objs = MEM_callocN(sizeof(Object*) * count, "convert_objs");
 	float max_con_mass = 0;
-	float min_con_dist = FLT_MAX;
 	rmd->refresh = false;
 
 	for (mi = rmd->meshIslands.first; mi; mi = mi->next) {
@@ -2604,7 +2606,6 @@ static int rigidbody_convert_exec(bContext *C, wmOperator *op)
 	float cfra = BKE_scene_frame_get(scene);
 	FractureModifierData *rmd;
 	RigidBodyWorld *rbw = scene->rigidbody_world;
-	Object* par = NULL;
 	
 	rmd = (FractureModifierData *)modifiers_findByType(obact, eModifierType_Fracture);
 	if (rmd && rmd->refresh) {
@@ -2646,14 +2647,14 @@ static int rigidbody_convert_exec(bContext *C, wmOperator *op)
 	return OPERATOR_FINISHED;
 }
 
-static int rigidbody_convert_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
+/*static int rigidbody_convert_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
 {
 	
 	if (edit_modifier_invoke_properties(C, op) || true)
 		return rigidbody_convert_exec(C, op);
 	else
 		return OPERATOR_CANCELLED;
-}
+}*/
 
 
 void OBJECT_OT_rigidbody_convert_to_objects(wmOperatorType *ot)
@@ -2663,7 +2664,7 @@ void OBJECT_OT_rigidbody_convert_to_objects(wmOperatorType *ot)
 	ot->idname = "OBJECT_OT_rigidbody_convert_to_objects";
 
 	ot->poll = fracture_poll;
-	ot->invoke = rigidbody_convert_invoke;
+	//ot->invoke = rigidbody_convert_invoke;
 	ot->exec = rigidbody_convert_exec;
 
 	/* flags */
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 41ba54e..c52aeec 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -622,230 +622,38 @@ static int rna_LaplacianDeformModifier_is_bind_get(PointerRNA *ptr)
 	return ((lmd->flag & MOD_LAPLACIANDEFORM_BIND) && (lmd->cache_system != NULL));
 }
 
-static float rna_EdgeSplitModifier_split_angle_get(PointerRNA *ptr)
-{
-	EdgeSplitModifierData *md = (EdgeSplitModifierData *)ptr->data;
-	return DEG2RADF(md->split_angle);
-}
-
-static void rna_EdgeSplitModifier_split_angle_set(PointerRNA *ptr, float value)
-{
-	EdgeSplitModifierData *md = (EdgeSplitModifierData *)ptr->data;
-	value = RAD2DEGF(value);
-	CLAMP(value, 0.0f, 180.0f);
-	md->split_angle = (int)value;
-}
-
-static float rna_BevelModifier_angle_limit_get(PointerRNA *ptr)
-{
-	BevelModifierData *md = (BevelModifierData *)ptr->data;
-	return DEG2RADF(md->bevel_angle);
-}
-
-static void rna_BevelModifier_angle_limit_set(PointerRNA *ptr, float value)
-{
-	BevelModifierData *md = (BevelModifierData *)ptr->data;
-	value = RAD2DEGF(value);
-	CLAMP(value, 0.0f, 180.0f);
-	md->bevel_angle = (int)value;
-}
-
-/*static void rna_BevelModifier_defgrp_name_set(PointerRNA *ptr, const char *value)
-{
-	BevelModifierData *md = (BevelModifierData *)ptr->data;
-	rna_object_vgroup_name_set(ptr, value, md->defgrp_name, sizeof(md->defgrp_name));
-}*/
-
-static void rna_UVWarpModifier_vgroup_set(PointerRNA *ptr, const char *value)
-{
-	UVWarpModifierData *umd = (UVWarpModifierData *)ptr->data;
-	rna_object_vgroup_name_set(ptr, value, umd->vgroup_name, sizeof(umd->vgroup_name));
-}
-
-static void rna_UVWarpModifier_uvlayer_set(PointerRNA *ptr, const char *value)
-{
-	UVWarpModifierData *umd = (UVWarpModifierData *)ptr->data;
-	rna_object_uvlayer_name_set(ptr, value, umd->uvlayer_name, sizeof(umd->uvlayer_name));
-}
-
-static void updateShards(FractureModifierData *fmd, Object *ob)
-{
-	MeshIsland *mi;
-	int vertstart = 0;
-	const int thresh_defgrp_index = defgroup_name_index(ob, fmd->thresh_defgrp_name);
-	const int ground_defgrp_index = defgroup_name_index(ob, fmd->ground_defgrp_name);
-	DerivedMesh *dm = ob->derivedFinal;
-	MDeformVert *dvert;
-
-	if (dm == NULL)
-		return;
-
-	dvert = dm->getVertDataArray(dm, CD_MDEFORMVERT);
-
-	for (mi = fmd->meshIslands.first; mi; mi = mi->next)
-	{
-		int i = 0;
-
-		mi->ground_weight = 0.0f;
-
-		if (fmd->dm != NULL && !fmd->shards_to_islands)
-		{
-			for (i = 0; i < mi->vertex_count; i++)
-			{
-				//sum up vertexweights and divide by vertcount to get islandweight
-				if (dvert && dvert->dw && fmd->thresh_defgrp_name[0]) {
-					float vweight = defvert_find_weight(dvert + vertstart + i, thresh_defgrp_index);
-					mi->thresh_weight += vweight;
-				}
-
-				if (dvert && dvert->dw && fmd->ground_defgrp_name[0]) {
-					float gweight = defvert_find_weight(dvert + vertstart + i, ground_defgrp_index);
-					mi->ground_weight += gweight;
-				}
-			}
-
-			vertstart += mi->vertex_count;
-		}
-		else
-		{
-			for (i = 0; i < mi->vertex_count; i++)
-			{
-				int index = mi->vertex_indices[i];
-
-				if (dvert && dvert->dw && fmd->thresh_defgrp_name[0]) {
-					float vweight = defvert_find_weight(dvert + index, thresh_defgrp_index);
-					mi->thresh_weight += vweight;
-				}
-
-				if (dvert && dvert->dw && fmd->ground_defgrp_name[0]) {
-					float gweight = defvert_find_weight(dvert + index, ground_defgrp_index);
-					mi->ground_weight += gweight;
-				}
-			}
-		}
-
-		if (mi->vertex_count > 0)
-		{
-			mi->thresh_weight /= mi->vertex_count;
-			mi->ground_weight /= mi->vertex_count;
-		}
-
-		if (mi->rigidbody)
-		{
-			mi->rigidbody->type = mi->ground_weight > 

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list