Removed the struct MFaceInt from DNA_mesh_types.h (by the recommendation

of zr). This struct was never written to file and the new 'int based'
MFace can be used in it's place. Some removal of redundant code could
perhaps be done now (I didn't do any though, just "s/MFaceInt/MFace/").
This commit is contained in:
Chris Want
2004-03-14 21:00:51 +00:00
parent a91ef3f4e1
commit dd3c9c0c46
9 changed files with 22 additions and 35 deletions

View File

@@ -63,7 +63,7 @@ struct DispListMesh {
int totvert, totface;
struct MVert *mvert;
struct MCol *mcol;
struct MFaceInt *mface;
struct MFace *mface;
struct TFace *tface;
int flag;
};

View File

@@ -130,7 +130,7 @@ DispListMesh *displistmesh_from_editmesh(ListBase *verts, ListBase *edges, ListB
i=0;
for (evl= faces->first; evl; evl= evl->next, i++) {
MFaceInt *mfNew= &dlm->mface[i];
MFace *mfNew= &dlm->mface[i];
mfNew->v1= (int) evl->v1->prev;
mfNew->v2= (int) evl->v2->prev;
@@ -147,7 +147,7 @@ DispListMesh *displistmesh_from_editmesh(ListBase *verts, ListBase *edges, ListB
}
}
for (eed= edges->first; eed; eed= eed->next, i++) {
MFaceInt *mfNew= &dlm->mface[i];
MFace *mfNew= &dlm->mface[i];
mfNew->v1= (int) eed->v1->prev;
mfNew->v2= (int) eed->v2->prev;
@@ -185,7 +185,7 @@ DispListMesh *displistmesh_from_mesh(Mesh *me, float *extverts) {
}
for (i=0; i<dlm->totface; i++) {
MFace *mfOld= &((MFace*) me->mface)[i];
MFaceInt *mfNew= &dlm->mface[i];
MFace *mfNew= &dlm->mface[i];
mfNew->v1= mfOld->v1;
mfNew->v2= mfOld->v2;
@@ -222,13 +222,13 @@ static DispListMesh *displistmesh_copy(DispListMesh *odlm) {
void displistmesh_calc_vert_normals(DispListMesh *dlm) {
MVert *mverts= dlm->mvert;
int nmverts= dlm->totvert;
MFaceInt *mfaces= dlm->mface;
MFace *mfaces= dlm->mface;
int nmfaces= dlm->totface;
float (*tnorms)[3]= MEM_callocN(nmverts*sizeof(*tnorms), "tnorms");
int i;
for (i=0; i<nmfaces; i++) {
MFaceInt *mf= &mfaces[i];
MFace *mf= &mfaces[i];
float f_no[3];
if (!mf->v3)
@@ -275,7 +275,7 @@ void displistmesh_to_mesh(DispListMesh *dlm, Mesh *me) {
for (i=0; i<me->totface; i++) {
MFace *mf= &mfaces[i];
MFaceInt *oldmf= &dlm->mface[i];
MFace *oldmf= &dlm->mface[i];
mf->v1= oldmf->v1;
mf->v2= oldmf->v2;
@@ -716,7 +716,7 @@ void addnormalsDispList(Object *ob, ListBase *lb)
dl->nors= MEM_mallocN(sizeof(*dl->nors)*3*dlm->totface, "meshnormals");
for (i=0; i<dlm->totface; i++) {
MFaceInt *mf= &dlm->mface[i];
MFace *mf= &dlm->mface[i];
float *no= &dl->nors[i*3];
if (mf->v3) {
@@ -904,7 +904,7 @@ void shadeDispList(Object *ob)
}
for (i=0; i<dlm->totface; i++) {
MFaceInt *mf= &dlm->mface[i];
MFace *mf= &dlm->mface[i];
if (mf->v3) {
int j, vidx[4], nverts= mf->v4?4:3;

View File

@@ -768,7 +768,7 @@ static DispListMesh *hypermesh_to_displistmesh(HyperMesh *hme, short flag) {
HyperEdge *e;
TFace *tfaces;
MFace *mfaces;
MFaceInt *mf;
MFace *mf;
int i, j, handles=0;
/* hme->orig_me==NULL if we are working on an editmesh */

View File

@@ -45,25 +45,12 @@ struct Mesh;
struct OcInfo;
struct bDeformGroup;
/* This little gem is needed to satisfy the curious realms of sdna. On
* the other hand, it also interferes with sys/types.h, so we get rid
* of it asap. */
typedef struct MFace {
unsigned int v1, v2, v3, v4;
char puno, mat_nr;
char edcode, flag;
} MFace;
#undef ushort
typedef struct MFaceInt {
int v1, v2, v3, v4;
char puno, mat_nr;
char edcode, flag;
} MFaceInt;
typedef struct TFace {
/* this one gets interpreted as a image in texture.c */

View File

@@ -1317,7 +1317,7 @@ static BPy_NMFace *nmface_from_shortdata(BPy_NMesh *mesh,
}
static BPy_NMFace *nmface_from_intdata(BPy_NMesh *mesh,
MFaceInt *face, TFace *tface, MCol *col)
MFace *face, TFace *tface, MCol *col)
{
int vidxs[4];
vidxs[0] = face->v1;
@@ -1390,7 +1390,7 @@ static PyObject *new_NMesh_internal(Mesh *oldmesh,
else {
MVert *mverts;
MSticky *msticky;
MFaceInt *mfaceints;
MFace *mfaceints;
MFace *mfaces;
TFace *tfaces;
MCol *mcols;
@@ -1452,7 +1452,7 @@ static PyObject *new_NMesh_internal(Mesh *oldmesh,
MCol *oldmc = mcols?&mcols[i*4]:NULL;
if (mfaceints) {
MFaceInt *oldmf = &mfaceints[i];
MFace *oldmf = &mfaceints[i];
PyList_SetItem (me->faces, i,
(PyObject *)nmface_from_intdata(me, oldmf, oldtf, oldmc));
}

View File

@@ -1278,7 +1278,7 @@ static void init_render_mesh(Object *ob)
VlakRen *vlr, *vlr1;
VertRen *ver;
Material *ma;
MFaceInt *mfaceint = NULL;
MFace *mfaceint = NULL;
MSticky *ms;
PartEff *paf;
DispList *dl;

View File

@@ -258,7 +258,7 @@ static void decimate_faces(void)
if( LOD_PreprocessMesh(&lod) ) {
DispList *dl;
DispListMesh *dlm;
MFaceInt *mfaceint;
MFace *mfaceint;
/* we assume the decim_faces tells how much to reduce */
@@ -273,7 +273,7 @@ static void decimate_faces(void)
dl->type= DL_MESH;
dlm=dl->mesh= MEM_callocN(sizeof(DispListMesh), "dispmesh");
dlm->mvert= MEM_callocN(lod.vertex_num*sizeof(MVert), "mvert");
dlm->mface= MEM_callocN(lod.face_num*sizeof(MFaceInt), "mface");
dlm->mface= MEM_callocN(lod.face_num*sizeof(MFace), "mface");
dlm->totvert= lod.vertex_num;
dlm->totface= lod.face_num;
@@ -325,7 +325,7 @@ static void decimate_apply(void)
DispListMesh *dlm;
Mesh *me;
MFace *mface;
MFaceInt *mfaceint;
MFace *mfaceint;
int a;
if(G.obedit) return;

View File

@@ -780,7 +780,7 @@ void draw_tface_mesh(Object *ob, Mesh *me, int dt)
if(dt > OB_SOLID) {
bProperty *prop = get_property(ob, "Text");
MFaceInt *mfaceint= NULL;
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;
@@ -815,7 +815,7 @@ void draw_tface_mesh(Object *ob, Mesh *me, int dt)
float *v1, *v2, *v3, *v4;
if (mfaceint) {
MFaceInt *mf= &mfaceint[a];
MFace *mf= &mfaceint[a];
v1idx= mf->v1;
v2idx= mf->v2;

View File

@@ -1101,7 +1101,7 @@ static void displistmesh_draw_wire(DispListMesh *dlm) {
int i;
for (i=0; i<dlm->totface; i++) {
MFaceInt *mf= &dlm->mface[i];
MFace *mf= &dlm->mface[i];
if(dlm->flag & ME_OPT_EDGES) {
int test= mf->edcode;
@@ -1152,7 +1152,7 @@ static void displistmesh_draw_solid(DispListMesh *dlm, int drawsmooth, float *no
glBegin(lmode= GL_QUADS);
for (i=0; i<dlm->totface; i++) {
MFaceInt *mf= &dlm->mface[i];
MFace *mf= &dlm->mface[i];
if (mf->v3) {
int nmode= mf->v4?GL_QUADS:GL_TRIANGLES;
@@ -1205,7 +1205,7 @@ static void displistmesh_draw_shaded(DispListMesh *dlm, unsigned char *vcols1, u
glBegin(lmode= GL_QUADS);
for (i=0; i<dlm->totface; i++) {
MFaceInt *mf= &dlm->mface[i];
MFace *mf= &dlm->mface[i];
if (mf->v3) {
int nmode= mf->v4?GL_QUADS:GL_TRIANGLES;