Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_draw.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c37
1 files changed, 23 insertions, 14 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 357b6e584e9..8408152d23c 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -211,28 +211,37 @@ int view3d_test_clipping(RegionView3D *rv3d, float *vec, int local)
static void drawgrid_draw(ARegion *ar, float wx, float wy, float x, float y, float dx)
-{
- float fx, fy;
-
+{
+ float v1[2], v2[2];
+
x+= (wx);
y+= (wy);
- fx= x/dx;
- fx= x-dx*floor(fx);
+
+ v1[1]= 0.0f;
+ v2[1]= (float)ar->winy;
+
+ v1[0] = v2[0] = x-dx*floor(x/dx);
- while(fx< ar->winx) {
- fdrawline(fx, 0.0, fx, (float)ar->winy);
- fx+= dx;
+ glBegin(GL_LINES);
+
+ while(v1[0] < ar->winx) {
+ glVertex2fv(v1);
+ glVertex2fv(v2);
+ v1[0] = v2[0] = v1[0] + dx;
}
- fy= y/dx;
- fy= y-dx*floor(fy);
-
+ v1[0]= 0.0f;
+ v2[0]= (float)ar->winx;
- while(fy< ar->winy) {
- fdrawline(0.0, fy, (float)ar->winx, fy);
- fy+= dx;
+ v1[1]= v2[1]= y-dx*floor(y/dx);
+
+ while(v1[1] < ar->winy) {
+ glVertex2fv(v1);
+ glVertex2fv(v2);
+ v1[1] = v2[1] = v1[1] + dx;
}
+ glEnd();
}
#define GRID_MIN_PX 6.0f