diff options
-rw-r--r-- | engines/kyra/screen.cpp | 6 | ||||
-rw-r--r-- | engines/kyra/screen.h | 9 |
2 files changed, 15 insertions, 0 deletions
diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp index e7aa4af8b7..3c9759d88d 100644 --- a/engines/kyra/screen.cpp +++ b/engines/kyra/screen.cpp @@ -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; diff --git a/engines/kyra/screen.h b/engines/kyra/screen.h index 8744a7107d..ba69aea3cc 100644 --- a/engines/kyra/screen.h +++ b/engines/kyra/screen.h @@ -105,6 +105,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. * * @param source palette to copy data from. |