home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 11 / 11.iso / m / m242 / 2.ddi / VER2FUNC.ZIP / GRRTCT.C < prev    next >
Encoding:
Text File  |  1989-10-16  |  662 b   |  26 lines

  1.  
  2. /* function to draw a rectangle from a center point position */
  3. grrtct(x,y,w,l,color)
  4. int x; /* x coordinate of center point */
  5. int y; /* y coordinate of center point */
  6. int w; /* width of rectangle */
  7. int l; /* length of rectangle */
  8. int color; /* color of rectangle */
  9. {
  10.     int xc[5]; /* x coordinates of corner points */
  11.     int yc[5]; /* y coordinates of corner points */
  12.     int i; /* temp loop counter */
  13.  
  14. /* set up corner points */
  15.     xc[0]=xc[1]=xc[4]=x-(w/2);
  16.     xc[2]=xc[3]=x+(w/2);
  17.     yc[0]=yc[3]=yc[4]=y-(l/2);
  18.     yc[2]=yc[1]=y+(l/2);
  19.  
  20. /* plot points */
  21.  
  22.     for(i = 0; i < 4; ++i)
  23.         eg_line(xc[i],yc[i],xc[i+1],yc[i+1],color);
  24.     return(0);
  25. }
  26.