Merging r58475 through r58700 from trunk into soc-2013-depsgraph_mt
[blender.git] / source / blender / editors / space_view3d / drawobject.c
index d29d40a777a98ad43dee6f3a4308d2ba94640b56..74d16cdb60af9dba25bb5793e83ede31e3ed134a 100644 (file)
@@ -2002,7 +2002,7 @@ static void drawSelectedVertices(DerivedMesh *dm, Mesh *me)
        data.col[2] = act_col;
 
        glBegin(GL_POINTS);
-       dm->foreachMappedVert(dm, drawSelectedVertices__mapFunc, &data);
+       dm->foreachMappedVert(dm, drawSelectedVertices__mapFunc, &data, DM_FOREACH_NOP);
        glEnd();
 }
 
@@ -2068,7 +2068,7 @@ static void draw_dm_face_normals(BMEditMesh *em, Scene *scene, Object *ob, Deriv
        calcDrawDMNormalScale(ob, &data);
 
        glBegin(GL_LINES);
-       dm->foreachMappedFaceCenter(dm, draw_dm_face_normals__mapFunc, &data);
+       dm->foreachMappedFaceCenter(dm, draw_dm_face_normals__mapFunc, &data, DM_FOREACH_USE_NORMAL);
        glEnd();
 }
 
@@ -2088,7 +2088,7 @@ static void draw_dm_face_centers(BMEditMesh *em, DerivedMesh *dm, char sel)
        void *ptrs[2] = {em, &sel};
 
        bglBegin(GL_POINTS);
-       dm->foreachMappedFaceCenter(dm, draw_dm_face_centers__mapFunc, ptrs);
+       dm->foreachMappedFaceCenter(dm, draw_dm_face_centers__mapFunc, ptrs, DM_FOREACH_NOP);
        bglEnd();
 }
 
@@ -2133,7 +2133,7 @@ static void draw_dm_vert_normals(BMEditMesh *em, Scene *scene, Object *ob, Deriv
        calcDrawDMNormalScale(ob, &data);
 
        glBegin(GL_LINES);
-       dm->foreachMappedVert(dm, draw_dm_vert_normals__mapFunc, &data);
+       dm->foreachMappedVert(dm, draw_dm_vert_normals__mapFunc, &data, DM_FOREACH_USE_NORMAL);
        glEnd();
 }
 
@@ -2204,7 +2204,7 @@ static void draw_dm_verts(BMEditMesh *em, DerivedMesh *dm, const char sel, BMVer
        invert_m4(data.imat);
 
        bglBegin(GL_POINTS);
-       dm->foreachMappedVert(dm, draw_dm_verts__mapFunc, &data);
+       dm->foreachMappedVert(dm, draw_dm_verts__mapFunc, &data, DM_FOREACH_NOP);
        bglEnd();
 }
 
@@ -2534,7 +2534,7 @@ static void draw_dm_bweights(BMEditMesh *em, Scene *scene, DerivedMesh *dm)
                if (data.cd_layer_offset != -1) {
                        glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE) + 2);
                        bglBegin(GL_POINTS);
-                       dm->foreachMappedVert(dm, draw_dm_bweights__mapFunc, &data);
+                       dm->foreachMappedVert(dm, draw_dm_bweights__mapFunc, &data, DM_FOREACH_NOP);
                        bglEnd();
                }
        }
@@ -3132,9 +3132,10 @@ static void draw_em_fancy(Scene *scene, ARegion *ar, View3D *v3d,
        }
        else if (dt > OB_WIRE) {
                if (use_occlude_wire) {
+                       /* use the cageDM since it always overlaps the editmesh faces */
                        glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
-                       finalDM->drawMappedFaces(finalDM, draw_em_fancy__setFaceOpts,
-                                                GPU_enable_material, NULL, me->edit_btmesh, 0);
+                       cageDM->drawMappedFaces(cageDM, draw_em_fancy__setFaceOpts,
+                                               GPU_enable_material, NULL, me->edit_btmesh, 0);
                        glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
                }
                else if (check_object_draw_texture(scene, v3d, dt)) {
@@ -3851,8 +3852,8 @@ static void drawDispListsolid(ListBase *lb, Object *ob, const short dflag,
                                        glEnd();
 
                                        glEnable(GL_LIGHTING);
-                                       break;
                                }
+                               break;
                        case DL_SURF:
 
                                if (dl->index) {
@@ -7359,7 +7360,7 @@ static void bbs_obmode_mesh_verts(Object *ob, DerivedMesh *dm, int offset)
        data.offset = (void *)(intptr_t) offset;
        glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE));
        bglBegin(GL_POINTS);
-       dm->foreachMappedVert(dm, bbs_obmode_mesh_verts__mapFunc, &data);
+       dm->foreachMappedVert(dm, bbs_obmode_mesh_verts__mapFunc, &data, DM_FOREACH_NOP);
        bglEnd();
        glPointSize(1.0);
 }
@@ -7382,7 +7383,7 @@ static void bbs_mesh_verts(BMEditMesh *em, DerivedMesh *dm, int offset)
 
        glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE));
        bglBegin(GL_POINTS);
-       dm->foreachMappedVert(dm, bbs_mesh_verts__mapFunc, ptrs);
+       dm->foreachMappedVert(dm, bbs_mesh_verts__mapFunc, ptrs, DM_FOREACH_NOP);
        bglEnd();
        glPointSize(1.0);
 }
@@ -7448,7 +7449,7 @@ static void bbs_mesh_solid_EM(BMEditMesh *em, Scene *scene, View3D *v3d,
                        glPointSize(UI_GetThemeValuef(TH_FACEDOT_SIZE));
 
                        bglBegin(GL_POINTS);
-                       dm->foreachMappedFaceCenter(dm, bbs_mesh_solid__drawCenter, ptrs);
+                       dm->foreachMappedFaceCenter(dm, bbs_mesh_solid__drawCenter, ptrs, DM_FOREACH_NOP);
                        bglEnd();
                }