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

  1.  
  2. /* function to draw a box from a center point position */
  3. grbxct(x,y,side,color)
  4. int x;         /* x coordinate of center point */
  5. int y;         /* y coordinate of center point */
  6. int side;     /* length of side of box */
  7. int color;     /* foreground color of box */
  8. {
  9.     int xc[5]; /* column coordinates of corner points */
  10.     int yc[5]; /* row coordinates of corner points */
  11.     int i; /* temp loop counter */
  12.  
  13. /* set up corner points */
  14.  
  15.     xc[0]=xc[4]=xc[1]=x-(side/2);
  16.     xc[2]=xc[3]=x+(side/2);
  17.     yc[0]=yc[3]=yc[4]=y-(side/2);
  18.     yc[1]=yc[2]=y+(side/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.  
  27.