From 1d88773b1f2e905773069a2d39617dd350683547 Mon Sep 17 00:00:00 2001 From: Mike Erwin Date: Fri, 22 Jan 2016 02:44:33 -0500 Subject: OpenGL: cleanup - LINE_STRIP to LINES when only drawing one - group state changes for easier reading - general cleanup --- source/blender/editors/space_graph/space_graph.c | 41 +++++++++--------------- 1 file changed, 16 insertions(+), 25 deletions(-) (limited to 'source/blender/editors/space_graph/space_graph.c') diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index 9f3bfe6b533..6d040546929 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -267,49 +267,40 @@ static void graph_main_region_draw(const bContext *C, ARegion *ar) /* horizontal component of value-cursor (value line before the current frame line) */ if ((sipo->flag & SIPO_NODRAWCURSOR) == 0) { - float vec[2]; + + float y = sipo->cursorVal; /* Draw a green line to indicate the cursor value */ - vec[1] = sipo->cursorVal; - UI_ThemeColorShadeAlpha(TH_CFRAME, -10, -50); - glLineWidth(2.0); - glEnable(GL_BLEND); - glBegin(GL_LINE_STRIP); - vec[0] = v2d->cur.xmin; - glVertex2fv(vec); - - vec[0] = v2d->cur.xmax; - glVertex2fv(vec); - glEnd(); // GL_LINE_STRIP - glDisable(GL_BLEND); + glLineWidth(2.0); + + glBegin(GL_LINES); + glVertex2f(v2d->cur.xmin, y); + glVertex2f(v2d->cur.xmax, y); + glEnd(); glLineWidth(1.0); + glDisable(GL_BLEND); } /* current frame or vertical component of vertical component of the cursor */ if (sipo->mode == SIPO_MODE_DRIVERS) { /* cursor x-value */ - float vec[2]; - - vec[0] = sipo->cursorTime; + float x = sipo->cursorTime; /* to help differentiate this from the current frame, draw slightly darker like the horizontal one */ UI_ThemeColorShadeAlpha(TH_CFRAME, -40, -50); + glEnable(GL_BLEND); glLineWidth(2.0); - glEnable(GL_BLEND); - glBegin(GL_LINE_STRIP); - vec[1] = v2d->cur.ymin; - glVertex2fv(vec); - - vec[1] = v2d->cur.ymax; - glVertex2fv(vec); - glEnd(); // GL_LINE_STRIP - glDisable(GL_BLEND); + glBegin(GL_LINES); + glVertex2f(x, v2d->cur.ymin); + glVertex2f(x, v2d->cur.ymax); + glEnd(); glLineWidth(1.0); + glDisable(GL_BLEND); } else { /* current frame */ -- cgit v1.2.3