- removed dlm->flag
authorDaniel Dunbar <daniel@zuster.org>
Tue, 29 Mar 2005 17:20:28 +0000 (17:20 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 29 Mar 2005 17:20:28 +0000 (17:20 +0000)
source/blender/blenkernel/BKE_displist.h
source/blender/blenkernel/BKE_subsurf.h
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/displist.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/subsurf.c
source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/renderconverter/intern/convertBlenderScene.c
source/blender/src/editobject.c

index 32da11d0a9b0ea69ca899e54650ae8d5a467404a..0bdcf4da83492c88e5c1408297750aa1638fc5b6 100644 (file)
@@ -100,7 +100,6 @@ struct DispListMesh {
        struct EditEdge **editedge;     // added for subsurf, drawobject.c
        struct EditFace **editface;     // added for subsurf, drawobject.c
        float *nors; // facenormals
-       int flag;
 };
 
 void displistmesh_free(DispListMesh *dlm);
index 39ea8c7a0c695316073dc5797bbe03a5e213a650..36c180a67c5bcd94bd70d75443cbe07972214a16 100644 (file)
@@ -37,12 +37,12 @@ struct DispListMesh;
 struct DerivedMesh;
 struct EditMesh;
 
-struct DerivedMesh *subsurf_make_derived_from_editmesh(struct EditMesh *em, int subdivLevels, int flags, short type);
-struct DerivedMesh *subsurf_make_derived_from_mesh(struct Mesh *me, int subdivLevels, int flags);
+struct DerivedMesh *subsurf_make_derived_from_editmesh(struct EditMesh *em, int subdivLevels, short type);
+struct DerivedMesh *subsurf_make_derived_from_mesh(struct Mesh *me, int subdivLevels);
 
 #ifdef USE_CCGSUBSURFLIB
-struct DispListMesh *subsurf_ccg_make_dispListMesh_from_editmesh(struct EditMesh *em, int subdivLevels, int flags);
-struct DispListMesh *subsurf_ccg_make_dispListMesh_from_mesh(struct Mesh *me, int subdivLevels, int flags);
+struct DispListMesh *subsurf_ccg_make_dispListMesh_from_editmesh(struct EditMesh *em, int subdivLevels);
+struct DispListMesh *subsurf_ccg_make_dispListMesh_from_mesh(struct Mesh *me, int subdivLevels);
 #endif
 
 void subsurf_calculate_limit_positions(Mesh *me, float (*positions_r)[3]);
index 1c6b6ebe2d3e80dc39552c5d3b6f93f168e339ca..68189f13c0eee98d65fbf6a8c5364a2a904f6ec4 100644 (file)
@@ -1161,9 +1161,9 @@ DerivedMesh *mesh_get_derived_render(Object *ob, int *needsFree)
                } else {
                        *needsFree = 1;
                        if(G.obedit && me==G.obedit->data) {
-                               return subsurf_make_derived_from_editmesh(G.editMesh, me->subdivr, me->flag, me->subsurftype);
+                               return subsurf_make_derived_from_editmesh(G.editMesh, me->subdivr, me->subsurftype);
                        } else {
-                               return subsurf_make_derived_from_mesh(me, me->subdivr, me->flag);
+                               return subsurf_make_derived_from_mesh(me, me->subdivr);
                        }
                }
        }
index 1314bb996f46cf6d3ffb2baf357cb54d8c4df4e0..feecc2a330def087c1c6eba451a0f0cf7000a983 100644 (file)
@@ -117,7 +117,6 @@ DispListMesh *displistmesh_from_editmesh(EditMesh *em)
        MFace *mfNew;
        int i;
 
-       dlm->flag= 0;
        dlm->totvert= BLI_countlist(&em->verts);
        dlm->totface= BLI_countlist(&em->edges)+BLI_countlist(&em->faces);
        dlm->mvert= MEM_callocN(sizeof(*dlm->mface)*dlm->totvert, "dlm->mvert");
