[Scummvm-cvs-logs] SF.net SVN: scummvm:[39713] scummvm/trunk/engines/cine

buddha_ at users.sourceforge.net buddha_ at users.sourceforge.net
Fri Mar 27 22:31:14 CET 2009


Revision: 39713
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39713&view=rev
Author:   buddha_
Date:     2009-03-27 21:31:03 +0000 (Fri, 27 Mar 2009)

Log Message:
-----------
Cine::Palette: Add a black palette constructor and a clear-function for clearing the palette of all data (Releases used memory etc).

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-03-27 20:59:46 UTC (rev 39712)
+++ scummvm/trunk/engines/cine/pal.cpp	2009-03-27 21:31:03 UTC (rev 39713)
@@ -269,6 +269,17 @@
 	return result;
 }
 
+Palette::Palette(const Graphics::PixelFormat format, const uint numColors) : _format(format), _colors() {
+	_colors.resize(numColors);
+	fillWithBlack();
+}
+
+Palette &Palette::clear() {
+	_format = Graphics::PixelFormat();
+	_colors.clear();
+	return *this;
+}
+
 Palette &Palette::load(const byte *buf, const uint size, const Graphics::PixelFormat format, const uint numColors, const EndianType endian) {
 	assert(format.bytesPerPixel * numColors <= size); // Make sure there's enough input space
 	assert(format.aLoss == 8); // No alpha

Modified: scummvm/trunk/engines/cine/pal.h
===================================================================
--- scummvm/trunk/engines/cine/pal.h	2009-03-27 20:59:46 UTC (rev 39712)
+++ scummvm/trunk/engines/cine/pal.h	2009-03-27 21:31:03 UTC (rev 39713)
@@ -80,6 +80,17 @@
 	};
 
 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
+	 */
+	Palette(const Graphics::PixelFormat format, const uint numColors);
+
+	/*! \brief Clear the palette (Set color count to zero, release memory, overwrite color format with default value).
+	 * \note This is very different from using fillWithBlack-function which fills the palette with black.
+	 */
+	Palette &clear();
+
 	/*! \brief Load palette from buffer with given color format, endianness and number of colors.
 	 * \param buf Input buffer
 	 * \param size Input buffer size in bytes


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