Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/interface/interface_icons.c')
-rw-r--r--source/blender/editors/interface/interface_icons.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index 037cc22f879..3bf2a9ddd02 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -461,6 +461,7 @@ static void vicon_move_down_draw(int x, int y, int w, int h, float UNUSED(alpha)
glDisable(GL_LINE_SMOOTH);
}
+#ifndef WITH_HEADLESS
static void init_brush_icons(void)
{
@@ -588,7 +589,7 @@ static void init_internal_icons(void)
IMB_freeImBuf(bbuf);
}
-
+#endif // WITH_HEADLESS
static void init_iconfile_list(struct ListBase *list)
{
@@ -704,6 +705,7 @@ ListBase *UI_iconfile_list(void)
void UI_icons_free(void)
{
+#ifndef WITH_HEADLESS
if(icongltex.id) {
glDeleteTextures(1, &icongltex.id);
icongltex.id= 0;
@@ -711,6 +713,7 @@ void UI_icons_free(void)
free_iconfile_list(&iconfilelist);
BKE_icons_free();
+#endif
}
void UI_icons_free_drawinfo(void *drawinfo)
@@ -792,10 +795,14 @@ int UI_icon_get_height(int icon_id)
void UI_icons_init(int first_dyn_id)
{
+#ifdef WITH_HEADLESS
+ (void)first_dyn_id;
+#else
init_iconfile_list(&iconfilelist);
BKE_icons_init(first_dyn_id);
init_internal_icons();
init_brush_icons();
+#endif
}
/* Render size for preview images and icons
@@ -945,6 +952,7 @@ static void icon_draw_size(float x, float y, int icon_id, float aspect, float al
Icon *icon = NULL;
DrawInfo *di = NULL;
IconImage *iimg;
+ float fdraw_size= UI_DPI_FAC*draw_size;
int w, h;
icon = BKE_icon_get(icon_id);
@@ -965,8 +973,8 @@ static void icon_draw_size(float x, float y, int icon_id, float aspect, float al
}
/* scale width and height according to aspect */
- w = (int)(draw_size/aspect + 0.5f);
- h = (int)(draw_size/aspect + 0.5f);
+ w = (int)(fdraw_size/aspect + 0.5f);
+ h = (int)(fdraw_size/aspect + 0.5f);
if(di->type == ICON_TYPE_VECTOR) {
/* vector icons use the uiBlock transformation, they are not drawn