[Bf-blender-cvs] [5003f894e75] blender2.8: Fix crash in debug drawing of fullscreen exit icon
Julian Eisel
noreply at git.blender.org
Mon May 7 13:51:36 CEST 2018
Commit: 5003f894e75fdc6420f5d28bf53cce7018923979
Author: Julian Eisel
Date: Mon May 7 13:46:00 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB5003f894e75fdc6420f5d28bf53cce7018923979
Fix crash in debug drawing of fullscreen exit icon
Steps to recreate were:
* Go into fullscreen mode (Alt+F10)
* Open debug menu (Ctrl+Alt+D)
* Set value to 1
* Confirming should crash (at least in debug builds)
===================================================================
M source/blender/editors/screen/area.c
===================================================================
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 10be667f261..d0d19398f5b 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -256,19 +256,18 @@ static void area_draw_azone_fullscreen(short x1, short y1, short x2, short y2, f
if (G.debug_value == 1) {
rcti click_rect;
float icon_size = UI_DPI_ICON_SIZE + 7 * UI_DPI_FAC;
- unsigned char alpha_debug = 255 * alpha;
BLI_rcti_init(&click_rect, x, x + icon_size, y, y + icon_size);
Gwn_VertFormat *format = immVertexFormat();
unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
- unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT);
- immAttrib4ub(color, 255, 0, 0, alpha_debug);
- immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR);
+ immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
+
+ immUniformColor4f(1.0f, 0.0f, 0.0f, alpha);
imm_draw_box_wire_2d(pos, click_rect.xmin, click_rect.ymin, click_rect.xmax, click_rect.ymax);
- immAttrib4ub(color, 0, 255, 255, alpha_debug);
+ immUniformColor4f(0.0f, 1.0f, 1.0f, alpha);
immBegin(GWN_PRIM_LINES, 4);
immVertex2f(pos, click_rect.xmin, click_rect.ymin);
immVertex2f(pos, click_rect.xmax, click_rect.ymax);
More information about the Bf-blender-cvs
mailing list