code cleanup: avoid confusion with incorrectly named argument to BLI_edgefill(),...
authorCampbell Barton <ideasman42@gmail.com>
Mon, 16 Apr 2012 05:03:04 +0000 (05:03 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 16 Apr 2012 05:03:04 +0000 (05:03 +0000)
source/blender/blenkernel/intern/displist.c
source/blender/blenkernel/intern/editderivedmesh.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenlib/BLI_scanfill.h
source/blender/blenlib/intern/scanfill.c
source/blender/bmesh/operators/bmo_triangulate.c
source/blender/editors/mesh/editmesh_knife.c
source/blender/editors/uvedit/uvedit_unwrap_ops.c
source/blender/windowmanager/intern/wm_gesture.c

index c54461a5a130d7ec6c7c1b16679bbbc5769bebbf..cefc0fba9cd79aa3ad2e8c315aa29b0c7eb1d0fa 100644 (file)
@@ -472,7 +472,7 @@ void filldisplist(ListBase *dispbase, ListBase *to, int flipnormal)
                        dl= dl->next;
                }
                
-               if (totvert && (tot= BLI_edgefill(0))) { // XXX (obedit && obedit->actcol)?(obedit->actcol-1):0)) {
+               if (totvert && (tot= BLI_edgefill(FALSE))) { // XXX (obedit && obedit->actcol)?(obedit->actcol-1):0)) {
                        if (tot) {
                                dlnew= MEM_callocN(sizeof(DispList), "filldisplist");
                                dlnew->type= DL_INDEX3;
index c53b11aa60c57d2bdeda72fcac89481eb98e3b61..75f6abc6c74ab1b5f3f78a3dcf1441184a7cc8c0 100644 (file)
@@ -216,7 +216,7 @@ static void BMEdit_RecalcTessellation_intern(BMEditMesh *tm)
                        /*complete the loop*/
                        BLI_addfilledge(firstv, v);
 
-                       totfilltri = BLI_edgefill(2);
+                       totfilltri = BLI_edgefill(FALSE);
                        BLI_array_growitems(looptris, totfilltri);
 
                        for (efa = fillfacebase.first; efa; efa=efa->next) {
index 9a10a00bf456fbc3c713c073067e77e795c97634..2a22324a0ab79b74d5368a46d1f1a16fee735d9b 100644 (file)
@@ -2478,7 +2478,7 @@ int mesh_recalcTessellation(CustomData *fdata,
                        }
                        BLI_addfilledge(lastv, firstv);
                        
-                       totfilltri = BLI_edgefill(2);
+                       totfilltri = BLI_edgefill(FALSE);
                        if (totfilltri) {
                                BLI_array_growitems(mface_to_poly_map, totfilltri);
                                BLI_array_growitems(mface, totfilltri);
index 1fe71bffba8179c77ffd72844cbfaaf0bb63e792..6dcc1df41a3ec195778f348ac9afb2de560ff535 100644 (file)
@@ -86,7 +86,7 @@ struct ScanFillEdge *BLI_addfilledge(struct ScanFillVert *v1, struct ScanFillVer
 #define FILLBOUNDARY 1
 
 int BLI_begin_edgefill(void);
-int BLI_edgefill(short mat_nr);
+int BLI_edgefill(const short do_quad_tri_speedup);
 void BLI_end_edgefill(void);
 
 /* These callbacks are needed to make the lib finction properly */
index 641d0373a64773b74d98df4418d23ba4c3501b80..d1b2c5b00eebe7be5a4a82b12ad102481ea44a0f 100644 (file)
@@ -792,7 +792,7 @@ int BLI_begin_edgefill(void)
        return 1;
 }
 
-int BLI_edgefill(short mat_nr)
+int BLI_edgefill(const short do_quad_tri_speedup)
 {
        /*
         * - fill works with its own lists, so create that first (no faces!)
@@ -821,34 +821,28 @@ int BLI_edgefill(short mat_nr)
                a += 1;
        }
 
-       if (a == 3 && (mat_nr & 2)) {
+       if (do_quad_tri_speedup && (a == 3)) {
                eve = fillvertbase.first;
 
                addfillface(eve, eve->next, eve->next->next);
                return 1;
        }
-       else if (a == 4 && (mat_nr & 2)) {
+       else if (do_quad_tri_speedup && (a == 4)) {
                float vec1[3], vec2[3];
 
                eve = fillvertbase.first;
                /* no need to check 'eve->next->next->next' is valid, already counted */
-               if (1) { //BMESH_TODO) {
-                       /*use shortest diagonal for quad*/
-                       sub_v3_v3v3(vec1, eve->co, eve->next->next->co);
-                       sub_v3_v3v3(vec2, eve->next->co, eve->next->next->next->co);
-                       
-                       if (dot_v3v3(vec1, vec1) < dot_v3v3(vec2, vec2)) {
-                               addfillface(eve, eve->next, eve->next->next);
-                               addfillface(eve->next->next, eve->next->next->next, eve);
-                       }
-                       else {
-                               addfillface(eve->next, eve->next->next, eve->next->next->next);
-                               addfillface(eve->next->next->next, eve, eve->next);
-                       }
+               /*use shortest diagonal for quad*/
+               sub_v3_v3v3(vec1, eve->co, eve->next->next->co);
+               sub_v3_v3v3(vec2, eve->next->co, eve->next->next->next->co);
+
+               if (dot_v3v3(vec1, vec1) < dot_v3v3(vec2, vec2)) {
+                       addfillface(eve, eve->next, eve->next->next);
+                       addfillface(eve->next->next, eve->next->next->next, eve);
                }
                else {
-                               addfillface(eve, eve->next, eve->next->next);
-                               addfillface(eve->next->next, eve->next->next->next, eve);
+                       addfillface(eve->next, eve->next->next, eve->next->next->next);
+                       addfillface(eve->next->next->next, eve, eve->next);
                }
                return 2;
        }
index dd23bc604be3a43cd26add547c2293d4488719f9..0f7c45470e9cd06ce1c5454fc8eca68219ffaf55 100644 (file)
@@ -194,7 +194,7 @@ void bmo_triangle_fill_exec(BMesh *bm, BMOperator *op)
                /* eed->tmp.p = e; */ /* UNUSED */
        }
        
-       BLI_edgefill(0);
+       BLI_edgefill(FALSE);
        
        for (efa = fillfacebase.first; efa; efa = efa->next) {
                BMFace *f = BM_face_create_quad_tri(bm,
index 9224a8d857e327b90a1ded88a16d431976f158d3..4ba8ff0492c88797e2c11e9a7b3c87f711d7ef97 100644 (file)
@@ -1873,7 +1873,7 @@ static void knifenet_fill_faces(knifetool_opdata *kcd)
                        }
                }
 
-               BLI_edgefill(0);
+               BLI_edgefill(FALSE);
 
                for (efa = fillfacebase.first; efa; efa = efa->next) {
                        BMVert *v1 = efa->v3->tmp.p, *v2 = efa->v2->tmp.p, *v3 = efa->v1->tmp.p;
index 54182350f1e6e0fe2cbb092403eea4e8c6f3623a..e51b119253f30fad0a5444e328c383eeecd523f4 100644 (file)
@@ -286,9 +286,8 @@ static ParamHandle *construct_param_handle(Scene *scene, BMEditMesh *em,
                        }
 
                        BLI_addfilledge(firstv, v);
-                       
-                       /* mode 2 enables faster handling of tri/quads */
-                       BLI_edgefill(2);
+
+                       BLI_edgefill(TRUE);
                        for (sefa = fillfacebase.first; sefa; sefa = sefa->next) {
                                ls[0] = sefa->v1->tmp.p;
                                ls[1] = sefa->v2->tmp.p;
index 593d1b35abe509d5c74c185797cc5f93eadb740b..efc22f95cbc0bcf4775a3fdb51eaf6b77fc42d21 100644 (file)
@@ -253,7 +253,7 @@ static void draw_filled_lasso(wmGesture *gt)
        /* highly unlikely this will fail, but could crash if (gt->points == 0) */
        if (firstv) {
                BLI_addfilledge(firstv, v);
-               BLI_edgefill(0);
+               BLI_edgefill(FALSE);
        
                glEnable(GL_BLEND);
                glColor4f(1.0, 1.0, 1.0, 0.05);