fix for bug in do_version_tface(), was assigning 'tf->mode' before tf was defined, also comment unused var.

This commit is contained in:
Campbell Barton 2011-09-20 04:54:13 +00:00
parent c61ab5f5d1
commit 79c19590e9
2 changed files with 5 additions and 2 deletions

@ -988,14 +988,14 @@ static void emDM_drawMappedFacesGLSL(DerivedMesh *dm,
EditFace *efa;
DMVertexAttribs attribs= {{{0}}};
GPUVertexAttribs gattribs;
int tfoffset;
/* int tfoffset; */ /* UNUSED */
int i, b, matnr, new_matnr, dodraw, layer;
dodraw = 0;
matnr = -1;
layer = CustomData_get_layer_index(&em->fdata, CD_MTFACE);
tfoffset = (layer == -1)? -1: em->fdata.layers[layer].offset;
/* tfoffset = (layer == -1)? -1: em->fdata.layers[layer].offset; */
/* always use smooth shading even for flat faces, else vertex colors wont interpolate */
glShadeModel(GL_SMOOTH);

@ -1932,6 +1932,9 @@ int do_version_tface(Main *main, int fileload)
/* loop over all the faces and stop at the ones that use the material*/
for(a=0, mf=me->mface; a<me->totface; a++, mf++) {
/* texface data for this face */
tf = ((MTFace*)cdl->data) + a;
if(me->mat[(int)mf->mat_nr] != ma) continue;
else tf->mode |= TF_CONVERTED;
}