home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume10 / logo / part01 / adm.i next >
Encoding:
Text File  |  1987-06-23  |  1.4 KB  |  57 lines

  1. /* Include file for turtle.c for ADM with Retrographics board */
  2.  
  3. int admturt(),admfrom(),admto(),admstate();
  4. struct display adm ={0.0,0.0,0.0,-512.0,511.0,-390.0,389.0,1.0,0,
  5.     "","\032\035\033\014\030","","\032\035\033\014\030",
  6.     admturt,admfrom,admto,nullfn,nullfn,nullfn,
  7.     nullfn,nullfn,nullfn,admstate};
  8.  
  9. admturt(hide)
  10. int hide;    /* nonzero to erase turtle */
  11. {
  12.     double newx,newy,angle;
  13.  
  14.     printf("\035");
  15.     angle = (mydpy->turth-90.0)*3.141592654/180.0;
  16.     newx = mydpy->turtx + 15.0*sin(angle);
  17.     newy = mydpy->turty + 15.0*cos(angle);
  18.     printf(hide ? "\033\177" : "\033a");
  19.     plotpos((int)newx,(int)(yscrunch*newy));
  20.     angle = mydpy->turth*3.141592654/180.0;
  21.     newx = mydpy->turtx + 15.0*sin(angle);
  22.     newy = mydpy->turty + 15.0*cos(angle);
  23.     plotpos((int)newx,(int)(yscrunch*newy));
  24.     angle = (mydpy->turth+90.0)*3.141592654/180.0;
  25.     newx = mydpy->turtx + 15.0*sin(angle);
  26.     newy = mydpy->turty + 15.0*cos(angle);
  27.     plotpos((int)newx,(int)(yscrunch*newy));
  28.     angle = (mydpy->turth-90.0)*3.141592654/180.0;
  29.     newx = mydpy->turtx + 15.0*sin(angle);
  30.     newy = mydpy->turty + 15.0*cos(angle);
  31.     plotpos((int)newx,(int)(yscrunch*newy));
  32.     printf("\037\030");
  33. }
  34.  
  35. admfrom(x,y)
  36. double x,y;
  37. {
  38.     printf("\035");
  39.     printf(penerase ? "\033\177" : "\033a");
  40.     plotpos((int)x,(int)y);
  41. }
  42.  
  43. admto(x,y)
  44. double x,y;
  45. {
  46.     plotpos((int)x,(int)y);
  47.     printf("\037\030");
  48. }
  49.  
  50. admstate(which) {
  51.     if (which=='R') {
  52.         printf("ADM can't penreverse, setting pendown.\n");
  53.         penerase = 0;
  54.     }
  55. }
  56.  
  57.