diff options
author | Daniel Dunbar <daniel@zuster.org> | 2004-03-15 00:21:08 +0300 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2004-03-15 00:21:08 +0300 |
commit | 807db2ea4077cb198c696c65b77a6bab23cacd02 (patch) | |
tree | f5a6b14bb321bb0cab36e5c4c34b4b7724c51897 /source | |
parent | dd3c9c0c466d74d20e42db6ec994dc0ddbb7ee9b (diff) |
- redundant code killing for MFaceInt removal
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/python/api2_2x/NMesh.c | 48 | ||||
-rw-r--r-- | source/blender/src/drawmesh.c | 31 |
2 files changed, 19 insertions, 60 deletions
diff --git a/source/blender/python/api2_2x/NMesh.c b/source/blender/python/api2_2x/NMesh.c index c7561fbd903..ef68ae9694c 100644 --- a/source/blender/python/api2_2x/NMesh.c +++ b/source/blender/python/api2_2x/NMesh.c @@ -1304,30 +1304,6 @@ static BPy_NMFace *nmface_from_data(BPy_NMesh *mesh, int vidxs[4], return newf; } -static BPy_NMFace *nmface_from_shortdata(BPy_NMesh *mesh, - MFace *face, TFace *tface, MCol *col) -{ - int vidxs[4]; - vidxs[0] = face->v1; - vidxs[1] = face->v2; - vidxs[2] = face->v3; - vidxs[3] = face->v4; - - return nmface_from_data(mesh, vidxs, face->mat_nr, face->flag, tface, col); -} - -static BPy_NMFace *nmface_from_intdata(BPy_NMesh *mesh, - MFace *face, TFace *tface, MCol *col) -{ - int vidxs[4]; - vidxs[0] = face->v1; - vidxs[1] = face->v2; - vidxs[2] = face->v3; - vidxs[3] = face->v4; - - return nmface_from_data(mesh, vidxs, face->mat_nr, face->flag, tface, col); -} - static BPy_NMVert *nmvert_from_data(BPy_NMesh *me, MVert *vert, MSticky *st, float *co, int idx, char flag) { @@ -1390,7 +1366,6 @@ static PyObject *new_NMesh_internal(Mesh *oldmesh, else { MVert *mverts; MSticky *msticky; - MFace *mfaceints; MFace *mfaces; TFace *tfaces; MCol *mcols; @@ -1403,7 +1378,7 @@ static PyObject *new_NMesh_internal(Mesh *oldmesh, msticky = NULL; mfaces = NULL; mverts = dlm->mvert; - mfaceints = dlm->mface; + mfaces = dlm->mface; tfaces = dlm->tface; mcols = dlm->mcol; @@ -1418,7 +1393,6 @@ static PyObject *new_NMesh_internal(Mesh *oldmesh, me->subdiv[1] = oldmesh->subdivr; me->smoothresh = oldmesh->smoothresh; - mfaceints = NULL; msticky = oldmesh->msticky; mverts = oldmesh->mvert; mfaces = oldmesh->mface; @@ -1450,17 +1424,15 @@ static PyObject *new_NMesh_internal(Mesh *oldmesh, for (i = 0; i < totface; i++) { TFace *oldtf = tfaces?&tfaces[i]:NULL; MCol *oldmc = mcols?&mcols[i*4]:NULL; - - if (mfaceints) { - MFace *oldmf = &mfaceints[i]; - PyList_SetItem (me->faces, i, - (PyObject *)nmface_from_intdata(me, oldmf, oldtf, oldmc)); - } - else { - MFace *oldmf = &mfaces[i]; - PyList_SetItem (me->faces, i, - (PyObject *)nmface_from_shortdata(me, oldmf, oldtf, oldmc)); - } + MFace *oldmf = &mfaces[i]; + int vidxs[4]; + vidxs[0] = oldmf->v1; + vidxs[1] = oldmf->v2; + vidxs[2] = oldmf->v3; + vidxs[3] = oldmf->v4; + + PyList_SetItem (me->faces, i, + (PyObject *)nmface_from_data(me, vidxs, oldmf->mat_nr, oldmf->flag, oldtf, oldmc)); } me->materials = EXPP_PyList_fromMaterialList(oldmesh->mat, oldmesh->totcol); } diff --git a/source/blender/src/drawmesh.c b/source/blender/src/drawmesh.c index 4b1338cba3f..1e851e0dedd 100644 --- a/source/blender/src/drawmesh.c +++ b/source/blender/src/drawmesh.c @@ -780,7 +780,6 @@ void draw_tface_mesh(Object *ob, Mesh *me, int dt) if(dt > OB_SOLID) { bProperty *prop = get_property(ob, "Text"); - MFace *mfaceint= NULL; int editing= (G.f & (G_VERTEXPAINT+G_FACESELECT+G_TEXTUREPAINT+G_WEIGHTPAINT)) && (ob==((G.scene->basact) ? (G.scene->basact->object) : 0)); MVert *mvert=NULL; int totface; @@ -796,7 +795,7 @@ void draw_tface_mesh(Object *ob, Mesh *me, int dt) else { totface= dlm->totface; mvert= dlm->mvert; - mfaceint= dlm->mface; + mface= dlm->mface; tface= dlm->tface; } } @@ -813,26 +812,14 @@ void draw_tface_mesh(Object *ob, Mesh *me, int dt) for (a=0; a<totface; a++, tface++) { int v1idx, v2idx, v3idx, v4idx, mf_smooth, matnr, badtex; float *v1, *v2, *v3, *v4; - - if (mfaceint) { - MFace *mf= &mfaceint[a]; - - v1idx= mf->v1; - v2idx= mf->v2; - v3idx= mf->v3; - v4idx= mf->v4; - mf_smooth= mf->flag & ME_SMOOTH; - matnr= mf->mat_nr; - } else { - MFace *mf= &mface[a]; - - v1idx= mf->v1; - v2idx= mf->v2; - v3idx= mf->v3; - v4idx= mf->v4; - mf_smooth= mf->flag & ME_SMOOTH; - matnr= mf->mat_nr; - } + MFace *mf= &mface[a]; + + v1idx= mf->v1; + v2idx= mf->v2; + v3idx= mf->v3; + v4idx= mf->v4; + mf_smooth= mf->flag & ME_SMOOTH; + matnr= mf->mat_nr; if(v3idx==0) continue; if(tface->flag & TF_HIDE) continue; |