home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / worldmap / demo / demo.c next >
Text File  |  1986-01-21  |  2KB  |  75 lines

  1. /*  demo  -  fixed demonstration program for The World Digitized.
  2.          Display of Alaska and environs.
  3.  
  4.         Copyright 1986 John B. Allison                */
  5.  
  6.     /*  These arrays are made external not for communication but because
  7.     the Lattice C compiler does not permit the initialization of auto
  8.     (local) agregate (array or structure) variables  */
  9.  
  10.     float llx[] = {        /*  lower left corner x  (longitude)  */
  11.     -246.0, -192.7, -178.4, -175.7, -172.6, -168.4, -164.1 },
  12.     lly[] = {            /*  lower left corner y  (latitude)  */
  13.     -2.90, 0.967, 1.23, 1.34, 1.47, 1.52, 1.54 },
  14.     urx[] = {            /*  upper right corner x (longitude)  */
  15.     246.0, -117.5, -139.8, -147.9, -155.8, -160.0, -160.8 },
  16.     ury[] = {            /*  upper right corner y (latitude)  */
  17.     2.90, 1.85, 1.69, 1.67, 1.66, 1.62, 1.58 };
  18.  
  19. main(){
  20.  
  21.     int ix, mode = 1, color = 0, dev = 1;
  22.     float aspect;
  23.     char  c, getch();
  24.  
  25.  
  26.  
  27.  
  28.     printf("                    The World Digitized\n");
  29.     printf("                      166 Shady Lane\n");
  30.     printf("             Apollo, PA 15613\n");
  31.  
  32.     setopt();        /*  Read and set graphics and printer
  33.                     from option file (demo.opt).    */
  34.  
  35.     initgraphics(&mode);    /*  initialize Halo Graphics  */
  36.  
  37.     setworld(&llx[0], &lly[0], &urx[0], &ury[0]);
  38.  
  39.     intro();        /*  display introduction  */
  40.     displayd();        /*  Display .mp2 file.  */
  41.  
  42.     for(ix = 1; ix < 7; ix++){
  43.         prompt("Zoom?");
  44.  
  45.         while((c=getch()) == 'P' ||
  46.                 c == 'p'){    /*  Wait on user response.  */
  47.             dev = 1;    /*  Optionally print.       */
  48.             gprint();
  49.         }
  50.  
  51.         if(c == 27){        /*  Escape  */
  52.             closegraphics();
  53.             exit();
  54.         }
  55.  
  56.         initgraphics(&mode);    /*  Delete display and zoom  */
  57.         setworld(&llx[ix], &lly[ix], &urx[ix], &ury[ix]);
  58.  
  59.         grid();        /*  Display lat/long grid  */
  60.         displayd();    /*  Display .mp2 file.  */
  61.     }
  62.  
  63.     prompt("Fini");
  64.  
  65.     while((c=getch()) == 'P' ||
  66.             c == 'p'){        /*  Wait on user response.  */
  67.         dev = 1;        /*  Optionally print.       */
  68.         prompt("    ");
  69.         gprint();
  70.         prompt("Fini");
  71.     }
  72.  
  73.     closegraphics();
  74. }
  75.