[Bf-blender-cvs] [d64f12248ab] blender2.8: Initialize alpha discard for uiWidgetBaseParameters
Dalai Felinto
noreply at git.blender.org
Thu May 3 10:00:22 CEST 2018
Commit: d64f12248abae3d9773bdb7c21a5c7b7e4471cc5
Author: Dalai Felinto
Date: Thu May 3 09:56:20 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBd64f12248abae3d9773bdb7c21a5c7b7e4471cc5
Initialize alpha discard for uiWidgetBaseParameters
No functional change, just playing safe and documenting how to
initialize the parameter in most of the cases.
===================================================================
M source/blender/editors/interface/interface_draw.c
M source/blender/editors/interface/interface_intern.h
===================================================================
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;
More information about the Bf-blender-cvs
mailing list