- UNUSED macro wasn't throwing an error with GCC if a var become used.
[blender.git] / source / blender / editors / interface / interface_draw.c
index 74324a244defb73618d1c1f2afaf04767950fe4f..855ca45f61a44c86b00427d294b4930c76c876a6 100644 (file)
@@ -35,7 +35,6 @@
 #include "BLI_math.h"
 
 #include "BKE_colortools.h"
-#include "BKE_global.h"
 #include "BKE_texture.h"
 #include "BKE_utildefines.h"
 
@@ -49,6 +48,7 @@
 
 #include "UI_interface.h"
 
+/* own include */
 #include "interface_intern.h"
 
 #define UI_RB_ALPHA 16
@@ -77,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}};
@@ -147,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}};
@@ -254,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}};
@@ -372,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 );
@@ -398,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 );
@@ -420,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 );
@@ -460,7 +460,7 @@ void uiEmboss(float x1, float y1, float x2, float y2, int sel)
 
 /* ************** SPECIAL BUTTON DRAWING FUNCTIONS ************* */
 
-void ui_draw_but_IMAGE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *rect)
+void ui_draw_but_IMAGE(ARegion *UNUSED(ar), uiBut *UNUSED(but), uiWidgetColors *UNUSED(wcol), rcti *rect)
 {
        extern char datatoc_splash_png[];
        extern int datatoc_splash_png_size;
@@ -469,7 +469,7 @@ void ui_draw_but_IMAGE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *rect
        //int w, h;
        
        /* hardcoded to splash, loading and freeing every draw, eek! */
-       ibuf= IMB_ibImageFromMemory((int *)datatoc_splash_png, datatoc_splash_png_size, IB_rect);
+       ibuf= IMB_ibImageFromMemory((unsigned char*)datatoc_splash_png, datatoc_splash_png_size, IB_rect);
 
        if (!ibuf) return;
        
@@ -711,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)
@@ -747,7 +747,7 @@ void histogram_draw_one(float r, float g, float b, float alpha, float x, float y
        glDisable(GL_LINE_SMOOTH);
 }
 
-void ui_draw_but_HISTOGRAM(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *recti)
+void ui_draw_but_HISTOGRAM(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol), rcti *recti)
 {
        Histogram *hist = (Histogram *)but->poin;
        int res = hist->x_resolution;
@@ -772,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 */
@@ -800,7 +800,7 @@ void ui_draw_but_HISTOGRAM(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *
        draw_scope_end(&rect, scissor);
 }
 
-void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *recti)
+void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol), rcti *recti)
 {
        Scopes *scopes = (Scopes *)but->poin;
        rctf rect;
@@ -841,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 */
@@ -861,7 +861,7 @@ void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *r
                glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
        }
        /* 3 vertical separation */
