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

  1.  
  2. /* function to draw a rectangle from an upper right corner positon */
  3. grrtur(x,y,w,l,color)
  4. int x; /* x coordinate of upper right position */
  5. int y; /* y coordinate of upper right position */
  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+1;
  16.     xc[2]=xc[3]=x;
  17.     yc[0]=yc[3]=yc[4]=y;
  18.     yc[2]=yc[1]=y+l-1;
  19.  
  20. /* plot points */
  21.     for(i = 0; i < 4; ++i)
  22.          eg_line(xc[i],yc[i],xc[i+1],yc[i+1],color);
  23.     return(0);
  24. }
  25.