Commit: c697d298f60ccc302b470e4a134ef53f8bb8df26
Author: Martin Felke
Date:   Thu Aug 9 13:29:45 2018 +0200
Branches: temp-fracture-modifier-2.8
https://developer.blender.org/rBc697d298f60ccc302b470e4a134ef53f8bb8df26

cleanup, removed flag at freeData again

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

M       source/blender/blenkernel/BKE_fracture.h
M       source/blender/blenkernel/intern/fracture.c
M       source/blender/blenkernel/intern/fracture_dynamic.c
M       source/blender/blenkernel/intern/fracture_external.c
M       source/blender/modifiers/intern/MOD_fracture.c

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

diff --git a/source/blender/blenkernel/BKE_fracture.h 
b/source/blender/blenkernel/BKE_fracture.h
index 303e9fac5c9..2d618495a30 100644
--- a/source/blender/blenkernel/BKE_fracture.h
+++ b/source/blender/blenkernel/BKE_fracture.h
@@ -73,7 +73,7 @@ typedef struct FracPointCloud {
 
 
 void BKE_fracture_dynamic_free(struct FractureModifierData *fmd,
-                               bool do_free_sequence, bool do_free_rigidbody, 
struct Scene* scene, const int flag);
+                               bool do_free_sequence, bool do_free_rigidbody, 
struct Scene* scene);
 
 struct Mesh* BKE_fracture_prefractured_apply(struct FractureModifierData *fmd, 
struct Object *ob, struct Mesh *mesh,
                                              struct Depsgraph *depsgraph);
@@ -106,12 +106,11 @@ void BKE_fracture_shared_verts_free(struct ListBase* lb);
 struct Mesh *BKE_fracture_autohide_do(struct FractureModifierData *fmd, struct 
Mesh *dm, struct Object *ob, struct Scene* sc);
 
 struct FracMesh* BKE_fracture_fracmesh_copy(struct FracMesh* fm);
-void BKE_fracture_simulation_free(struct FractureModifierData *fmd, bool 
do_free_seq, bool do_free_rigidbody, struct Scene *scene,
-                                  const int flag);
-void BKE_fracture_meshislands_free(struct FractureModifierData* fmd, struct 
ListBase* meshIslands, bool do_free_rigidbody,
-                                   struct Scene* scene, const int flag);
+void BKE_fracture_simulation_free(struct FractureModifierData *fmd, bool 
do_free_seq, bool do_free_rigidbody, struct Scene *scene);
 
-void BKE_fracture_free(struct FractureModifierData *fmd, bool do_free_seq, 
bool do_free_rigidbody, struct Scene *scene, const int flag);
+void BKE_fracture_meshislands_free(struct FractureModifierData* fmd, struct 
ListBase* meshIslands, bool do_free_rigidbody, struct Scene* scene);
+
+void BKE_fracture_free(struct FractureModifierData *fmd, bool do_free_seq, 
bool do_free_rigidbody, struct Scene *scene);
 
 void BKE_fracture_do(struct FractureModifierData *fmd, ShardID id, struct 
Object *obj, struct Mesh *dm,
                      struct Depsgraph *depsgraph, struct Main *bmain);
@@ -182,10 +181,10 @@ void BKE_fracture_do_halving(struct FractureModifierData 
*fmd, struct Object* ob
 
 struct Mesh* BKE_fracture_assemble_mesh_from_shards(struct 
FractureModifierData *fmd, bool doCustomData, bool use_packed);
 
-void BKE_fracture_modifier_free(struct FractureModifierData *fmd, bool 
do_free_seq, bool do_free_rigidbody, struct Scene *scene, const int flag);
+void BKE_fracture_modifier_free(struct FractureModifierData *fmd, bool 
do_free_seq, bool do_free_rigidbody, struct Scene *scene);
 
 void BKE_fracture_mesh_island_free(struct FractureModifierData *rmd, struct 
MeshIsland *mi, bool remove_rigidbody,
-                                   struct Scene* scene, const int flag);
+                                   struct Scene* scene);
 
 short BKE_fracture_collect_materials(struct Main* bmain, struct Object* o, 
struct Object* ob, int matstart, struct GHash** mat_index_map);
 
