style cleanup
This commit is contained in:
@@ -528,7 +528,7 @@ static void icon_verify_datatoc(IconImage *iimg)
|
||||
|
||||
if (iimg->datatoc_rect) {
|
||||
ImBuf *bbuf = IMB_ibImageFromMemory(iimg->datatoc_rect,
|
||||
iimg->datatoc_size, IB_rect, NULL, "<matcap icon>");
|
||||
iimg->datatoc_size, IB_rect, NULL, "<matcap icon>");
|
||||
/* w and h were set on initialize */
|
||||
if (bbuf->x != iimg->h && bbuf->y != iimg->w)
|
||||
IMB_scalefastImBuf(bbuf, iimg->w, iimg->h);
|
||||
@@ -542,16 +542,16 @@ static void icon_verify_datatoc(IconImage *iimg)
|
||||
static void init_matcap_icons(void)
|
||||
{
|
||||
/* dynamic allocation now, tucking datatoc pointers in DrawInfo */
|
||||
#define INIT_MATCAP_ICON(icon_id, name) \
|
||||
{ \
|
||||
unsigned char *rect = (unsigned char *)datatoc_ ##name## _jpg; \
|
||||
int size = datatoc_ ##name## _jpg_size; \
|
||||
DrawInfo *di; \
|
||||
\
|
||||
di = def_internal_icon(NULL, icon_id, 0, 0, 128, ICON_TYPE_BUFFER); \
|
||||
di->data.buffer.image->datatoc_rect = rect; \
|
||||
di->data.buffer.image->datatoc_size = size; \
|
||||
}
|
||||
#define INIT_MATCAP_ICON(icon_id, name) \
|
||||
{ \
|
||||
unsigned char *rect = (unsigned char *)datatoc_ ##name## _jpg; \
|
||||
int size = datatoc_ ##name## _jpg_size; \
|
||||
DrawInfo *di; \
|
||||
\
|
||||
di = def_internal_icon(NULL, icon_id, 0, 0, 128, ICON_TYPE_BUFFER); \
|
||||
di->data.buffer.image->datatoc_rect = rect; \
|
||||
di->data.buffer.image->datatoc_size = size; \
|
||||
} (void)0
|
||||
|
||||
INIT_MATCAP_ICON(ICON_MATCAP_01, mc01);
|
||||
INIT_MATCAP_ICON(ICON_MATCAP_02, mc02);
|
||||
|
||||
@@ -169,21 +169,26 @@ static void ob_wire_color_blend_theme_id(const unsigned char ob_wire_col[4], con
|
||||
}
|
||||
|
||||
/* this condition has been made more complex since editmode can draw textures */
|
||||
static int check_object_draw_texture(Scene *scene, View3D *v3d, int drawtype)
|
||||
static bool check_object_draw_texture(Scene *scene, View3D *v3d, int drawtype)
|
||||
{
|
||||
/* texture and material draw modes */
|
||||
if (ELEM(v3d->drawtype, OB_TEXTURE, OB_MATERIAL) && drawtype > OB_SOLID)
|
||||
return TRUE;
|
||||
if (ELEM(v3d->drawtype, OB_TEXTURE, OB_MATERIAL) && drawtype > OB_SOLID) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/* textured solid */
|
||||
if (v3d->drawtype == OB_SOLID && (v3d->flag2 & V3D_SOLID_TEX)
|
||||
&& !BKE_scene_use_new_shading_nodes(scene))
|
||||
return TRUE;
|
||||
if ((v3d->drawtype == OB_SOLID) &&
|
||||
(v3d->flag2 & V3D_SOLID_TEX) &&
|
||||
(BKE_scene_use_new_shading_nodes(scene) == false))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (v3d->flag2 & V3D_SHOW_SOLID_MATCAP)
|
||||
return 1;
|
||||
if (v3d->flag2 & V3D_SHOW_SOLID_MATCAP) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static int check_ob_drawface_dot(Scene *sce, View3D *vd, char dt)
|
||||
|
||||
Reference in New Issue
Block a user