-       if (scopes->wavefrm_mode!= SCOPES_WAVEFRM_LUM) {
+       if (scopes->wavefrm_mode!= SCOPES_WAVEFRM_LUMA) {
                for (i=1; i<3; i++) {
                        fdrawline(rect.xmin+i*w3, rect.ymin, rect.xmin+i*w3, rect.ymax);
                }
@@ -878,78 +878,82 @@ void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *r
                fdrawline(rect.xmin+w3, yofs+h*240.0f/255.0f, rect.xmax+1, yofs+h*240.0f/255.0f);
        }
        /* 7.5 IRE black point level for NTSC */
-       if (scopes->wavefrm_mode== SCOPES_WAVEFRM_LUM)
+       if (scopes->wavefrm_mode== SCOPES_WAVEFRM_LUMA)
                fdrawline(rect.xmin, yofs+h*0.075f, rect.xmax+1, yofs+h*0.075f);
-       
-       /* LUMA (1 channel) */
-       glBlendFunc(GL_ONE,GL_ONE);
-       glColor3f(alpha, alpha, alpha);
-       if (scopes->wavefrm_mode == SCOPES_WAVEFRM_LUM){
-
-               glBlendFunc(GL_ONE,GL_ONE);
-               
-               glPushMatrix();
-               glEnableClientState(GL_VERTEX_ARRAY);
-               
-               glTranslatef(rect.xmin, yofs, 0.f);
-               glScalef(w, h, 0.f);
-               glVertexPointer(2, GL_FLOAT, 0, scopes->waveform_1);
-               glDrawArrays(GL_POINTS, 0, scopes->waveform_tot);
-                               
-               glDisableClientState(GL_VERTEX_ARRAY);
-               glPopMatrix();
 
-               /* min max */
-               glColor3f(.5f, .5f, .5f);
-               min= yofs+scopes->minmax[0][0]*h;
-               max= yofs+scopes->minmax[0][1]*h;
-               CLAMP(min, rect.ymin, rect.ymax);
-               CLAMP(max, rect.ymin, rect.ymax);
-               fdrawline(rect.xmax-3,min,rect.xmax-3,max);
-       }
-
-       /* RGB / YCC (3 channels) */
-       else if (ELEM4(scopes->wavefrm_mode, SCOPES_WAVEFRM_RGB, SCOPES_WAVEFRM_YCC_601, SCOPES_WAVEFRM_YCC_709, SCOPES_WAVEFRM_YCC_JPEG)) {
-               int rgb = (scopes->wavefrm_mode == SCOPES_WAVEFRM_RGB);
+       if (scopes->ok && scopes->waveform_1 != NULL) {
                
+               /* LUMA (1 channel) */
                glBlendFunc(GL_ONE,GL_ONE);
-               
-               glPushMatrix();
-               glEnableClientState(GL_VERTEX_ARRAY);
-               
-               glTranslatef(rect.xmin, yofs, 0.f);
-               glScalef(w3, h, 0.f);
-               
-               glColor3fv((rgb)?colors_alpha[0]:colorsycc_alpha[0]);
-               glVertexPointer(2, GL_FLOAT, 0, scopes->waveform_1);
-               glDrawArrays(GL_POINTS, 0, scopes->waveform_tot);
-
-               glTranslatef(1.f, 0.f, 0.f);
-               glColor3fv((rgb)?colors_alpha[1]:colorsycc_alpha[1]);
-               glVertexPointer(2, GL_FLOAT, 0, scopes->waveform_2);
-               glDrawArrays(GL_POINTS, 0, scopes->waveform_tot);
-               
-               glTranslatef(1.f, 0.f, 0.f);
-               glColor3fv((rgb)?colors_alpha[2]:colorsycc_alpha[2]);
-               glVertexPointer(2, GL_FLOAT, 0, scopes->waveform_3);
-               glDrawArrays(GL_POINTS, 0, scopes->waveform_tot);
-               
-               glDisableClientState(GL_VERTEX_ARRAY);
-               glPopMatrix();
+               glColor3f(alpha, alpha, alpha);
+               if (scopes->wavefrm_mode == SCOPES_WAVEFRM_LUMA){
 
-               
-               /* min max */
-               for (c=0; c<3; c++) {
-                       if (scopes->wavefrm_mode == SCOPES_WAVEFRM_RGB)
-                               glColor3f(colors[c][0]*0.75, colors[c][1]*0.75, colors[c][2]*0.75);
-                       else
-                               glColor3f(colorsycc[c][0]*0.75, colorsycc[c][1]*0.75, colorsycc[c][2]*0.75);
-                       min= yofs+scopes->minmax[c][0]*h;
-                       max= yofs+scopes->minmax[c][1]*h;
+                       glBlendFunc(GL_ONE,GL_ONE);
+                       
+                       glPushMatrix();
+                       glEnableClientState(GL_VERTEX_ARRAY);
+                       
+                       glTranslatef(rect.xmin, yofs, 0.f);
+                       glScalef(w, h, 0.f);
+                       glVertexPointer(2, GL_FLOAT, 0, scopes->waveform_1);
+                       glDrawArrays(GL_POINTS, 0, scopes->waveform_tot);
+                                       
+                       glDisableClientState(GL_VERTEX_ARRAY);
+                       glPopMatrix();
+
+                       /* min max */
+                       glColor3f(.5f, .5f, .5f);
+                       min= yofs+scopes->minmax[0][0]*h;
+                       max= yofs+scopes->minmax[0][1]*h;
                        CLAMP(min, rect.ymin, rect.ymax);
                        CLAMP(max, rect.ymin, rect.ymax);
-                       fdrawline(rect.xmin+w+2+c*2,min,rect.xmin+w+2+c*2,max);
+                       fdrawline(rect.xmax-3,min,rect.xmax-3,max);
+               }
+
+               /* RGB / YCC (3 channels) */
+               else if (ELEM4(scopes->wavefrm_mode, SCOPES_WAVEFRM_RGB, SCOPES_WAVEFRM_YCC_601, SCOPES_WAVEFRM_YCC_709, SCOPES_WAVEFRM_YCC_JPEG)) {
+                       int rgb = (scopes->wavefrm_mode == SCOPES_WAVEFRM_RGB);
+                       
+                       glBlendFunc(GL_ONE,GL_ONE);
+                       
+                       glPushMatrix();
+                       glEnableClientState(GL_VERTEX_ARRAY);
+                       
+                       glTranslatef(rect.xmin, yofs, 0.f);
+                       glScalef(w3, h, 0.f);
+                       
+                       glColor3fv((rgb)?colors_alpha[0]:colorsycc_alpha[0]);
+                       glVertexPointer(2, GL_FLOAT, 0, scopes->waveform_1);
+                       glDrawArrays(GL_POINTS, 0, scopes->waveform_tot);
+
+                       glTranslatef(1.f, 0.f, 0.f);
+                       glColor3fv((rgb)?colors_alpha[1]:colorsycc_alpha[1]);
+                       glVertexPointer(2, GL_FLOAT, 0, scopes->waveform_2);
+                       glDrawArrays(GL_POINTS, 0, scopes->waveform_tot);
+                       
+                       glTranslatef(1.f, 0.f, 0.f);
+                       glColor3fv((rgb)?colors_alpha[2]:colorsycc_alpha[2]);
+                       glVertexPointer(2, GL_FLOAT, 0, scopes->waveform_3);
+                       glDrawArrays(GL_POINTS, 0, scopes->waveform_tot);
+                       
+                       glDisableClientState(GL_VERTEX_ARRAY);
+                       glPopMatrix();
+
+                       
+                       /* min max */
+                       for (c=0; c<3; c++) {
+                               if (scopes->wavefrm_mode == SCOPES_WAVEFRM_RGB)
+                                       glColor3f(colors[c][0]*0.75, colors[c][1]*0.75, colors[c][2]*0.75);
+                               else
+                                       glColor3f(colorsycc[c][0]*0.75, colorsycc[c][1]*0.75, colorsycc[c][2]*0.75);
+                               min= yofs+scopes->minmax[c][0]*h;
+                               max= yofs+scopes->minmax[c][1]*h;
+                               CLAMP(min, rect.ymin, rect.ymax);
+                               CLAMP(max, rect.ymin, rect.ymax);
+                               fdrawline(rect.xmin+w+2+c*2,min,rect.xmin+w+2+c*2,max);
+                       }
                }
+               
        }
        
        /* outline, scale gripper */
@@ -969,7 +973,7 @@ float polar_to_y(float center, float diam, float ampli, float angle)
 void vectorscope_draw_target(float centerx, float centery, float diam, float r, float g, float b)
 {
        float y,u,v;
-       float tangle, tampli;
+       float tangle=0.f, tampli;
        float dangle, dampli, dangle2, dampli2;
 
        rgb_to_yuv(r,g,b, &y, &u, &v);
@@ -1019,7 +1023,7 @@ void vectorscope_draw_target(float centerx, float centery, float diam, float r,
        glEnd();
 }
 
-void ui_draw_but_VECTORSCOPE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *recti)
+void ui_draw_but_VECTORSCOPE(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol), rcti *recti)
 {
        Scopes *scopes = (Scopes *)but->poin;
        rctf rect;
@@ -1030,8 +1034,6 @@ void ui_draw_but_VECTORSCOPE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti
        float colors[6][3]={{.75,0,0},{.75,.75,0},{0,.75,0},{0,.75,.75},{0,0,.75},{.75,0,.75}};
        GLint scissor[4];
        
-       if (scopes==NULL) return;
-       
        rect.xmin = (float)recti->xmin+1;
        rect.xmax = (float)recti->xmax-1;
        rect.ymin = (float)recti->ymin+SCOPE_RESIZE_PAD+2;
@@ -1050,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);
@@ -1079,32 +1081,31 @@ void ui_draw_but_VECTORSCOPE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti
        for(i=0; i<6; i++)
                vectorscope_draw_target(centerx, centery, diam, colors[i][0], colors[i][1], colors[i][2]);
        
-       /* pixel point cloud */
-       glBlendFunc(GL_ONE,GL_ONE);
-       glColor4f(alpha, alpha, alpha, alpha);
+       if (scopes->ok && scopes->vecscope != NULL) {
+               /* pixel point cloud */
+               glBlendFunc(GL_ONE,GL_ONE);
+               glColor3f(alpha, alpha, alpha);
 
-       glPushMatrix();
-       glEnableClientState(GL_VERTEX_ARRAY);
+               glPushMatrix();
+               glEnableClientState(GL_VERTEX_ARRAY);
 
-       glTranslatef(centerx, centery, 0.f);
-       glScalef(diam, diam, 0.f);
+               glTranslatef(centerx, centery, 0.f);
+               glScalef(diam, diam, 0.f);
 
-       /*apparently this can sometimes be NULL? - joeedh*/
-       if (scopes) {
                glVertexPointer(2, GL_FLOAT, 0, scopes->vecscope);
                glDrawArrays(GL_POINTS, 0, scopes->waveform_tot);
+               
+               glDisableClientState(GL_VERTEX_ARRAY);
+               glPopMatrix();
        }
 
-       glDisableClientState(GL_VERTEX_ARRAY);
-       glPopMatrix();
-       
        /* outline, scale gripper */
        draw_scope_end(&rect, scissor);
                
        glDisable(GL_BLEND);
 }
 
-void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *wcol, rcti *rect)
+void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *UNUSED(wcol), rcti *rect)
 {
        ColorBand *coba;
        CBData *cbd;
@@ -1146,7 +1147,7 @@ void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *wcol, rcti *rect)
        glColor4fv( &cbd->r );
        glVertex2fv(v1); glVertex2fv(v2);
        
