home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / dev / misc / gms_dev.lha / GMS / Source / C / AGAGreenFade.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-16  |  2.2 KB  |  86 lines

  1. /*
  2. ** AGA Fade Demo
  3. ** -------------
  4. ** Fades in a 32 colour AGA picture (24 bit colour).  Then up to a specified
  5. ** colour (greenish yellow), and then out to black.
  6. */
  7.  
  8. #include <proto/games.h>
  9. #include <proto/exec.h>
  10.  
  11. struct GMSBase *GMSBase;
  12. extern struct ExecBase *SysBase;
  13.  
  14. #define AMT_PLANES 5
  15.  
  16. ULONG Palette[] =
  17. {
  18.      0x000000,0x080808,0x101010,0x191919,0x212121,0x292929,0x313131,
  19.      0x3A3A3A,0x424242,0x4A4A4A,0x525252,0x5A5A5A,0x636363,0x6B6B6B,
  20.      0x737373,0x7B7B7B,0x848484,0x8C8C8C,0x949494,0x9C9C9C,0xA5A5A5,
  21.      0xADADAD,0xB5B5B5,0xBDBDBD,0xC5C5C5,0xCECECE,0xD6D6D6,0x7F7F7F,
  22.      0x9B9B9B,0x707070,0x444444,0x1E1E1E
  23. };
  24.  
  25. struct Picture GamePic =
  26. {
  27.      PCV1,               /* Version header */
  28.      0,                  /* Destination */
  29.      320,0,256,          /* Width, Height */
  30.      AMT_PLANES,         /* Amount of Planes */
  31.      32,                 /* Amount of colours */
  32.      Palette,            /* Palette */
  33.      LORES|COL24BIT,     /* Screen mode */
  34.      0,                  /* Destination */
  35.      0,                  /* Parameters */
  36.      "GAMESLIB:data/IFF.Loading"
  37. };
  38.  
  39. /*=========================================================================*/
  40.  
  41. void main(void)
  42. {
  43.    int FState=0;
  44.    struct GameScreen *GameScreen;
  45.  
  46.    GMSBase = (struct GMSBase *) OpenLibrary("games.library", 0);
  47.    SetUserPrefs(0);
  48.  
  49.    if (GameScreen = AddScreenTags(TAGS,NULL,
  50.       GSA_Planes,AMT_PLANES,
  51.       GSA_ScrMode,LORES|COL24BIT,
  52.       GSA_ScrWidth,320,
  53.       GSA_ScrHeight,256,
  54.       GSA_ScrType,INTERLEAVED,
  55.       TAGEND)) {
  56.  
  57.       GamePic.Data = GameScreen->MemPtr1;
  58.       GamePic.ScrType = GameScreen->ScrType;
  59.       if (LoadPic(&GamePic) == NULL) {
  60.          ShowScreen(GameScreen);
  61.  
  62.          do
  63.          {
  64.            WaitSVBL();
  65.            FState = ColourToPalette(GameScreen,FState,2,0,32,Palette,0x000000);
  66.          } while (FState != NULL);
  67.  
  68.          do
  69.          {
  70.            WaitSVBL();
  71.            FState = PaletteToColour(GameScreen,FState,2,0,32,Palette,0xa5f343);
  72.          } while (FState != NULL);
  73.  
  74.          do
  75.          {
  76.            WaitSVBL();
  77.            FState = ColourMorph(GameScreen,FState,2,0,32,0xa5f343,0x000000);
  78.          } while (FState != NULL);
  79.  
  80.       }
  81.       DeleteScreen(GameScreen);
  82.    }
  83.    CloseLibrary((struct Library *)GMSBase);
  84. }
  85.  
  86.