home *** CD-ROM | disk | FTP | other *** search
- /*
- ** AGA WhiteFade Demo
- ** ------------------
- ** There are three examples of fading in this program: ColourMorph(),
- ** ColourToPalette(), and PaletteToColour().
- **
- */
-
- #include <proto/games.h>
- #include <proto/exec.h>
-
- struct GMSBase *GMSBase;
- extern struct ExecBase *SysBase;
-
- #define AMT_PLANES 5
-
- struct GameScreen GameScreen = {
- GSV1, /* Structure version */
- 0,0,0, /* Screen memory 1,2,3 */
- 0, /* Screen link */
- 0, /* Adress of palette */
- 0, /* Address of rasterlist */
- 32, /* Amount of colours */
- 320,256, /* Screen Width and Height */
- 0,0,0, /* Picture Widths and Height */
- AMT_PLANES, /* Amount of bitplanes */
- 0,0, /* X/Y screen offset */
- 0,0, /* X/Y picture offset */
- 0, /* Special attributes */
- LORES|COL24BIT, /* Screen mode */
- INTERLEAVED, /* Screen type */
- };
-
- struct Picture Picture = {
- PCV1, /* Version header */
- 0, /* Destination */
- 320,320/8,256, /* Width, Height */
- AMT_PLANES, /* Amount of Planes */
- 32, /* Amount of colours */
- 0, /* Palette (remap) */
- LORES|COL24BIT, /* Screen mode */
- INTERLEAVED, /* Destination */
- GETPALETTE, /* Parameters */
- "GAMESLIB:data/IFF.Loading"
- };
-
- struct GameScreen *OurScreen = &GameScreen;
- struct Picture *LoadingPic = &Picture;
-
- /*=========================================================================*/
-
- void main(void)
- {
- UWORD FadeState = 0;
-
- if (GMSBase = (struct GMSBase *) OpenLibrary("games.library", 0)) {
- SetUserPrefs(0);
- if (AddScreen(OurScreen) == NULL) {
- LoadingPic->Data = OurScreen->MemPtr1;
- if (LoadPic(LoadingPic) == NULL) {
- ShowScreen(OurScreen);
-
- do { WaitSVBL();
- FadeState = ColourMorph(OurScreen,FadeState,10,0,32,0x000000,0xFFFFFF);
- } while (FadeState != NULL);
-
- do { WaitSVBL();
- FadeState = ColourToPalette(OurScreen,FadeState,2,0,32,LoadingPic->Palette,0xFFFFFF);
- } while (FadeState != NULL);
-
- do { WaitSVBL();
- FadeState = PaletteToColour(OurScreen,FadeState,2,0,32,LoadingPic->Palette,0x000000);
- } while (FadeState != NULL);
-
- FreePic(LoadingPic);
- }
- DeleteScreen(OurScreen);
- }
- CloseLibrary((struct Library *)GMSBase);
- }
- }
-
-