diff options
author | Marcus Comstedt | 2005-04-03 19:40:54 +0000 |
---|---|---|
committer | Marcus Comstedt | 2005-04-03 19:40:54 +0000 |
commit | ac54a40ea26f43cc0051c71723d62f6aec6df920 (patch) | |
tree | 924901aee7ea6a28769af226f84c55bc8557a206 /common/system.h | |
parent | 8fe07f1f3ed25beee1dd244f81f3153a2265edc7 (diff) | |
download | scummvm-rg350-ac54a40ea26f43cc0051c71723d62f6aec6df920.tar.gz scummvm-rg350-ac54a40ea26f43cc0051c71723d62f6aec6df920.tar.bz2 scummvm-rg350-ac54a40ea26f43cc0051c71723d62f6aec6df920.zip |
Added possibility to have an overlay with an alpha channel.
svn-id: r17353
Diffstat (limited to 'common/system.h')
-rw-r--r-- | common/system.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/common/system.h b/common/system.h index 6ae8a659a4..39bfd1ee9e 100644 --- a/common/system.h +++ b/common/system.h @@ -333,6 +333,13 @@ public: virtual int overlayToScreenY(int y) { return y; } /** + * Return true if the overlay pixel format has an alpha channel. + */ + virtual bool hasAlpha() const { + return false; + } + + /** * Convert the given RGB triplet into an OverlayColor. A OverlayColor can * be 8bit, 16bit or 32bit, depending on the target system. The default * implementation generates a 16 bit color value, in the 565 format @@ -356,6 +363,29 @@ public: b = ((color&0x1F) << 3); } + /** + * Convert the given ARGB quadruplet into an OverlayColor. A OverlayColor can + * be 8bit, 16bit or 32bit, depending on the target system. The default + * implementation generates a 16 bit color value, in the 565 format + * (that is, 5 bits red, 6 bits green, 5 bits blue). + * @see colorToRGB + */ + virtual OverlayColor ARGBToColor(uint8 a, uint8 r, uint8 g, uint8 b) { + return RGBToColor(r, g, b); + } + + /** + * Convert the given OverlayColor into an ARGB quadruplet. An OverlayColor can + * be 8bit, 16bit or 32bit, depending on the target system. The default + * implementation takes a 16 bit color value and assumes it to be in 565 format + * (that is, 5 bits red, 6 bits green, 5 bits blue). + * @see RGBToColor + */ + virtual void colorToARGB(OverlayColor color, uint8 &a, uint8 &r, uint8 &g, uint8 &b) { + colorToRGB(color, r, g, b); + a = 255; + } + //@} |