draw grid lines in 1 loop rather then 2.
authorCampbell Barton <ideasman42@gmail.com>
Sun, 11 Sep 2011 05:10:27 +0000 (05:10 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 11 Sep 2011 05:10:27 +0000 (05:10 +0000)
source/blender/editors/space_view3d/view3d_draw.c

index 227118da6f7fd923f0c607602ce8a66b9135f98a..6b97d89325dbc135da43d70177b2923894c838a1 100644 (file)
@@ -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();
                }
        }