diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-05-03 10:56:20 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-05-03 10:59:48 +0300 |
commit | d64f12248abae3d9773bdb7c21a5c7b7e4471cc5 (patch) | |
tree | 73a3f01037aa30f2f2016ae3cb8a5973033e36d1 /source/blender/editors/interface | |
parent | 31f8d0543267d5c220dee769cd3b8c685a42aef6 (diff) |
Initialize alpha discard for uiWidgetBaseParameters
No functional change, just playing safe and documenting how to
initialize the parameter in most of the cases.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_draw.c | 4 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_intern.h | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 11cbc448713..ce22dac9e91 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -116,6 +116,7 @@ void UI_draw_roundbox_aa(bool filled, float minx, float miny, float maxx, float .color_inner1[1] = color[1], .color_inner2[1] = color[1], .color_inner1[2] = color[2], .color_inner2[2] = color[2], .color_inner1[3] = color[3], .color_inner2[3] = color[3], + .alpha_discard = 1.0f, }; glEnable(GL_BLEND); @@ -236,6 +237,7 @@ void UI_draw_roundbox_4fv(bool filled, float minx, float miny, float maxx, float .color_inner1[1] = col[1], .color_inner2[1] = col[1], .color_inner1[2] = col[2], .color_inner2[2] = col[2], .color_inner1[3] = col[3], .color_inner2[3] = col[3], + .alpha_discard = 1.0f, }; Gwn_Batch *batch = ui_batch_roundbox_get(filled, false); @@ -393,6 +395,7 @@ void UI_draw_roundbox_shade_x( .color_inner2[2] = max_ff(0.0f, col[2] + shadedown), .color_inner1[3] = 1.0f, .color_inner2[3] = 1.0f, + .alpha_discard = 1.0f, }; Gwn_Batch *batch = ui_batch_roundbox_get(filled, false); @@ -2160,6 +2163,7 @@ void ui_draw_dropshadow(const rctf *rct, float radius, float aspect, float alpha .round_corners[1] = (roundboxtype & UI_CNR_BOTTOM_RIGHT) ? 1.0f : 0.0f, .round_corners[2] = (roundboxtype & UI_CNR_TOP_RIGHT) ? 1.0f : 0.0f, .round_corners[3] = (roundboxtype & UI_CNR_TOP_LEFT) ? 1.0f : 0.0f, + .alpha_discard = 1.0f, }; Gwn_Batch *batch = ui_batch_roundbox_shadow_get(); diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index a10321eb91e..e6f40d758d1 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -722,7 +722,8 @@ typedef struct uiWidgetBaseParameters { float shade_dir; /* We pack alpha check and discard factor in alpha_discard. * If the value is negative then we do alpha check. - * The absolute value itself is the discard factor. */ + * The absolute value itself is the discard factor. + * Initialize value to 1.0.f if you don't want discard */ float alpha_discard; } uiWidgetBaseParameters; |