compile without splash and icons when WITH_HEADLESS is set.

This commit is contained in:
Campbell Barton
2011-06-05 07:55:18 +00:00
parent 3a6adc0ed3
commit b727202921
6 changed files with 63 additions and 33 deletions

View File

@@ -29,41 +29,48 @@ set(INC_SYS
set(SRC
Bfont.c
add.png.c
bfont.ttf.c
blenderbuttons.c
blob.png.c
blur.png.c
bmonofont.ttf.c
clay.png.c
clone.png.c
crease.png.c
darken.png.c
draw.png.c
fill.png.c
flatten.png.c
grab.png.c
inflate.png.c
layer.png.c
lighten.png.c
mix.png.c
multiply.png.c
nudge.png.c
pinch.png.c
preview.blend.c
prvicons.c
scrape.png.c
smear.png.c
smooth.png.c
snake_hook.png.c
soften.png.c
splash.png.c
startup.blend.c
subtract.png.c
texdraw.png.c
thumb.png.c
twist.png.c
vertexdraw.png.c
preview.blend.c
)
if(NOT WITH_HEADLESS)
list(APPEND SRC
splash.png.c
blenderbuttons.c
# brushes
add.png.c
blob.png.c
blur.png.c
clay.png.c
clone.png.c
crease.png.c
darken.png.c
draw.png.c
fill.png.c
flatten.png.c
grab.png.c
inflate.png.c
layer.png.c
lighten.png.c
mix.png.c
multiply.png.c
nudge.png.c
pinch.png.c
prvicons.c
scrape.png.c
smear.png.c
smooth.png.c
snake_hook.png.c
soften.png.c
subtract.png.c
texdraw.png.c
thumb.png.c
twist.png.c
vertexdraw.png.c
)
endif()
blender_add_lib(bf_editor_datafiles "${SRC}" "${INC}" "${INC_SYS}")

View File

@@ -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()

View File

@@ -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

View File

@@ -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

View File

@@ -51,6 +51,10 @@ set(SRC
fsmenu.h
)
if(WITH_HEADLESS)
add_definitions(-DWITH_HEADLESS)
endif()
if(WITH_IMAGE_OPENEXR)
add_definitions(-DWITH_OPENEXR)
endif()

View File

@@ -373,7 +373,11 @@ void filelist_init_icons(void)
short x, y, k;
ImBuf *bbuf;
ImBuf *ibuf;
#ifdef WITH_HEADLESS
bbuf = NULL;
#else
bbuf = IMB_ibImageFromMemory((unsigned char*)datatoc_prvicons, datatoc_prvicons_size, IB_rect);
#endif
if (bbuf) {
for (y=0; y<SPECIAL_IMG_ROWS; y++) {
for (x=0; x<SPECIAL_IMG_COLS; x++) {