Properly fix T45477

Code was actually skipping setting color selection indices and previous
commit actually broke mask selection in texture painting.
All should work now.
This commit is contained in:
2015-07-19 18:35:09 +02:00
parent 8f1c1ef3a9
commit a597a380bb
4 changed files with 8 additions and 6 deletions

View 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 {

View 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;

View 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);
}
}

View 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 */
}