diff options
Diffstat (limited to 'source/blender/editors/interface/interface_draw.c')
-rw-r--r-- | source/blender/editors/interface/interface_draw.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 2a9a1335b1f..cf6970dc59f 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -48,6 +48,7 @@ #include "UI_interface.h" +/* own include */ #include "interface_intern.h" #define UI_RB_ALPHA 16 @@ -76,7 +77,7 @@ int uiGetRoundBox(void) return roundboxtype; } -void gl_round_box(int mode, float minx, float miny, float maxx, float maxy, float rad) +void uiDrawBox(int mode, float minx, float miny, float maxx, float maxy, float rad) { 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}}; @@ -146,7 +147,7 @@ static void round_box_shade_col(float *col1, float *col2, float fac) /* linear horizontal shade within button or in outline */ /* view2d scrollers use it */ -void gl_round_box_shade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadetop, float shadedown) +void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadetop, float shadedown) { 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}}; @@ -253,7 +254,7 @@ void gl_round_box_shade(int mode, float minx, float miny, float maxx, float maxy /* linear vertical shade within button or in outline */ /* view2d scrollers use it */ -void gl_round_box_vertical_shade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadeLeft, float shadeRight) +void uiDrawBoxVerticalShade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadeLeft, float shadeRight) { 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}}; @@ -371,7 +372,7 @@ void uiRoundRect(float minx, float miny, float maxx, float maxy, float rad) glEnable( GL_LINE_SMOOTH ); glEnable( GL_BLEND ); - gl_round_box(GL_LINE_LOOP, minx, miny, maxx, maxy, rad); + uiDrawBox(GL_LINE_LOOP, minx, miny, maxx, maxy, rad); glDisable( GL_BLEND ); glDisable( GL_LINE_SMOOTH ); @@ -397,7 +398,7 @@ void uiRoundRectFakeAA(float minx, float miny, float maxx, float maxy, float rad /* draw lots of lines on top of each other */ for (i=passes; i>=(-passes); i--) { - gl_round_box(GL_LINE_LOOP, minx, miny, maxx, maxy, rad+(i*raddiff)); + uiDrawBox(GL_LINE_LOOP, minx, miny, maxx, maxy, rad+(i*raddiff)); } glDisable( GL_BLEND ); @@ -419,13 +420,13 @@ void uiRoundBox(float minx, float miny, float maxx, float maxy, float rad) } /* solid part */ - gl_round_box(GL_POLYGON, minx, miny, maxx, maxy, rad); + uiDrawBox(GL_POLYGON, minx, miny, maxx, maxy, rad); /* set antialias line */ glEnable( GL_LINE_SMOOTH ); glEnable( GL_BLEND ); - gl_round_box(GL_LINE_LOOP, minx, miny, maxx, maxy, rad); + uiDrawBox(GL_LINE_LOOP, minx, miny, maxx, maxy, rad); glDisable( GL_BLEND ); glDisable( GL_LINE_SMOOTH ); @@ -710,7 +711,7 @@ static void draw_scope_end(rctf *rect, GLint *scissor) /* outline */ glColor4f(0.f, 0.f, 0.f, 0.5f); uiSetRoundBox(15); - gl_round_box(GL_LINE_LOOP, rect->xmin-1, rect->ymin, rect->xmax+1, rect->ymax+1, 3.0f); + uiDrawBox(GL_LINE_LOOP, rect->xmin-1, rect->ymin, rect->xmax+1, rect->ymax+1, 3.0f); } void histogram_draw_one(float r, float g, float b, float alpha, float x, float y, float w, float h, float *data, int res) @@ -771,7 +772,7 @@ void ui_draw_but_HISTOGRAM(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti * glColor4f(0.f, 0.f, 0.f, 0.3f); uiSetRoundBox(15); - gl_round_box(GL_POLYGON, rect.xmin-1, rect.ymin-1, rect.xmax+1, rect.ymax+1, 3.0f); + uiDrawBox(GL_POLYGON, rect.xmin-1, rect.ymin-1, rect.xmax+1, rect.ymax+1, 3.0f); glColor4f(1.f, 1.f, 1.f, 0.08f); /* draw grid lines here */ @@ -840,7 +841,7 @@ void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *r glColor4f(0.f, 0.f, 0.f, 0.3f); uiSetRoundBox(15); - gl_round_box(GL_POLYGON, rect.xmin-1, rect.ymin-1, rect.xmax+1, rect.ymax+1, 3.0f); + uiDrawBox(GL_POLYGON, rect.xmin-1, rect.ymin-1, rect.xmax+1, rect.ymax+1, 3.0f); /* need scissor test, waveform can draw outside of boundary */ @@ -1051,7 +1052,7 @@ void ui_draw_but_VECTORSCOPE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti glColor4f(0.f, 0.f, 0.f, 0.3f); uiSetRoundBox(15); - gl_round_box(GL_POLYGON, rect.xmin-1, rect.ymin-1, rect.xmax+1, rect.ymax+1, 3.0f); + uiDrawBox(GL_POLYGON, rect.xmin-1, rect.ymin-1, rect.xmax+1, rect.ymax+1, 3.0f); /* need scissor test, hvectorscope can draw outside of boundary */ glGetIntegerv(GL_VIEWPORT, scissor); @@ -1237,7 +1238,7 @@ void ui_draw_but_NORMAL(uiBut *but, uiWidgetColors *wcol, rcti *rect) /* backdrop */ glColor3ubv((unsigned char*)wcol->inner); uiSetRoundBox(15); - gl_round_box(GL_POLYGON, rect->xmin, rect->ymin, rect->xmax, rect->ymax, 5.0f); + uiDrawBox(GL_POLYGON, rect->xmin, rect->ymin, rect->xmax, rect->ymax, 5.0f); /* sphere color */ glMaterialfv(GL_FRONT, GL_DIFFUSE, diffn); @@ -1584,13 +1585,13 @@ void ui_dropshadow(rctf *rct, float radius, float aspect, int select) glColor4ub(0, 0, 0, alpha); alpha+= 2; - gl_round_box(GL_POLYGON, rct->xmin - a, rct->ymin - a, rct->xmax + a, rct->ymax-10.0f + a, rad+a); + uiDrawBox(GL_POLYGON, rct->xmin - a, rct->ymin - a, rct->xmax + a, rct->ymax-10.0f + a, rad+a); } /* outline emphasis */ glEnable( GL_LINE_SMOOTH ); glColor4ub(0, 0, 0, 100); - gl_round_box(GL_LINE_LOOP, rct->xmin-0.5f, rct->ymin-0.5f, rct->xmax+0.5f, rct->ymax+0.5f, radius); + uiDrawBox(GL_LINE_LOOP, rct->xmin-0.5f, rct->ymin-0.5f, rct->xmax+0.5f, rct->ymax+0.5f, radius); glDisable( GL_LINE_SMOOTH ); glDisable(GL_BLEND); |