[Scummvm-cvs-logs] SF.net SVN: scummvm:[41952] scummvm/trunk/engines/kyra
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Mon Jun 29 18:49:38 CEST 2009
Revision: 41952
http://scummvm.svn.sourceforge.net/scummvm/?rev=41952&view=rev
Author: lordhoto
Date: 2009-06-29 16:49:38 +0000 (Mon, 29 Jun 2009)
Log Message:
-----------
Add a "fill" method to Palette.
Modified Paths:
--------------
scummvm/trunk/engines/kyra/screen.cpp
scummvm/trunk/engines/kyra/screen.h
Modified: scummvm/trunk/engines/kyra/screen.cpp
===================================================================
--- scummvm/trunk/engines/kyra/screen.cpp 2009-06-29 16:49:26 UTC (rev 41951)
+++ scummvm/trunk/engines/kyra/screen.cpp 2009-06-29 16:49:38 UTC (rev 41952)
@@ -3308,6 +3308,12 @@
memset(_palData, 0, _numColors * 3);
}
+void Palette::fill(int firstCol, int numCols, uint8 value) {
+ assert(firstCol >= 0 && firstCol + numCols <= _numColors);
+
+ memset(_palData + firstCol * 3, CLIP<int>(value, 0, 63), numCols * 3);
+}
+
void Palette::copy(const Palette &source, int firstCol, int numCols, int dstStart) {
if (numCols == -1)
numCols = MIN(source.getNumColors(), _numColors) - firstCol;
Modified: scummvm/trunk/engines/kyra/screen.h
===================================================================
--- scummvm/trunk/engines/kyra/screen.h 2009-06-29 16:49:26 UTC (rev 41951)
+++ scummvm/trunk/engines/kyra/screen.h 2009-06-29 16:49:38 UTC (rev 41952)
@@ -105,6 +105,15 @@
void clear();
/**
+ * Fill the given indexes with the given component value.
+ *
+ * @param firstCol the first color, which should be overwritten.
+ * @param numCols number of colors, which schould be overwritten.
+ * @param value color component value, which should be stored.
+ */
+ void fill(int firstCol, int numCols, uint8 value);
+
+ /**
* Copy data from another palette.
*
* @param source palette to copy data from.
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