Properly fix T45477
authorAntony Riakiotakis <kalast@gmail.com>
Sun, 19 Jul 2015 16:35:09 +0000 (18:35 +0200)
committerAntony Riakiotakis <kalast@gmail.com>
Sun, 19 Jul 2015 16:35:09 +0000 (18:35 +0200)
Code was actually skipping setting color selection indices and previous
commit actually broke mask selection in texture painting.
All should work now.

source/blender/blenkernel/BKE_DerivedMesh.h
source/blender/blenkernel/intern/cdderivedmesh.c
source/blender/editors/space_view3d/drawobject.c
source/blender/windowmanager/intern/wm_subwindow.c

index 09749629eeb6b04ad24c526b489f7634557d14dc..2c74815a494ce712f678975b6e79862d1722f711 100644 (file)
@@ -150,6 +150,7 @@ typedef enum DMDrawFlag {
        DM_DRAW_USE_ACTIVE_UV       = (1 << 2),
        DM_DRAW_USE_TEXPAINT_UV     = (1 << 3),
        DM_DRAW_SKIP_HIDDEN         = (1 << 4),
+       DM_DRAW_SKIP_SELECT         = (1 << 5),
 } DMDrawFlag;
 
 typedef enum DMForeachFlag {
index 9307abc8a085ab6fe741a2203c0eaa763df443fa..69c6c4ffceff62d66adb07fac78f3e023211c61f 100644 (file)
@@ -652,7 +652,7 @@ static void cdDM_drawMappedFaces(
        totpoly = dm->getNumPolys(dm);
 
        /* if we do selection, fill the selection buffer color */
-       if (G.f & G_BACKBUFSEL) {
+       if ((G.f & G_BACKBUFSEL) && !(flag & DM_DRAW_SKIP_SELECT)) {
                Mesh *me = userData;
                unsigned int *fi_map;
 
index f7153908851712544a2087a30584cadee8e78312..9abc63ffc3795b0bb82917f15195b84b25f7c5a1 100644 (file)
@@ -8462,7 +8462,7 @@ static void bbs_mesh_solid_EM(BMEditMesh *em, Scene *scene, View3D *v3d,
 
        }
        else {
-               dm->drawMappedFaces(dm, bbs_mesh_mask__setSolidDrawOptions, NULL, NULL, em->bm, 0);
+               dm->drawMappedFaces(dm, bbs_mesh_mask__setSolidDrawOptions, NULL, NULL, em->bm, DM_DRAW_SKIP_SELECT);
        }
 }
 
index 94fe2a662b10d04cbf5959f4f43fcac93b01bc14..7dade62347c4b9772b70fb270104042eb37a6e38 100644 (file)
@@ -462,10 +462,11 @@ void WM_framebuffer_index_set(int index)
 void WM_framebuffer_index_get(int index, int *r_col)
 {
        const int col = index_to_framebuffer(index);
-       *r_col = ((col & 0xFF) << 24) | /* red */
-                (((col >>  8) & 0xFF) << 16) | /* green */
-                (((col >> 16) & 0xFF) << 8) | /* blue */
-                0xFF; /* alpha */
+       char *c_col = (char *)r_col;
+       c_col[0] = (col & 0xFF); /* red */
+       c_col[1] = ((col >>  8) & 0xFF); /* green */
+       c_col[2] = ((col >> 16) & 0xFF); /* blue */
+       c_col[3] = 0xFF; /* alpha */
 }