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