home *** CD-ROM | disk | FTP | other *** search
/ Photo CD Demo 1 / Demo.bin / fractint / fras1611.zip / INTRO.C < prev    next >
Text File  |  1991-04-11  |  3KB  |  123 lines

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