style chang, made mainly because I wanted to be able to add breakpoints to MEM_freeN...
[blender.git] / source / blender / editors / interface / interface_icons.c
index ffdd807e3621b1c167a99925a4e6f08053542374..3feda5d4db411783aa19c8c723ff1a17bf3362c4 100644 (file)
@@ -506,10 +506,10 @@ static void init_brush_icons(void)
 
 static void init_internal_icons(void)
 {
-       bTheme *btheme= U.themes.first;
+       bTheme *btheme= UI_GetTheme();
        ImBuf *bbuf= NULL;
        int x, y, icontype;
-       char iconfilestr[FILE_MAXDIR+FILE_MAXFILE];
+       char iconfilestr[FILE_MAX];
        
        if ((btheme!=NULL) && btheme->tui.iconfile[0]) {
                char *icondir= BLI_get_folder(BLENDER_DATAFILES, "icons");
@@ -665,7 +665,9 @@ static void init_iconfile_list(struct ListBase *list)
        for(; i>=0; i--){
                MEM_freeN(dir[i].relname);
                MEM_freeN(dir[i].path);
-               if (dir[i].string) MEM_freeN(dir[i].string);
+               if (dir[i].string) {
+                       MEM_freeN(dir[i].string);
+               }
        }
        free(dir);
        dir= NULL;
@@ -950,6 +952,7 @@ static int get_draw_size(enum eIconSizes size)
 
 static void icon_draw_size(float x, float y, int icon_id, float aspect, float alpha, float *rgb, enum eIconSizes size, int draw_size, int UNUSED(nocreate), short is_preview)
 {
+       bTheme *btheme= UI_GetTheme();
        Icon *icon = NULL;
        DrawInfo *di = NULL;
        IconImage *iimg;
@@ -957,7 +960,7 @@ static void icon_draw_size(float x, float y, int icon_id, float aspect, float al
        int w, h;
        
        icon = BKE_icon_get(icon_id);
-       alpha *= 0.75f;
+       alpha *= btheme->tui.icon_alpha;
        
        if (icon==NULL) {
                if (G.f & G_DEBUG)