[Quest-ed-checkins] CVS: quest-3b/src/fe/gl render.c,1.7,1.8
Brought to you by:
alexm
|
From: Alexander M. <al...@us...> - 2003-03-18 17:50:38
|
Update of /cvsroot/quest-ed/quest-3b/src/fe/gl
In directory sc8-pr-cvs1:/tmp/cvs-serv26533
Modified Files:
render.c
Log Message:
Draw labelled axes for 2d-windows. Patch from Bill Currie.
Index: render.c
===================================================================
RCS file: /cvsroot/quest-ed/quest-3b/src/fe/gl/render.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** render.c 21 May 2002 19:03:16 -0000 1.7
--- render.c 18 Mar 2003 17:50:30 -0000 1.8
***************
*** 1228,1232 ****
! static unsigned char grid_numbers[11][8][4]={
#define _ 0x00
#define M 0xff
--- 1228,1232 ----
! static unsigned char grid_numbers[14][8][4]={
#define _ 0x00
#define M 0xff
***************
*** 1341,1344 ****
--- 1341,1374 ----
{_,_,_,_},
},
+ {
+ {M,_,_,M},
+ {M,_,_,M},
+ {M,_,_,M},
+ {_,M,M,_},
+ {_,M,M,_},
+ {M,_,_,M},
+ {M,_,_,M},
+ {M,_,_,M},
+ },
+ {
+ {_,M,M,_},
+ {_,M,M,_},
+ {_,M,M,_},
+ {_,M,M,_},
+ {_,M,M,_},
+ {M,_,_,M},
+ {M,_,_,M},
+ {M,_,_,M},
+ },
+ {
+ {M,M,M,M},
+ {M,_,_,_},
+ {_,M,_,_},
+ {_,M,_,_},
+ {_,_,M,_},
+ {_,_,M,_},
+ {_,_,_,M},
+ {M,M,M,M},
+ },
};
#undef M
***************
*** 1457,1460 ****
--- 1487,1537 ----
rx+=12/zoom;
}
+ }
+
+ {
+ int i;
+ int right, up;
+ float cx, cy, ex, ey;
+ int X, Y;
+
+ i = (((int)v->vp.rot.x / 90) << 2) | ((int)v->vp.rot.z / 90);
+ right = odx > 0;
+ up = ody > 0;
+ if (i & 0x4)
+ {
+ Y = 13;
+ X = (i & 0x1) ? 12 : 11;
+ up = !(i & 0x8);
+ }
+ else
+ {
+ if (i & 0x1)
+ {
+ Y = 11;
+ X = 12;
+ }
+ else
+ {
+ Y = 12;
+ X = 11;
+ }
+ }
+ cx = (v->sx - 40) / zoom;
+ cy = (v->sy - 40) / zoom;
+ ex = (v->sx - 60 + 40 * right) / zoom;
+ ey = (v->sy - 60 + 40 * up) / zoom;
+
+ glColor3f(1,1,1);
+ glBegin(GL_LINES);
+ glVertex2f(cx,cy);
+ glVertex2f(cx,ey);
+ glVertex2f(cx,cy);
+ glVertex2f(ex,cy);
+ glEnd();
+ glColor4fv(C_GRID_LARGE);
+ glRasterPos2d(ex - 2 / zoom, cy - 4 / zoom);
+ glDrawPixels(4,8,GL_LUMINANCE,GL_UNSIGNED_BYTE,&grid_numbers[X]);
+ glRasterPos2d(cx - 2 / zoom, ey - 4 / zoom);
+ glDrawPixels(4,8,GL_LUMINANCE,GL_UNSIGNED_BYTE,&grid_numbers[Y]);
}
}
|