home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / worldmap / demo / intro.c < prev    next >
Encoding:
Text File  |  1986-01-21  |  2.3 KB  |  107 lines

  1. /*  intro  -  Display the introduction to demo.
  2.  
  3.         Copyright 1986 John B. Allison                */
  4.  
  5. struct {        /*  To draw latitude lines in Mercator projection  */
  6.   float    mercaty;    /*  the Mercator y value of this latitude    */
  7.   char    *degree;    /*  this latitude in degrees  */
  8. } lat[] = {
  9.     -2.43623, "-80",
  10.     -1.31697, "-60",
  11.     -0.76291, "-40",
  12.     -0.35634, "-20",
  13.      0.0,      "  0",
  14.      0.35634, " 20",
  15.      0.76291, " 40",
  16.      1.31697, " 60",
  17.      2.43623, " 80"
  18.     };
  19.  
  20. intro(){
  21.  
  22. #define LEFT    -200        /*  left limit of screen        */
  23. #define RIGHT    200        /*  right limit of screen        */
  24. #define INC    20        /*  increment of lines across screen    */
  25. #define BOTTEXT    -2.2        /*  degree markings on bottom        */
  26. #define SIDETEXT (RIGHT-12)    /*  degree markings on side        */
  27.  
  28.   float x, y, ytop, ybot, ybottext;
  29.   int   i, height, width, path = 0, mode = 0;
  30.   char  tstring[10];
  31.  
  32.  
  33.  
  34.     /*  Output marquee  */
  35.  
  36.     height = width = 2;
  37.     x = -50.0;
  38.         y = 1.5;
  39.         settext(&height, &width, &path, &mode);
  40.         movtcurabs(&x, &y);
  41.         text("Alaska Demo");
  42.  
  43.     height = width = 3;
  44.     x = -150.0;
  45.         y = 0.35;
  46.         settext(&height, &width, &path, &mode);
  47.         movtcurabs(&x, &y);
  48.         text("The World Digitized");
  49.  
  50.     height = width = 1;
  51.     x = 60.0;
  52.         y = 0.12;
  53.         settext(&height, &width, &path, &mode);
  54.         movtcurabs(&x, &y);
  55.         text("166 Shady Lane");
  56.  
  57.         y = -0.25;
  58.         movtcurabs(&x, &y);
  59.         text("Apollo, PA 15613.");
  60.  
  61.     x = -160.0;
  62.         y = -0.60;
  63.         settext(&height, &width, &path, &mode);
  64.         movtcurabs(&x, &y);
  65.         text("Enter \"P\" at any time to print.");
  66.  
  67.         y = -1.10;
  68.         movtcurabs(&x, &y);
  69.         text("Escape to exit.");
  70.  
  71.         y = -1.60;
  72.         movtcurabs(&x, &y);
  73.         text("Strike any other key to zoom.");
  74.  
  75.  
  76.     /*  draw lines of longitude  */
  77.  
  78.     ytop = 2.92;
  79.     ybot = -2.92;
  80.     ybottext = BOTTEXT;
  81.  
  82.     for(i = LEFT; i <= RIGHT; i += INC){
  83.         x = i;
  84.         movabs(&x, &ytop);
  85.         lnabs(&x, &ybot);
  86.  
  87.         sprintf(tstring, "%d", i);
  88.         x -= 6;
  89.         movtcurabs(&x, &ybottext);
  90.         text(tstring);
  91.     }
  92.  
  93.     /*  draw lines of latitude.  */
  94.  
  95.     for(i = 0; i <= 9; i++){
  96.         y = lat[i].mercaty;
  97.         x = LEFT;
  98.         movabs(&x, &y);
  99.         x = RIGHT;
  100.         lnabs(&x, &y);
  101.  
  102.         x = SIDETEXT;
  103.         movtcurabs(&x, &y);
  104.         text(lat[i].degree);
  105.     }
  106. }
  107.