From cfae0162008fb27dfd8e0e6c8aeab1721974c562 Mon Sep 17 00:00:00 2001 From: Kari Salminen Date: Mon, 8 Jun 2009 20:46:21 +0000 Subject: Convert FWRenderer and OSRenderer to use Cine::Palette. Also fix some bugs that came up in testing of Cine::Palette. svn-id: r41386 --- engines/cine/pal.h | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'engines/cine/pal.h') diff --git a/engines/cine/pal.h b/engines/cine/pal.h index f59dee53df..4764d5a474 100644 --- a/engines/cine/pal.h +++ b/engines/cine/pal.h @@ -73,16 +73,8 @@ void loadPal(const char *fileName); void loadRelatedPalette(const char *fileName); -void palRotate(uint16 *pal, byte a, byte b, byte c); -void palRotate(byte *pal, byte a, byte b, byte c); -uint16 transformColor(uint16 baseColor, int r, int g, int b); -void transformPaletteRange(uint16 *srcPal, uint16 *dstPal, int startColor, int stopColor, int r, int g, int b); -void transformPaletteRange(byte *srcPal, byte *dstPal, int startColor, int stopColor, int r, int g, int b); - -// This class might be used for handling Cine-engine's palettes in the future. WIP! -// TODO: Document -// TODO: Make use of -// TODO: Test +// A class for handling Cine-engine's palettes. +// TODO: Test a bit more class Palette { public: struct Color { @@ -135,7 +127,10 @@ public: */ byte *save(byte *buf, const uint size, const Graphics::PixelFormat format, const uint numColors, const EndianType endian, const byte firstIndex = 0) const; - Palette &rotateRight(byte firstIndex, byte lastIndex); + /*! \brief Rotate the palette in color range [firstIndex, lastIndex] to the right by the specified rotation amount. + * \param rotationAmount Amount to rotate the sub-palette to the right. Only values 0 and 1 are currently supported! + */ + Palette &rotateRight(byte firstIndex, byte lastIndex, signed rotationAmount = 1); Palette &saturatedAddColor(Palette& output, byte firstIndex, byte lastIndex, signed r, signed g, signed b); /*! \brief Saturated add an RGB color in given color format to current palette's subset and save the modified colors in the given output palette. -- cgit v1.2.3