home *** CD-ROM | disk | FTP | other *** search
/ Mega A/V / mega_av.zip / mega_av / GRAPHUTL / FRPOR172.ZIP / INTRO.C < prev    next >
C/C++ Source or Header  |  1992-03-14  |  3KB  |  132 lines

  1.  
  2. /*
  3.  * intro.c
  4.  *
  5.  * FRACTINT intro screen (authors & credits)
  6.  *
  7.  *
  8.  */
  9.  
  10. #include <time.h>
  11. #ifndef XFRACT
  12. #include <dos.h>
  13. #endif
  14.  
  15. #include "fractint.h"
  16. #include "helpdefs.h"
  17.  
  18. /* stuff from fractint */
  19.  
  20. extern int  lookatmouse;
  21. extern long timer_start;
  22. extern int  helpmode;
  23. extern int  extraseg;
  24.  
  25. void putstring         (int x, int y, int attr, CHAR far * msg);
  26. int  putstringcenter (int x, int y, int width, int attr, char far * msg);
  27. void setattr         (int x, int y, int attr, int width);
  28. void scrollup         (int top, int bot);
  29. void movecursor      (int x, int y);
  30. void setclear         (void);
  31. void helptitle         (void);
  32. int  getakey         (void);
  33. int  keypressed      (void);
  34. int  read_help_topic (int label, int off, int len, VOIDFARPTR buf);
  35.  
  36.  
  37. void intro_overlay(void) { }
  38.  
  39.  
  40. void intro(void)
  41.    {
  42.    int         toprow, botrow, i, j, delaymax;
  43.    char      oldchar;
  44.    int         authors[100];        /* this should be enough for awhile */
  45.    char far *credits;
  46.    char far *screen_text;
  47.    int         oldlookatmouse;
  48.    int         oldhelpmode;
  49.  
  50.    ENTER_OVLY(OVLY_INTRO);
  51.  
  52.    timer_start -= clock();        /* "time out" during help */
  53.    oldlookatmouse = lookatmouse;
  54.    oldhelpmode = helpmode;
  55.    lookatmouse = 0;            /* de-activate full mouse checking */
  56.  
  57.    screen_text = MK_FP(extraseg, 0);
  58.  
  59.    i = 32767 + read_help_topic(INTRO_AUTHORS, 0, 32767, screen_text);
  60.    screen_text[i++] = '\0';
  61.    credits = screen_text + i;
  62.    i = 32767 + read_help_topic(INTRO_CREDITS, 0, 32767, credits);
  63.    credits[i++] = '\0';
  64.  
  65.    j = 0;
  66.    authors[j] = 0;        /* find the start of each credit-line */
  67.    for (i = 0; credits[i] != 0; i++)
  68.       if (credits[i] == 10)
  69.      authors[++j] = i+1;
  70.    authors[j+1] = i;
  71.  
  72.    helptitle();
  73.    toprow = 8;
  74. #ifndef XFRACT
  75.    botrow = 21;
  76. #else
  77.    botrow = 20;
  78.    putstringcenter(21,0,80,C_TITLE,
  79.    "Unix/X port of fractint by Ken Shirriff [shirriff@sprite.Berkeley.EDU]");
  80. #endif
  81.    putstringcenter(1,0,80,C_TITLE, "Press ENTER for main menu, F1 for help.");
  82.    putstring(2,0,C_CONTRIB,screen_text);
  83.    setattr(2,0,C_AUTHDIV1,80);
  84.    setattr(7,0,C_AUTHDIV1,80);
  85.    setattr(22,0,C_AUTHDIV2,80);
  86.    setattr(3,0,C_PRIMARY,320);
  87.    setattr(23,0,C_TITLE_LOW,160);
  88.    for (i = 3; i < 7; ++i)
  89.       setattr(i,20,C_CONTRIB,60);
  90.    setattr(toprow,0,C_CONTRIB,14*80);
  91.    i = botrow - toprow;
  92.    oldchar = credits[authors[i+1]];
  93.    credits[authors[i+1]] = 0;
  94.    putstring(toprow,0,C_CONTRIB,credits);
  95.    credits[authors[i+1]] = oldchar;
  96.    delaymax = 10;
  97.    movecursor(25,80); /* turn it off */
  98.    helpmode = HELPMENU;
  99.    while (! keypressed())
  100.       {
  101.       for (j = 0; j < delaymax && !(keypressed()); j++)
  102.      delay(100);
  103.       if (keypressed() == 32)
  104.      {    /* spacebar pauses */
  105.      getakey();
  106. #ifndef XFRACT
  107.          while (!keypressed()) ;
  108. #else
  109.          waitkeypressed(0);
  110. #endif
  111.      if (keypressed() == 32)
  112.         getakey();
  113.      }
  114.       delaymax = 15;
  115.       scrollup(toprow, botrow);
  116.       i++;
  117.       if (credits[authors[i]] == 0)
  118.      i = 0;
  119.       oldchar = credits[authors[i+1]];
  120.       credits[authors[i+1]] = 0;
  121.       putstring(botrow,0,C_CONTRIB,&credits[authors[i]]);
  122.       setattr(botrow,0,C_CONTRIB,80);
  123.       credits[authors[i+1]] = oldchar;
  124.       movecursor(25,80); /* turn it off */
  125.       }
  126.  
  127.    lookatmouse = oldlookatmouse;        /* restore the mouse-checking */
  128.    helpmode = oldhelpmode;
  129.    EXIT_OVLY;
  130.    return ;
  131.    }
  132.