-       for( a = 1; a < sizex; a++ ) {
+       for( a = 1; a <= sizex; a++ ) {
                pos = ((float)a) / (sizex-1);
                do_colorband( coba, pos, colf );
                if (but->block->color_profile != BLI_PR_NONE)
@@ -1163,19 +1164,8 @@ void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *wcol, rcti *rect)
        glDisable(GL_BLEND);
        
        /* outline */
-       v1[0]= x1; v1[1]= y1;
-       
-       cpack(0x0);
-       glBegin(GL_LINE_LOOP);
-       glVertex2fv(v1);
-       v1[0]+= sizex;
-       glVertex2fv(v1);
-       v1[1]+= sizey;
-       glVertex2fv(v1);
-       v1[0]-= sizex;
-       glVertex2fv(v1);
-       glEnd();
-       
+       glColor4f(0.0, 0.0, 0.0, 1.0);
+       fdrawbox(x1, y1, x1+sizex, y1+sizey);
        
        /* help lines */
        v1[0]= v2[0]=v3[0]= x1;
@@ -1231,6 +1221,7 @@ void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *wcol, rcti *rect)
                }       
        }
        glEnd();
+
 }
 
 void ui_draw_but_NORMAL(uiBut *but, uiWidgetColors *wcol, rcti *rect)
@@ -1247,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);
@@ -1413,7 +1404,7 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *rect
        if (but->a1 != -1) {
                if (but->a1 == UI_GRAD_H) {
                        rcti grid;
-                       float col[3];
+                       float col[3]= {0.0f, 0.0f, 0.0f}; /* dummy arg */
                        
                        grid.xmin = rect->xmin + zoomx*(-offsx);
                        grid.xmax = rect->xmax + zoomx*(-offsx);
@@ -1594,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);