From 70f8f1fbf3fc39e7ce280883d43a54cc71bc7760 Mon Sep 17 00:00:00 2001 From: Kari Salminen Date: Sun, 24 May 2009 01:36:25 +0000 Subject: Add color and color component getters to Cine::Palette. svn-id: r40849 --- engines/cine/pal.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'engines/cine/pal.h') 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; -- cgit v1.2.3