diff options
Diffstat (limited to 'source/blender/editors/interface/interface_draw.c')
-rw-r--r-- | source/blender/editors/interface/interface_draw.c | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index f9c97c36bdd..97299a6a766 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -142,13 +142,13 @@ void uiDrawBox(int mode, float minx, float miny, float maxx, float maxy, float r static void round_box_shade_col(float *col1, float *col2, float fac) { - float col[3]; + float col[4]; col[0]= (fac*col1[0] + (1.0f-fac)*col2[0]); col[1]= (fac*col1[1] + (1.0f-fac)*col2[1]); col[2]= (fac*col1[2] + (1.0f-fac)*col2[2]); - - glColor3fv(col); + col[3]= (fac*col1[3] + (1.0f-fac)*col2[3]); + glColor4fv(col); } @@ -159,7 +159,7 @@ void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, fl float vec[7][2]= {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293}, {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}}; float div= maxy-miny; - float coltop[3], coldown[3], color[4]; + float coltop[4], coldown[4], color[4]; int a; /* mult */ @@ -173,9 +173,11 @@ void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, fl coltop[0]= color[0]+shadetop; if(coltop[0]>1.0f) coltop[0]= 1.0f; coltop[1]= color[1]+shadetop; if(coltop[1]>1.0f) coltop[1]= 1.0f; coltop[2]= color[2]+shadetop; if(coltop[2]>1.0f) coltop[2]= 1.0f; + coltop[3]= color[3]; coldown[0]= color[0]+shadedown; if(coldown[0]<0.0f) coldown[0]= 0.0f; coldown[1]= color[1]+shadedown; if(coldown[1]<0.0f) coldown[1]= 0.0f; coldown[2]= color[2]+shadedown; if(coldown[2]<0.0f) coldown[2]= 0.0f; + coldown[3]= color[3]; glShadeModel(GL_SMOOTH); glBegin(mode); @@ -471,6 +473,9 @@ void uiEmboss(float x1, float y1, float x2, float y2, int sel) void ui_draw_but_IMAGE(ARegion *UNUSED(ar), uiBut *UNUSED(but), uiWidgetColors *UNUSED(wcol), rcti *rect) { +#ifdef WITH_HEADLESS + (void)rect; +#else extern char datatoc_splash_png[]; extern int datatoc_splash_png_size; ImBuf *ibuf; @@ -507,6 +512,7 @@ void ui_draw_but_IMAGE(ARegion *UNUSED(ar), uiBut *UNUSED(but), uiWidgetColors * */ IMB_freeImBuf(ibuf); +#endif } #if 0 @@ -1116,7 +1122,7 @@ void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *UNUSED(wcol), rcti *rect) ColorBand *coba; CBData *cbd; float x1, y1, sizex, sizey; - float dx, v3[2], v1[2], v2[2], v1a[2], v2a[2]; + float v3[2], v1[2], v2[2], v1a[2], v2a[2]; int a; float pos, colf[4]= {0,0,0,0}; /* initialize incase the colorband isnt valid */ @@ -1127,18 +1133,17 @@ void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *UNUSED(wcol), rcti *rect) y1= rect->ymin; sizex= rect->xmax-x1; sizey= rect->ymax-y1; - + /* first background, to show tranparency */ - dx= sizex/12.0f; - v1[0]= x1; - for(a=0; a<12; a++) { - if(a & 1) glColor3f(0.3, 0.3, 0.3); else glColor3f(0.8, 0.8, 0.8); - glRectf(v1[0], y1, v1[0]+dx, y1+0.5f*sizey); - if(a & 1) glColor3f(0.8, 0.8, 0.8); else glColor3f(0.3, 0.3, 0.3); - glRectf(v1[0], y1+0.5f*sizey, v1[0]+dx, y1+sizey); - v1[0]+= dx; - } - + + glColor4ub(UI_TRANSP_DARK, UI_TRANSP_DARK, UI_TRANSP_DARK, 255); + glRectf(x1, y1, x1+sizex, y1+sizey); + glEnable(GL_POLYGON_STIPPLE); + glColor4ub(UI_TRANSP_LIGHT, UI_TRANSP_LIGHT, UI_TRANSP_LIGHT, 255); + glPolygonStipple(checker_stipple_sml); + glRectf(x1, y1, x1+sizex, y1+sizey); + glDisable(GL_POLYGON_STIPPLE); + glShadeModel(GL_FLAT); glEnable(GL_BLEND); |