@@ -178,7 +177,6 @@ DispListMesh *displistmesh_from_mesh(Mesh *me, float *extverts)
 {
        DispListMesh *dlm= MEM_callocN(sizeof(*dlm),"dlm");
        int i;
-       dlm->flag= 0;
        dlm->totvert= me->totvert;
        dlm->totface= me->totface;
        dlm->mvert= MEM_dupallocN(me->mvert);
@@ -1764,9 +1762,9 @@ void makeDispList(Object *ob)
 
                if (mesh_uses_displist(me)) {  /* subsurf */
                        if (ob==G.obedit) {
-                               me->derived= subsurf_make_derived_from_editmesh(em, me->subdiv, me->flag, me->subsurftype);
+                               me->derived= subsurf_make_derived_from_editmesh(em, me->subdiv, me->subsurftype);
                        } else {
-                               me->derived= subsurf_make_derived_from_mesh(me, me->subdiv, me->flag);
+                               me->derived= subsurf_make_derived_from_mesh(me, me->subdiv);
                        }
                }
 
index 53f6f724b2268b9c4cf6a73043d18d6501346bde..4dd82233a72a3a276e63825a3753f3ccf4c2daf5 100644 (file)
@@ -435,7 +435,7 @@ void make_orco_displist_mesh(Object *ob, int subdivlvl)
                cp_key(0, me->totvert, me->totvert, (char*) me->mvert->co, me->key, me->key->refkey, 0);
        }
 
-       dm= subsurf_make_derived_from_mesh(me, subdivlvl, me->flag);
+       dm= subsurf_make_derived_from_mesh(me, subdivlvl);
        dlm= dm->convertToDispListMesh(dm);
        dm->release(dm);
        
index 8c8863c332475e8540450d723121e3db20259719..2c68ef16858a631c5df9f062bcc5d76e5f4470c7 100644 (file)
@@ -922,7 +922,7 @@ static int hypermesh_get_nedges(HyperMesh *hme) {
 }
 
 /* flag is me->flag, for 'optim' */
