diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2015-01-11 23:28:30 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2015-01-11 23:29:51 +0300 |
commit | 1864253db06957ec344e6504b1c33e7f83cdaa99 (patch) | |
tree | 1503e0cf845d98c707740824a931bafd81fb279e /source/blender/blenkernel | |
parent | 0a5ad655122e376d1f8d4d6c21b0f83c09d5ad5d (diff) |
Fix T43208 material flickering in edit mode.
Happens because material setting now occurs in the derived mesh drawing
routine as it should. However that means that it also happens during
selection and that influenced the drawing state somehow.
In 2.72 this did not occur because material setting happened during draw
setting (skip or draw) instead of after the draw setting passed (so
selection would skip it by use another draw setting function). Of course
this violated design but worked.
Made it now so backbuffer selection does not enable materials (it's
redundant in those cases anyway).
This could be ported to a possible 'a' release but as is classic with
display code there may be some other places that it could backfire.
Tested fix with texture/vertex painting and selection which use
backbuffer for both subsurf and regular meshes and it seems to work OK.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/editderivedmesh.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/editderivedmesh.c b/source/blender/blenkernel/intern/editderivedmesh.c index 204a015d9fb..eb7c78c2760 100644 --- a/source/blender/blenkernel/intern/editderivedmesh.c +++ b/source/blender/blenkernel/intern/editderivedmesh.c @@ -56,7 +56,6 @@ #include "MEM_guardedalloc.h" #include "GPU_extensions.h" -#include "GPU_draw.h" #include "GPU_glew.h" extern GLubyte stipple_quarttone[128]; /* glutil.c, bad level data */ @@ -527,7 +526,8 @@ static void emDM_drawMappedFaces(DerivedMesh *dm, setDrawOptions(userData, BM_elem_index_get(efa))); if (draw_option != DM_DRAW_OPTION_SKIP) { const GLenum poly_type = GL_TRIANGLES; /* BMESH NOTE, this is odd but keep it for now to match trunk */ - GPU_enable_material(efa->mat_nr + 1, NULL); + if (setMaterial) + setMaterial(efa->mat_nr + 1, NULL); if (draw_option == DM_DRAW_OPTION_STIPPLE) { /* enabled with stipple */ if (poly_prev != GL_ZERO) glEnd(); @@ -609,16 +609,17 @@ static void emDM_drawMappedFaces(DerivedMesh *dm, int drawSmooth; efa = ltri[0]->f; - drawSmooth = lnors || ((flag & DM_DRAW_ALWAYS_SMOOTH) ? 1 : BM_elem_flag_test(efa, BM_ELEM_SMOOTH)); + drawSmooth = lnors || ((flag & DM_DRAW_ALWAYS_SMOOTH) ? 1 : BM_elem_flag_test(efa, BM_ELEM_SMOOTH)); - draw_option = (!setDrawOptions ? - DM_DRAW_OPTION_NORMAL : - setDrawOptions(userData, BM_elem_index_get(efa))); + draw_option = (setDrawOptions ? + setDrawOptions(userData, BM_elem_index_get(efa)) : + DM_DRAW_OPTION_NORMAL); if (draw_option != DM_DRAW_OPTION_SKIP) { const GLenum poly_type = GL_TRIANGLES; /* BMESH NOTE, this is odd but keep it for now to match trunk */ - GPU_enable_material(efa->mat_nr + 1, NULL); + if (setMaterial) + setMaterial(efa->mat_nr + 1, NULL); if (draw_option == DM_DRAW_OPTION_STIPPLE) { /* enabled with stipple */ |