home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / programm.ing / ams__l~1.zoo / include / screen.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-05  |  2.1 KB  |  93 lines

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. //  This file is part of the Atari Machine Specific Library,
  4. //  and is Copyright 1992 by Warwick W. Allison.
  5. //
  6. //  You are free to copy and modify these sources, provided you acknowledge
  7. //  the origin by retaining this notice, and adhere to the conditions
  8. //  described in the file COPYING.
  9. //
  10. //////////////////////////////////////////////////////////////////////////////
  11.  
  12. #ifndef _Screen_h
  13. #define _Screen_h
  14.  
  15. #include "Resolution.h"
  16. #include <osbind.h>
  17.  
  18. #define DESKSCREEN ((long *)0)
  19.  
  20.  
  21. class Screen {
  22. private:
  23.     char *AllocArea;
  24.     long AllocSize;
  25.     char *location;
  26.     Resolution Res;
  27.     short *Palette;
  28.  
  29. public:
  30.     Screen();
  31.     Screen(const Screen&);
  32.     Screen(Resolution);
  33.     Screen(Resolution, short LinesAbove, short LinesBelow);
  34.     Screen(short LinesAbove, short LinesBelow);
  35.     Screen(const char *filename); // May cause ! to be true.
  36.     Screen(long *At); // DESKSCREEN = current screen, else specify desired location
  37.     ~Screen();
  38.  
  39.     void Clear();
  40.  
  41.     int Load(const char*);
  42.     int LoadPalette(const char *);
  43.  
  44.     int Save(const char*);
  45.  
  46.     int LoadDegas(const char *);
  47.     int SaveDegas(const char *);
  48.     int LoadDegasPalette(const char *);
  49.     int LoadCrackArtPalette(const char *);
  50.     int LoadCrackArt(const char *);
  51.     int SaveCrackArt(const char *, int Compression=3);
  52.  
  53.     int operator !();
  54.  
  55.     void ShowPalette();
  56.     void Show();
  57.     void Use();
  58.  
  59.     void operator= (Screen&);
  60.     void Copy(Screen& s) { operator=(s); }
  61.  
  62.     short* Colour();
  63.     short* Color() { return Colour(); }
  64.  
  65.     char *Location();
  66.     Resolution Rez();
  67. };
  68.  
  69. class PaletteChange // Resolution sensitive
  70. {
  71. public:
  72.     PaletteChange();
  73.     ~PaletteChange();
  74.  
  75. private:
  76.     short *col;
  77.     short ncols;
  78. };
  79.  
  80.  
  81. // Always inline:
  82.  
  83. inline    char* Screen::Location() { return location; }
  84. inline    Resolution Screen::Rez() { return Res; }
  85. inline    void Screen::ShowPalette() { Setpalette(Palette); }
  86. inline    void Screen::Show() { Setscreen(-1,location,-1); }
  87. inline    void Screen::Use() { Setscreen(location,-1,-1); }
  88. inline     short* Screen::Colour() { return Palette; }
  89. inline    int Screen::operator !() { return !location; }
  90.  
  91.  
  92. #endif
  93.