-static DispListMesh *hypermesh_to_displistmesh(HyperMesh *hme, short flag) {
+static DispListMesh *hypermesh_to_displistmesh(HyperMesh *hme) {
        int nverts= hypermesh_get_nverts(hme);
        int nedges= hypermesh_get_nedges(hme);
        int nfaces= hypermesh_get_nfaces(hme);
@@ -958,11 +958,6 @@ static DispListMesh *hypermesh_to_displistmesh(HyperMesh *hme, short flag) {
                dlm->editedge= MEM_callocN(dlm->totedge*sizeof(EditEdge *), "dlm->editface");
                dlm->editface= MEM_mallocN(dlm->totface*sizeof(EditFace *), "dlm->editedge");
        }
-       if (hme->orig_me) {
-               dlm->flag= hme->orig_me->flag;
-       } else {
-               dlm->flag= flag;
-       }
        
        if (hme->hasuvco)
                dlm->tface= MEM_callocN(dlm->totface*sizeof(*dlm->tface), "dlm->tface");
@@ -1071,8 +1066,7 @@ static DispListMesh *hypermesh_to_displistmesh(HyperMesh *hme, short flag) {
 }
 
 /* flag is me->flag, and 'optim' */
-static DispListMesh *subsurf_subdivide_to_displistmesh(HyperMesh *hme, short subdiv,
-                                                                                               short flag, short type) {
+static DispListMesh *subsurf_subdivide_to_displistmesh(HyperMesh *hme, short subdiv, short type) {
        DispListMesh *dlm;
        int i;
 
@@ -1089,46 +1083,46 @@ static DispListMesh *subsurf_subdivide_to_displistmesh(HyperMesh *hme, short sub
                hme= tmp;
        }
 
-       dlm= hypermesh_to_displistmesh(hme, flag);
+       dlm= hypermesh_to_displistmesh(hme);
        hypermesh_free(hme);
        
        return dlm;
 }
 
-static DispListMesh *subsurf_make_dispListMesh_from_editmesh(EditMesh *em, int subdivLevels, int flags, short type) {
+static DispListMesh *subsurf_make_dispListMesh_from_editmesh(EditMesh *em, int subdivLevels, short type) {
        if (subdivLevels<1) {
                return displistmesh_from_editmesh(em);
 #ifdef USE_CCGSUBSURFLIB
        } else if (type==ME_CCG_SUBSURF) {
-               return subsurf_ccg_make_dispListMesh_from_editmesh(em, subdivLevels, flags);
+               return subsurf_ccg_make_dispListMesh_from_editmesh(em, subdivLevels);
 #endif
        } else {
                HyperMesh *hme= hypermesh_from_editmesh(em, subdivLevels);
        
-               return subsurf_subdivide_to_displistmesh(hme, subdivLevels, flags, type);
+               return subsurf_subdivide_to_displistmesh(hme, subdivLevels, type);
        }
 }
 
-DerivedMesh *subsurf_make_derived_from_editmesh(EditMesh *em, int subdivLevels, int flags, short type) {
-       return derivedmesh_from_displistmesh(em, subsurf_make_dispListMesh_from_editmesh(em, subdivLevels, flags, type));
+DerivedMesh *subsurf_make_derived_from_editmesh(EditMesh *em, int subdivLevels, short type) {
+       return derivedmesh_from_displistmesh(em, subsurf_make_dispListMesh_from_editmesh(em, subdivLevels, type));
 }
 
-static DispListMesh *subsurf_make_dispListMesh_from_mesh(Mesh *me, int subdivLevels, int flags) {
+static DispListMesh *subsurf_make_dispListMesh_from_mesh(Mesh *me, int subdivLevels) {
        if (subdivLevels<1) {
                return displistmesh_from_mesh(me, NULL);
 #ifdef USE_CCGSUBSURFLIB
        } else if (me->subsurftype==ME_CCG_SUBSURF) {
-               return subsurf_ccg_make_dispListMesh_from_mesh(me, subdivLevels, flags);
+               return subsurf_ccg_make_dispListMesh_from_mesh(me, subdivLevels);
 #endif
        } else {
                HyperMesh *hme= hypermesh_from_mesh(me, subdivLevels);
 
-               return subsurf_subdivide_to_displistmesh(hme, subdivLevels, flags, me->subsurftype);
+               return subsurf_subdivide_to_displistmesh(hme, subdivLevels, me->subsurftype);
        }
 }
 
-DerivedMesh *subsurf_make_derived_from_mesh(Mesh *me, int subdivLevels, int flags) {
-       return derivedmesh_from_displistmesh(NULL, subsurf_make_dispListMesh_from_mesh(me, subdivLevels, flags));
+DerivedMesh *subsurf_make_derived_from_mesh(Mesh *me, int subdivLevels) {
+       return derivedmesh_from_displistmesh(NULL, subsurf_make_dispListMesh_from_mesh(me, subdivLevels));
 }
 
        // editarmature.c
index 98b47482d0ce579d57effd38700782d694bbe344..00086c08e47eb0992994d3ab8f419aa2eb33a257 100644 (file)
@@ -240,7 +240,7 @@ static int getFaceIndex(CCGSubSurf *ss, CCGFace *f, int S, int x, int y, int edg
                return faceBase + 1 + (gridSize-2)*numVerts + S*(gridSize-2)*(gridSize-2) + (y-1)*(gridSize-2) + (x-1);
        }
 }
-static DispListMesh *subSurf_createDispListMesh(SubSurf *ssm, int doOptEdges) {
+static DispListMesh *subSurf_createDispListMesh(SubSurf *ssm) {
        CCGSubSurf *ss= ssm->subSurf;
        DispListMesh *dlm= MEM_callocN(sizeof(*dlm), "dlm");
        int edgeSize= ccgSubSurf_getEdgeSize(ss);
@@ -253,12 +253,6 @@ static DispListMesh *subSurf_createDispListMesh(SubSurf *ssm, int doOptEdges) {
        CCGEdgeIterator *ei;
        CCGFaceIterator *fi;
        
-       if (doOptEdges) {
-               dlm->flag= ME_OPT_EDGES;
-       } else {
-               dlm->flag= 0;
-       }
-
        dlm->totvert= ccgSubSurf_getNumFinalVerts(ss);
        dlm->totedge= ccgSubSurf_getNumFinalEdges(ss);
        dlm->totface= ccgSubSurf_getNumFinalFaces(ss);
@@ -491,12 +485,10 @@ static DispListMesh *subSurf_createDispListMesh(SubSurf *ssm, int doOptEdges) {
                                                dlm->editface[i] = ccgSubSurf_getFaceFaceHandle(ss, f);
                                        }
 
-                                       if (doOptEdges) {
-                                               if (x+1==gridSize-1)
-                                                       mf->edcode|= ME_V2V3;
-                                               if (y+1==gridSize-1)
-                                                       mf->edcode|= ME_V1V2;
-                                       }
+                                       if (x+1==gridSize-1)
+                                               mf->edcode|= ME_V2V3;
+                                       if (y+1==gridSize-1)
+                                               mf->edcode|= ME_V1V2;
 
                                        for (j=0; j<4; j++) {
                                                int fx= x + (j==1||j==2);
@@ -633,26 +625,26 @@ static void subSurf_sync(SubSurf *ss) {
        ccgSubSurf_processSync(ss->subSurf);
 }
 
-DispListMesh *subsurf_ccg_make_dispListMesh_from_editmesh(EditMesh *em, int subdivLevels, int flags) {
+DispListMesh *subsurf_ccg_make_dispListMesh_from_editmesh(EditMesh *em, int subdivLevels) {
        SubSurf *ss= subSurf_fromEditmesh(em, subdivLevels);
        DispListMesh *dlm;
 
        subSurf_sync(ss);
 
-       dlm= subSurf_createDispListMesh(ss, (flags&ME_OPT_EDGES)?1:0);
+       dlm= subSurf_createDispListMesh(ss);
 
        subSurf_free(ss);
 
        return dlm;
 }
 
-DispListMesh *subsurf_ccg_make_dispListMesh_from_mesh(Mesh *me, int subdivLevels, int flags) {
+DispListMesh *subsurf_ccg_make_dispListMesh_from_mesh(Mesh *me, int subdivLevels) {
        SubSurf *ss= subSurf_fromMesh(me, subdivLevels);
        DispListMesh *dlm;
 
        subSurf_sync(ss);
 
-       dlm= subSurf_createDispListMesh(ss, (flags&ME_OPT_EDGES)?1:0);
+       dlm= subSurf_createDispListMesh(ss);
        
        subSurf_free(ss);
        
index 0d67fe6478a0009f621ea72e12a117c99e435684..334d1d860e23f6e2bef58cdc5d6727aad3d1a4ff 100644 (file)
@@ -1482,9 +1482,6 @@ static void init_render_mesh(Object *ob)
                                                flag= mface->flag;
                                                edcode= mface->edcode;
                                                
-                                               /* cannot use edges data for render, this has no vcol or tface... */
-                                               if(dlm && (dlm->flag & ME_OPT_EDGES)==0) edcode= ME_V1V2|ME_V2V3|ME_V3V4|ME_V4V1;
-                                               
                                                if(v3) {
                                                        float len;
                                                        
index 748d6508f5594ad0fd368318ab7d609019b36bf1..708e93454ebb6f16e36870406a68225f5e80b700 100644 (file)
@@ -2180,7 +2180,7 @@ void convertmenu(void)
                                                for(a=0; a<ob1->totcol; a++) id_us_plus((ID *)me->mat[a]);
                                        }
                                        
-                                       dm= subsurf_make_derived_from_mesh(oldme, oldme->subdiv, oldme->flag);
+                                       dm= subsurf_make_derived_from_mesh(oldme, oldme->subdiv);
                                        dlm= dm->convertToDispListMesh(dm);
                                        dm->release(dm);