fix for bug in do_version_tface(), was assigning 'tf->mode' before tf was defined...
authorCampbell Barton <ideasman42@gmail.com>
Tue, 20 Sep 2011 04:54:13 +0000 (04:54 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 20 Sep 2011 04:54:13 +0000 (04:54 +0000)
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/material.c

index cac7da76e07bc779e2084463cfb8ac208012e16f..3d05411a8bcfb3e97b1c7536c2317967744e9ce5 100644 (file)
@@ -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);
index 6b8d486ae56e5636e78d3d8299b63bc1fbd05981..aeab4b177c95a68a18fea50eff71f07838ce5a24 100644 (file)
@@ -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;
                                        }