#include <screen.h>
Public Types | |
enum | { kVGABytesPerColor = 3, kPC98BytesPerColor = 3, kAmigaBytesPerColor = 2 } |
enum | CGAIntensity { kIntensityLow = 0, kIntensityHigh = 1 } |
Public Member Functions | |
Palette (const int numColors) | |
void | loadVGAPalette (Common::ReadStream &stream, int startIndex, int colors) |
void | loadHiColorPalette (Common::ReadStream &stream, int startIndex, int colors) |
void | loadEGAPalette (Common::ReadStream &stream, int startIndex, int colors) |
void | setCGAPalette (int palIndex, CGAIntensity intensity) |
void | loadAmigaPalette (Common::ReadStream &stream, int startIndex, int colors) |
void | loadPC98Palette (Common::ReadStream &stream, int startIndex, int colors) |
int | getNumColors () const |
void | clear () |
void | fill (int firstCol, int numCols, uint8 value) |
void | copy (const Palette &source, int firstCol=0, int numCols=-1, int dstStart=-1) |
void | copy (const uint8 *source, int firstCol, int numCols, int dstStart=-1) |
uint8 * | fetchRealPalette () const |
uint8 & | operator[] (const int index) |
const uint8 & | operator[] (const int index) const |
uint8 * | getData () |
const uint8 * | getData () const |
A class that manages KYRA palettes.
This class stores the palette data as VGA RGB internally.
Set default CGA palette. We only need the cyan/magenta/grey mode.
void Kyra::Palette::loadVGAPalette | ( | Common::ReadStream & | stream, |
int | startIndex, | ||
int | colors | ||
) |
Load a VGA palette from the given stream.
void Kyra::Palette::loadHiColorPalette | ( | Common::ReadStream & | stream, |
int | startIndex, | ||
int | colors | ||
) |
Load a HiColor palette from the given stream.
void Kyra::Palette::loadEGAPalette | ( | Common::ReadStream & | stream, |
int | startIndex, | ||
int | colors | ||
) |
Load a EGA palette from the given stream.
void Kyra::Palette::loadAmigaPalette | ( | Common::ReadStream & | stream, |
int | startIndex, | ||
int | colors | ||
) |
Load a AMIGA palette from the given stream.
void Kyra::Palette::loadPC98Palette | ( | Common::ReadStream & | stream, |
int | startIndex, | ||
int | colors | ||
) |
Load a PC98 16 color palette from the given stream.
|
inline |
Return the number of colors this palette manages.
void Kyra::Palette::clear | ( | ) |
Set all palette colors to black.
void Kyra::Palette::fill | ( | int | firstCol, |
int | numCols, | ||
uint8 | value | ||
) |
Fill the given indexes with the given component value.
firstCol | the first color, which should be overwritten. |
numCols | number of colors, which schould be overwritten. |
value | color component value, which should be stored. |
void Kyra::Palette::copy | ( | const Palette & | source, |
int | firstCol = 0 , |
||
int | numCols = -1 , |
||
int | dstStart = -1 |
||
) |
Copy data from another palette.
source | palette to copy data from. |
firstCol | the first color of the source which should be copied. |
numCols | number of colors, which should be copied. -1 all remaining colors. |
dstStart | the first color, which should be ovewritten. If -1 firstCol will be used as start. |
void Kyra::Palette::copy | ( | const uint8 * | source, |
int | firstCol, | ||
int | numCols, | ||
int | dstStart = -1 |
||
) |
Copy data from a raw VGA palette.
source | source buffer |
firstCol | the first color of the source which should be copied. |
numCols | number of colors, which should be copied. |
dstStart | the first color, which should be ovewritten. If -1 firstCol will be used as start. |
uint8* Kyra::Palette::fetchRealPalette | ( | ) | const |
Fetch a RGB palette.
|
inline |
Gets raw access to the palette.
TODO: Get rid of this.