From 57fcea44df7351c0c8de24b740d245c6fd445740 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 11 Sep 2011 05:10:27 +0000 Subject: draw grid lines in 1 loop rather then 2. --- source/blender/editors/space_view3d/view3d_draw.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 227118da6f7..6b97d89325d 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -472,24 +472,21 @@ static void drawfloor(Scene *scene, View3D *v3d, const char **grid_unit) for(a= -gridlines;a<=gridlines;a++) { glColor3ubv((a % 10) ? col_grid_light : col_grid_emphasise); - glBegin(GL_LINE_STRIP); + + glBegin(GL_LINES); + /* Y axis */ vert[0]= a * grid_scale; vert[1]= grid; glVertex3fv(vert); vert[1]= -grid; glVertex3fv(vert); - glEnd(); - } - /* draw the X axis and/or grid lines */ - for(a= -gridlines;a<=gridlines;a++) { - glColor3ubv((a % 10) ? col_grid_light : col_grid_emphasise); - glBegin(GL_LINE_STRIP); - vert[1]= a * grid_scale; + /* X axis */ + SWAP(float, vert[0], vert[1]); + glVertex3fv(vert); vert[0]= grid; - glVertex3fv(vert ); - vert[0]= -grid; glVertex3fv(vert); + glEnd(); } } -- cgit v1.2.3