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>2018-09-12 08:48:00 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-09-12 08:48:00 +0300
commita8c924423e2e7103aff60c21e901dc239b54c610 (patch)
tree3507aaacf9fcbec0e25e76981d088dbcf6f5de46 /source/blender
parenta1651ddc98ec760e522ea2ea8169b726661fa2e6 (diff)
Cleanup: remove alpha_check variable from DNA
Just pass as an argument.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/interface/interface_widgets.c15
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h2
2 files changed, 12 insertions, 5 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index be7bba23c90..a655dea9215 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -680,7 +680,9 @@ static void widgetbase_outline(uiWidgetBase *wtb)
glDisableClientState(GL_VERTEX_ARRAY);
}
-static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
+static void widgetbase_draw_ex(
+ uiWidgetBase *wtb, uiWidgetColors *wcol,
+ const bool show_alpha_checkers)
{
int j, a;
@@ -690,7 +692,7 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
if (wtb->draw_inner) {
BLI_assert(wtb->totvert != 0);
if (wcol->shaded == 0) {
- if (wcol->alpha_check) {
+ if (show_alpha_checkers) {
float inner_v_half[WIDGET_SIZE_MAX][2];
float x_mid = 0.0f; /* used for dumb clamping of values */
@@ -841,6 +843,11 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
glDisable(GL_BLEND);
}
+static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
+{
+ widgetbase_draw_ex(wtb, wcol, false);
+}
+
/* *********************** text/icon ************************************** */
#define UI_TEXT_CLIP_MARGIN (0.25f * U.widget_unit / but->block->aspect)
@@ -3100,9 +3107,9 @@ static void widget_swatch(uiBut *but, uiWidgetColors *wcol, rcti *rect, int stat
ui_block_cm_to_display_space_v3(but->block, col);
rgba_float_to_uchar((unsigned char *)wcol->inner, col);
+ const bool show_alpha_checkers = (wcol->inner[3] < 255);
wcol->shaded = 0;
- wcol->alpha_check = (wcol->inner[3] < 255);
if (state & (UI_BUT_DISABLED | UI_BUT_INACTIVE)) {
/* Now we reduce alpha of the inner color (i.e. the color shown)
@@ -3113,7 +3120,7 @@ static void widget_swatch(uiBut *but, uiWidgetColors *wcol, rcti *rect, int stat
wcol->inner[3] /= 2;
}
- widgetbase_draw(&wtb, wcol);
+ widgetbase_draw_ex(&wtb, wcol, show_alpha_checkers);
if (but->a1 == UI_PALETTE_COLOR && ((Palette *)but->rnapoin.id.data)->active_color == (int)but->a2) {
float width = rect->xmax - rect->xmin;
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index f78b48b2d25..e8cc4fbe38f 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -130,7 +130,7 @@ typedef struct uiWidgetColors {
char text_sel[4];
short shaded;
short shadetop, shadedown;
- short alpha_check;
+ char _pad0[2];
} uiWidgetColors;
typedef struct uiWidgetStateColors {