diff options
author | Kari Salminen | 2009-05-24 01:36:25 +0000 |
---|---|---|
committer | Kari Salminen | 2009-05-24 01:36:25 +0000 |
commit | 70f8f1fbf3fc39e7ce280883d43a54cc71bc7760 (patch) | |
tree | 05a977fe7b5bae6c18c8e87547f54880e310838f /engines/cine/pal.h | |
parent | 344caa88fcf8ce352e7bee6b2c6d4a8df2df548e (diff) | |
download | scummvm-rg350-70f8f1fbf3fc39e7ce280883d43a54cc71bc7760.tar.gz scummvm-rg350-70f8f1fbf3fc39e7ce280883d43a54cc71bc7760.tar.bz2 scummvm-rg350-70f8f1fbf3fc39e7ce280883d43a54cc71bc7760.zip |
Add color and color component getters to Cine::Palette.
svn-id: r40849
Diffstat (limited to 'engines/cine/pal.h')
-rw-r--r-- | engines/cine/pal.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/engines/cine/pal.h b/engines/cine/pal.h index ccb87b8c61..f59dee53df 100644 --- a/engines/cine/pal.h +++ b/engines/cine/pal.h @@ -84,12 +84,11 @@ void transformPaletteRange(byte *srcPal, byte *dstPal, int startColor, int stopC // TODO: Make use of // TODO: Test class Palette { -private: +public: struct Color { uint8 r, g, b; }; -public: /*! \brief Create an initially black palette with the given color format and number of colors. * \param format Color format * \param numColors Number of colors @@ -177,6 +176,18 @@ public: /*! \brief Sets current palette to global OSystem's palette using g_system->setPalette. */ void setGlobalOSystemPalette() const; + /*! \brief Get the color at the given palette index. */ + Color getColor(byte index) const; + + /*! \brief Get the red color component of the color at the given palette index. */ + uint8 getR(byte index) const; + + /*! \brief Get the green color component of the color at the given palette index. */ + uint8 getG(byte index) const; + + /*! \brief Get the blue color component of the color at the given palette index. */ + uint8 getB(byte index) const; + private: void setColorFormat(const Graphics::PixelFormat format); Cine::Palette::Color saturatedAddColor(Cine::Palette::Color baseColor, signed r, signed g, signed b) const; |