diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2017-04-27 16:49:10 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2017-04-28 20:22:45 +0300 |
commit | 9fe19437e9fd664bce9fefd9bdd1a85c48a99d16 (patch) | |
tree | 1ffd345d25b2af996674e31bef408a078c0a807f /source/blender/editors/animation | |
parent | 5e04e4eb0d66d3862f3cc0ca77803171c0fc587f (diff) |
Getting rid of setlinestyle: markers' dashed line in VSE.
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r-- | source/blender/editors/animation/anim_markers.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index 9273ae11906..dcf52404a88 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -351,22 +351,31 @@ static void draw_marker( if (flag & DRAW_MARKERS_LINES) #endif { - unsigned int pos = VertexFormat_add_attrib(immVertexFormat(), "pos", COMP_F32, 2, KEEP_FLOAT); - immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); - setlinestyle(3); - + VertexFormat *format = immVertexFormat(); + uint pos = VertexFormat_add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT); + uint line_origin = VertexFormat_add_attrib(format, "line_origin", COMP_F32, 2, KEEP_FLOAT); + + immBindBuiltinProgram(GPU_SHADER_2D_LINE_DASHED_COLOR); + + float viewport_size[4]; + glGetFloatv(GL_VIEWPORT, viewport_size); + immUniform2f("viewport_size", viewport_size[2] / UI_DPI_FAC, viewport_size[3] / UI_DPI_FAC); + if (marker->flag & SELECT) { - immUniformColor4ub(255, 255, 255, 96); + immUniform4f("color1", 1.0f, 1.0f, 1.0f, 0.38f); } else { - immUniformColor4ub(0, 0, 0, 96); + immUniform4f("color1", 0.0f, 0.0f, 0.0f, 0.38f); } + immUniform4f("color2", 0.0f, 0.0f, 0.0f, 0.0f); + immUniform1f("dash_width", 6.0f); + immUniform1f("dash_width_on", 3.0f); immBegin(PRIM_LINES, 2); + immAttrib2f(line_origin, xpos + 0.5f, 12.0f); immVertex2f(pos, xpos + 0.5f, 12.0f); immVertex2f(pos, xpos + 0.5f, (v2d->cur.ymax + 12.0f) * yscale); immEnd(); - setlinestyle(0); immUnbindProgram(); } |