[Bf-blender-cvs] [d8897bed994] master: Fix headless and Python module build after recent alert icon changes

Brecht Van Lommel noreply at git.blender.org
Wed Mar 18 13:32:59 CET 2020


Commit: d8897bed994e5d5cd2314a965575ad9cf02a0be8
Author: Brecht Van Lommel
Date:   Wed Mar 18 13:29:49 2020 +0100
Branches: master
https://developer.blender.org/rBd8897bed994e5d5cd2314a965575ad9cf02a0be8

Fix headless and Python module build after recent alert icon changes

===================================================================

M	source/blender/editors/interface/interface_icons.c

===================================================================

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
+}



More information about the Bf-blender-cvs mailing list