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

@@ -218,13 +218,16 @@ void ui_draw_anti_tria(float x1, float y1, float x2, float y2, float x3, float y
glDisable(GL_BLEND);
}
void ui_draw_anti_roundbox(int mode, float minx, float miny, float maxx, float maxy, float rad)
void ui_draw_anti_roundbox(int mode, float minx, float miny, float maxx, float maxy, float rad, bool use_alpha)
{
float color[4];
int j;
glEnable(GL_BLEND);
glGetFloatv(GL_CURRENT_COLOR, color);
if (use_alpha) {
color[3] = 0.5f;
}
color[3] *= 0.125f;
glColor4fv(color);