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:
authorCampbell Barton <ideasman42@gmail.com>2011-06-05 11:55:18 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-06-05 11:55:18 +0400
commitb727202921f537b50ab5ebdf7367da1c4416120d (patch)
tree954ed4385ac89f5b4e281ef3b8f1a1ad53cc8227 /source/blender/editors/interface
parent3a6adc0ed30be1d940f8069ad5e35bb27140ada6 (diff)
compile without splash and icons when WITH_HEADLESS is set.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r--source/blender/editors/interface/CMakeLists.txt4
-rw-r--r--source/blender/editors/interface/interface_draw.c4
-rw-r--r--source/blender/editors/interface/interface_icons.c9
3 files changed, 16 insertions, 1 deletions
diff --git a/source/blender/editors/interface/CMakeLists.txt b/source/blender/editors/interface/CMakeLists.txt
index 9902cac8857..6dd7af70e33 100644
--- a/source/blender/editors/interface/CMakeLists.txt
+++ b/source/blender/editors/interface/CMakeLists.txt
@@ -63,6 +63,10 @@ if(WITH_INTERNATIONAL)
add_definitions(-DINTERNATIONAL)
endif()
+if(WITH_HEADLESS)
+ add_definitions(-DWITH_HEADLESS)
+endif()
+
if(WITH_PYTHON)
add_definitions(-DWITH_PYTHON)
endif()
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c
index f9c97c36bdd..710d4d58825 100644
--- a/source/blender/editors/interface/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -471,6 +471,9 @@ void uiEmboss(float x1, float y1, float x2, float y2, int sel)
void ui_draw_but_IMAGE(ARegion *UNUSED(ar), uiBut *UNUSED(but), uiWidgetColors *UNUSED(wcol), rcti *rect)
{
+#ifdef WITH_HEADLESS
+ (void)rect;
+#else
extern char datatoc_splash_png[];
extern int datatoc_splash_png_size;
ImBuf *ibuf;
@@ -507,6 +510,7 @@ void ui_draw_but_IMAGE(ARegion *UNUSED(ar), uiBut *UNUSED(but), uiWidgetColors *
*/
IMB_freeImBuf(ibuf);
+#endif
}
#if 0
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index b92097d124b..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