home *** CD-ROM | disk | FTP | other *** search
-
- /* function to draw a box from a center point position */
- grbxct(x,y,side,color)
- int x; /* x coordinate of center point */
- int y; /* y coordinate of center point */
- int side; /* length of side of box */
- int color; /* foreground color of box */
- {
- int xc[5]; /* column coordinates of corner points */
- int yc[5]; /* row coordinates of corner points */
- int i; /* temp loop counter */
-
- /* set up corner points */
-
- xc[0]=xc[4]=xc[1]=x-(side/2);
- xc[2]=xc[3]=x+(side/2);
- yc[0]=yc[3]=yc[4]=y-(side/2);
- yc[1]=yc[2]=y+(side/2);
-
- /* plot points */
-
- for(i = 0; i < 4; ++i)
- eg_line(xc[i],yc[i],xc[i+1],yc[i+1],color);
- return(0);
- }
-