Commit: d4c061749690e3e265bd0ab4644c1f919c02fb16
Author: Campbell Barton
Date:   Fri Jul 17 23:52:41 2015 +1000
Branches: master
https://developer.blender.org/rBd4c061749690e3e265bd0ab4644c1f919c02fb16

Avoid accessing MTFace drawing subsurf

===================================================================

M       source/blender/blenkernel/intern/subsurf_ccg.c
M       source/blender/editors/space_view3d/drawobject.c

===================================================================

diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c 
b/source/blender/blenkernel/intern/subsurf_ccg.c
index df6e33e..d31a74f 100644
--- a/source/blender/blenkernel/intern/subsurf_ccg.c
+++ b/source/blender/blenkernel/intern/subsurf_ccg.c
@@ -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;
diff --git a/source/blender/editors/space_view3d/drawobject.c 
b/source/blender/editors/space_view3d/drawobject.c
index 4203aa7..a32d162 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -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 */

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to