diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-07-17 16:52:41 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-07-17 16:52:41 +0300 |
commit | d4c061749690e3e265bd0ab4644c1f919c02fb16 (patch) | |
tree | 229ff05b65fcdeb54a2fd3753c29831439302032 | |
parent | 955c13d61413ea185f300f3ed64fee4b5785db0e (diff) |
Avoid accessing MTFace drawing subsurf
-rw-r--r-- | source/blender/blenkernel/intern/subsurf_ccg.c | 11 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 2 |
2 files changed, 4 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index df6e33ed19c..d31a74f4102 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 4203aa77dd0..a32d1626418 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 */ |