Avoid accessing MTFace drawing subsurf
authorCampbell Barton <ideasman42@gmail.com>
Fri, 17 Jul 2015 13:52:41 +0000 (23:52 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 17 Jul 2015 13:52:41 +0000 (23:52 +1000)
source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/editors/space_view3d/drawobject.c

index df6e33ed19ca7e249d3130a09bd15a9faff379e8..d31a74f4102830439a6e53ce4cbc79ea8e3a066b 100644 (file)
@@ -2617,7 +2617,7 @@ static void ccgDM_drawFacesTex_common(DerivedMesh *dm,
        CCGKey key;
        int colType;
        const  MLoopCol *mloopcol;
-       MTFace *tf = DM_get_tessface_data_layer(dm, CD_MTFACE);
+       MTexPoly *mtexpoly = DM_get_poly_data_layer(dm, CD_MTEXPOLY);
        DMFlagMat *faceFlags = ccgdm->faceFlags;
        DMDrawOption draw_option;
        int i, totpoly;
@@ -2689,13 +2689,8 @@ static void ccgDM_drawFacesTex_common(DerivedMesh *dm,
                        }
 
                        if (drawParams) {
-                               MTexPoly tpoly;
-                               if (tf) {
-                                       memset(&tpoly, 0, sizeof(tpoly));
-                                       ME_MTEXFACE_CPY(&tpoly, tf + actualFace);
-                               }
-
-                               draw_option = drawParams((use_tface && tf) ? &tpoly : NULL, (mloopcol != NULL), mat_nr);
+                               MTexPoly *tp = (use_tface && mtexpoly) ? &mtexpoly[actualFace] : NULL;
+                               draw_option = drawParams(tp, (mloopcol != NULL), mat_nr);
                        }
                        else if (index != ORIGINDEX_NONE)
                                draw_option = (drawParamsMapped) ? drawParamsMapped(userData, index, mat_nr) : DM_DRAW_OPTION_NORMAL;
index 4203aa77dd08cf730a1cd019009811f39be12a59..a32d1626418be2be806b6de98316ab153e5469c3 100644 (file)
@@ -4028,7 +4028,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
 
        /* Check to draw dynamic paint colors (or weights from WeightVG modifiers).
         * Note: Last "preview-active" modifier in stack will win! */
-       if (DM_get_tessface_data_layer(dm, CD_PREVIEW_MCOL) && modifiers_isPreview(ob))
+       if (DM_get_poly_data_layer(dm, CD_PREVIEW_MLOOPCOL) && modifiers_isPreview(ob))
                draw_flags |= DRAW_MODIFIERS_PREVIEW;
 
        /* Unwanted combination */