mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-05 01:38:36 +00:00
Add a "fill" method to Palette.
svn-id: r41952
This commit is contained in:
parent
bfe8ec6d66
commit
07cdbd273d
@ -3308,6 +3308,12 @@ void Palette::clear() {
|
||||
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;
|
||||
|
@ -104,6 +104,15 @@ public:
|
||||
*/
|
||||
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.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user