diff --git a/source/blender/blenkernel/intern/fracture.c 
b/source/blender/blenkernel/intern/fracture.c
index d7c05106b37..23096a4fd78 100644
--- a/source/blender/blenkernel/intern/fracture.c
+++ b/source/blender/blenkernel/intern/fracture.c
@@ -2914,14 +2914,14 @@ FracMesh* BKE_fracture_fracmesh_copy(FracMesh* fm)
 
 
 void BKE_fracture_meshislands_free(FractureModifierData* fmd, ListBase* 
meshIslands, bool do_free_rigidbody,
-                                   Scene* scene, const int flag)
+                                   Scene* scene)
 {
        MeshIsland *mi;
 
        while (meshIslands->first) {
                mi = meshIslands->first;
                BLI_remlink_safe(meshIslands, mi);
-               BKE_fracture_mesh_island_free(fmd, mi, do_free_rigidbody, 
scene, flag);
+               BKE_fracture_mesh_island_free(fmd, mi, do_free_rigidbody, 
scene);
                mi = NULL;
        }
 
@@ -2929,7 +2929,7 @@ void BKE_fracture_meshislands_free(FractureModifierData* 
fmd, ListBase* meshIsla
        meshIslands->last = NULL;
 }
 
-void BKE_fracture_simulation_free(FractureModifierData *fmd, bool do_free_seq, 
bool do_free_rigidbody, Scene *scene, const int flag)
+void BKE_fracture_simulation_free(FractureModifierData *fmd, bool do_free_seq, 
bool do_free_rigidbody, Scene *scene)
 {
        /* what happens with this in dynamic fracture ? worst case, we need a 
sequence for this too*/
        if (fmd->shards_to_islands) {
@@ -2949,7 +2949,7 @@ void BKE_fracture_simulation_free(FractureModifierData 
*fmd, bool do_free_seq, b
 
        if (!do_free_seq) {
 
-               BKE_fracture_meshislands_free(fmd, &fmd->shared->meshIslands, 
do_free_rigidbody, scene, flag);
+               BKE_fracture_meshislands_free(fmd, &fmd->shared->meshIslands, 
do_free_rigidbody, scene);
                fmd->shared->meshIslands.first = NULL;
                fmd->shared->meshIslands.last = NULL;
        }
@@ -2964,7 +2964,7 @@ void BKE_fracture_simulation_free(FractureModifierData 
*fmd, bool do_free_seq, b
                        while (fmd->shared->meshIsland_sequence.first) {
                                msq = fmd->shared->meshIsland_sequence.first;
                                BLI_remlink(&fmd->shared->meshIsland_sequence, 
msq);
-                               BKE_fracture_meshislands_free(fmd, 
&msq->meshIslands, do_free_rigidbody, scene, flag);
+                               BKE_fracture_meshislands_free(fmd, 
&msq->meshIslands, do_free_rigidbody, scene);
                                MEM_freeN(msq);
                                msq = NULL;
                        }
@@ -3038,9 +3038,9 @@ static void free_shards(FractureModifierData *fmd)
        }
 }
 
-void BKE_fracture_modifier_free(FractureModifierData *fmd, bool do_free_seq, 
bool do_free_rigidbody, Scene *scene, const int flag)
+void BKE_fracture_modifier_free(FractureModifierData *fmd, bool do_free_seq, 
bool do_free_rigidbody, Scene *scene)
 {
-       BKE_fracture_simulation_free(fmd, do_free_seq, (fmd->fracture_mode == 
MOD_FRACTURE_DYNAMIC) && do_free_rigidbody, scene, flag);
+       BKE_fracture_simulation_free(fmd, do_free_seq, (fmd->fracture_mode == 
MOD_FRACTURE_DYNAMIC) && do_free_rigidbody, scene);
 
        if (fmd->shared->material_index_map)
        {
@@ -3106,13 +3106,13 @@ void BKE_fracture_modifier_free(FractureModifierData 
*fmd, bool do_free_seq, boo
 
 }
 
-void BKE_fracture_free(FractureModifierData *fmd, bool do_free_seq, bool 
do_free_rigidbody, Scene *scene, const int flag)
+void BKE_fracture_free(FractureModifierData *fmd, bool do_free_seq, bool 
do_free_rigidbody, Scene *scene)
 {
        //for prefractured and external case
 
        if ((!fmd->shared->refresh && !fmd->shared->refresh_constraints)) {
                /* free entire modifier or when job has been cancelled */
-               BKE_fracture_modifier_free(fmd, do_free_seq, do_free_rigidbody, 
scene, flag);
+               BKE_fracture_modifier_free(fmd, do_free_seq, do_free_rigidbody, 
scene);
 
                if (fmd->shared->visible_mesh_cached && !fmd->shards_to_islands)
                {
@@ -3123,7 +3123,7 @@ void BKE_fracture_free(FractureModifierData *fmd, bool 
do_free_seq, bool do_free
        }
        else if (!fmd->shared->refresh_constraints) {
                /* refreshing all simulation data only, no refracture */
-               BKE_fracture_simulation_free(fmd, false, do_free_rigidbody, 
scene, flag);
+               BKE_fracture_simulation_free(fmd, false, do_free_rigidbody, 
scene);
        }
        else if (fmd->shared->refresh_constraints && !fmd->is_dynamic_external) 
{
                /* refresh constraints only */
@@ -5478,7 +5478,7 @@ Mesh *BKE_fracture_result_mesh(FractureModifierData* fmd, 
Mesh *dm, Object* ob,
                if (fmd->shared->visible_mesh == NULL && 
fmd->shared->visible_mesh_cached == NULL) {
                        /* oops, something went definitely wrong... */
                        fmd->shared->refresh = true;
-                       BKE_fracture_free(fmd, fmd->fracture_mode == 
MOD_FRACTURE_PREFRACTURED, true, scene, 0);
+                       BKE_fracture_free(fmd, fmd->fracture_mode == 
MOD_FRACTURE_PREFRACTURED, true, scene);
                        fmd->shared->visible_mesh_cached = NULL;
                        fmd->shared->refresh = false;
                }
@@ -5697,7 +5697,7 @@ Mesh *BKE_fracture_prefractured_do(FractureModifierData 
*fmd, Object *ob, Mesh *
        if ((fmd->shared->refresh) || (fmd->shared->refresh_constraints))
        {
                /* if we changed the fracture parameters */
-               BKE_fracture_free(fmd, true, true, scene, 0);
+               BKE_fracture_free(fmd, true, true, scene);
 
                /* 2 cases, we can have a visible mesh or a cached visible 
mesh, the latter primarily when loading blend from file or using halving */
                /* free cached mesh in case of "normal refracture here if we 
have a visible mesh, does that mean REfracture ?*/
diff --git a/source/blender/blenkernel/intern/fracture_dynamic.c 
b/source/blender/blenkernel/intern/fracture_dynamic.c
index a1a148e756d..f056f85ea4f 100644
--- a/source/blender/blenkernel/intern/fracture_dynamic.c
+++ b/source/blender/blenkernel/intern/fracture_dynamic.c
@@ -146,13 +146,13 @@ static void 
fracture_dynamic_initialize(FractureModifierData *fmd, Object *ob, M
        {
                if (fmd->shared->reset_shards)
                {
-                       BKE_fracture_simulation_free(fmd, true, true, scene, 0);
-                       BKE_fracture_free(fmd, true, true, scene, 0);
+                       BKE_fracture_simulation_free(fmd, true, true, scene);
+                       BKE_fracture_free(fmd, true, true, scene);
                        fmd->last_frame = 1;
                }
                else
                {
-                       BKE_fracture_simulation_free(fmd, false, true, scene, 
0);
+                       BKE_fracture_simulation_free(fmd, false, true, scene);
                        fmd->last_frame = 1;
                }
 
@@ -397,7 +397,7 @@ static void 
fracture_dynamic_sequences_free(FractureModifierData *fmd, Scene* sc
        while (fmd->shared->meshIsland_sequence.first) {
                msq = fmd->shared->meshIsland_sequence.first;
                BLI_remlink(&fmd->shared->meshIsland_sequence, msq);
-               BKE_fracture_meshislands_free(fmd, &msq->meshIslands, true, 
scene, 0);
+               BKE_fracture_meshislands_free(fmd, &msq->meshIslands, true, 
scene);
                MEM_freeN(msq);
                msq = NULL;
        }
@@ -425,11 +425,11 @@ static void 
fracture_dynamic_sequences_free(FractureModifierData *fmd, Scene* sc
        fmd->shared->frac_mesh = NULL;
 }
 
-void BKE_fracture_dynamic_free(FractureModifierData *fmd, bool do_free_seq, 
bool do_free_rigidbody, Scene* scene, const int flag)
+void BKE_fracture_dynamic_free(FractureModifierData *fmd, bool do_free_seq, 
bool do_free_rigidbody, Scene* scene)
 {
        if ((!fmd->shared->refresh && !fmd->shared->refresh_constraints)) {
                /* free entire modifier */
-               BKE_fracture_modifier_free(fmd, do_free_seq, do_free_rigidbody, 
scene, flag);
+               BKE_fracture_modifier_free(fmd, do_free_seq, do_free_rigidbody, 
scene);
        }
        else if (fmd->shared->refresh_constraints && !fmd->is_dyna

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to