diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2020-03-18 15:29:49 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2020-03-18 15:31:49 +0300 |
commit | d8897bed994e5d5cd2314a965575ad9cf02a0be8 (patch) | |
tree | ea29789d80eeb960536525f5218ed1b69e695557 | |
parent | 0af739ae8a7d16e1756a66342d85a3213ecf9b0f (diff) |
Fix headless and Python module build after recent alert icon changes
-rw-r--r-- | source/blender/editors/interface/interface_icons.c | 46 |
1 files changed, 22 insertions, 24 deletions
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index ed4131440d5..3173c962830 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -177,30 +177,6 @@ static const IconType icontypes[] = { # include "UI_icons.h" }; -/* ********** Alert Icons ********** */ - -# define ALERT_IMG_SIZE 256 - -ImBuf *UI_alert_image(eAlertIcon icon) -{ -# ifdef WITH_HEADLESS - return NULL -# else - ImBuf *ibuf; - icon = MIN2(icon, ALERT_ICON_MAX - 1); - const int left = icon * ALERT_IMG_SIZE; - const rcti crop = {left, left + ALERT_IMG_SIZE - 1, 0, ALERT_IMG_SIZE - 1}; - ibuf = IMB_ibImageFromMemory((const uchar *)datatoc_alert_icons_png, - datatoc_alert_icons_png_size, - IB_rect, - NULL, - "alert_icon"); - IMB_rect_crop(ibuf, &crop); - IMB_premultiply_alpha(ibuf); - return ibuf; -# endif -} - /* **************************************************** */ static DrawInfo *def_internal_icon( @@ -2392,3 +2368,25 @@ void UI_icon_draw_ex(float x, mono_color, mono_border); } + +/* ********** Alert Icons ********** */ + +ImBuf *UI_alert_image(eAlertIcon icon) +{ +#ifdef WITH_HEADLESS + return NULL; +#else + const int ALERT_IMG_SIZE = 256; + icon = MIN2(icon, ALERT_ICON_MAX - 1); + const int left = icon * ALERT_IMG_SIZE; + const rcti crop = {left, left + ALERT_IMG_SIZE - 1, 0, ALERT_IMG_SIZE - 1}; + ImBuf *ibuf = IMB_ibImageFromMemory((const uchar *)datatoc_alert_icons_png, + datatoc_alert_icons_png_size, + IB_rect, + NULL, + "alert_icon"); + IMB_rect_crop(ibuf, &crop); + IMB_premultiply_alpha(ibuf); + return ibuf; +#endif +} |