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

  1. /*
  2. ** HiRes Picture Display
  3. ** ---------------------
  4. ** Opens a screen of 640x256 pixels in HIRES LACED mode.  You can even
  5. ** try SuperHiRes (SHIRES) if you change the appropriate flag in the
  6. ** GameScreen structure.
  7. */
  8.  
  9. #include <proto/exec.h>
  10. #include <proto/games.h>
  11.  
  12. struct GMSBase *GMSBase;
  13. extern struct ExecBase *SysBase;
  14.  
  15. /*=========================================================================*/
  16.  
  17. void main(void)
  18. {
  19.   struct GameScreen *GameScreen;
  20.   struct Picture *PIC_HiRes;
  21.  
  22.   if (GMSBase = (struct GMSBase *) OpenLibrary("games.library", 0)) {
  23.    SetUserPrefs(0);
  24.    if (GameScreen = AddScreenTags(TAGS,NULL,
  25.       GSA_Planes,4,
  26.       GSA_ScrMode,HIRES|LACED|COL12BIT,
  27.       GSA_ScrWidth,640,
  28.       GSA_ScrHeight,256,
  29.       GSA_ScrType,ILBM,
  30.       TAGEND)) {
  31.  
  32.     if (PIC_HiRes = LoadPicTags(TAGS,NULL,
  33.        PCA_Data,GameScreen->MemPtr1,
  34.        PCA_ScrMode,GameScreen->ScrMode,
  35.        PCA_ScrType,GameScreen->ScrType,
  36.        PCA_Options,GETPALETTE,
  37.        PCA_File,"GAMESLIB:data/IFF.Pic640x256",
  38.        TAGEND)) {
  39.  
  40.        GameScreen->Palette = PIC_HiRes->Palette;
  41.        UpdatePalette(GameScreen);
  42.        ShowScreen(GameScreen);
  43.        WaitLMB();
  44.  
  45.     FreePic(PIC_HiRes);
  46.     }
  47.    DeleteScreen(GameScreen);
  48.    }
  49.   CloseLibrary((struct Library *)GMSBase);
  50.   }
  51. }
  52.  
  53.