avoid calling glGetFloatv() twice when UI_RB_ALPHA is enabled with uiRoundBox()

This commit is contained in:
2013-03-07 06:46:50 +00:00
parent dfa8540cdf
commit a816b0b3d2
3 changed files with 6 additions and 12 deletions

View File

@@ -381,16 +381,7 @@ void uiRoundRect(float minx, float miny, float maxx, float maxy, float rad)
/* (old, used in outliner) plain antialiased filled box */
void uiRoundBox(float minx, float miny, float maxx, float maxy, float rad)
{
float color[4];
if (roundboxtype & UI_RB_ALPHA) {
glGetFloatv(GL_CURRENT_COLOR, color);
color[3] = 0.5;
glColor4fv(color);
glEnable(GL_BLEND);
}
ui_draw_anti_roundbox(GL_POLYGON, minx, miny, maxx, maxy, rad);
ui_draw_anti_roundbox(GL_POLYGON, minx, miny, maxx, maxy, rad, roundboxtype & UI_RB_ALPHA);
}