[Scummvm-cvs-logs] SF.net SVN: scummvm:[40849] scummvm/trunk/engines/cine
buddha_ at users.sourceforge.net
buddha_ at users.sourceforge.net
Sun May 24 03:36:26 CEST 2009
Revision: 40849
http://scummvm.svn.sourceforge.net/scummvm/?rev=40849&view=rev
Author: buddha_
Date: 2009-05-24 01:36:25 +0000 (Sun, 24 May 2009)
Log Message:
-----------
Add color and color component getters to Cine::Palette.
Modified Paths:
--------------
scummvm/trunk/engines/cine/pal.cpp
scummvm/trunk/engines/cine/pal.h
Modified: scummvm/trunk/engines/cine/pal.cpp
===================================================================
--- scummvm/trunk/engines/cine/pal.cpp 2009-05-24 01:29:09 UTC (rev 40848)
+++ scummvm/trunk/engines/cine/pal.cpp 2009-05-24 01:36:25 UTC (rev 40849)
@@ -243,6 +243,22 @@
g_system->setPalette(buf, 0, colorCount());
}
+Cine::Palette::Color Palette::getColor(byte index) const {
+ return _colors[index];
+}
+
+uint8 Palette::getR(byte index) const {
+ return _colors[index].r;
+}
+
+uint8 Palette::getG(byte index) const {
+ return _colors[index].g;
+}
+
+uint8 Palette::getB(byte index) const {
+ return _colors[index].b;
+}
+
void Palette::setColorFormat(const Graphics::PixelFormat format) {
_format = format;
}
Modified: scummvm/trunk/engines/cine/pal.h
===================================================================
--- scummvm/trunk/engines/cine/pal.h 2009-05-24 01:29:09 UTC (rev 40848)
+++ scummvm/trunk/engines/cine/pal.h 2009-05-24 01:36:25 UTC (rev 40849)
@@ -84,12 +84,11 @@
// 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 @@
/*! \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;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list