aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMax Horn2009-09-15 08:51:16 +0000
committerMax Horn2009-09-15 08:51:16 +0000
commit9369d6b772f0a97ffca7639ba22fa07eee03549a (patch)
tree771012e98a090622dbe4c6d1830082f977e5c31e /engines
parente1de3d0f3f28692c883c8c3d325f68e58918d6d3 (diff)
downloadscummvm-rg350-9369d6b772f0a97ffca7639ba22fa07eee03549a.tar.gz
scummvm-rg350-9369d6b772f0a97ffca7639ba22fa07eee03549a.tar.bz2
scummvm-rg350-9369d6b772f0a97ffca7639ba22fa07eee03549a.zip
CINE: Turn some methods into const methods
svn-id: r44100
Diffstat (limited to 'engines')
-rw-r--r--engines/cine/pal.cpp6
-rw-r--r--engines/cine/pal.h6
2 files changed, 6 insertions, 6 deletions
diff --git a/engines/cine/pal.cpp b/engines/cine/pal.cpp
index 01a7c20d25..60c58ac27c 100644
--- a/engines/cine/pal.cpp
+++ b/engines/cine/pal.cpp
@@ -209,7 +209,7 @@ void Palette::setColorFormat(const Graphics::PixelFormat format) {
}
// a.k.a. transformPaletteRange
-Palette &Palette::saturatedAddColor(Palette& output, byte firstIndex, byte lastIndex, signed r, signed g, signed b) {
+Palette &Palette::saturatedAddColor(Palette& output, byte firstIndex, byte lastIndex, signed r, signed g, signed b) const {
assert(firstIndex < colorCount() && lastIndex < colorCount());
assert(firstIndex < output.colorCount() && lastIndex < output.colorCount());
assert(output.colorFormat() == colorFormat());
@@ -232,7 +232,7 @@ Palette &Palette::saturatedAddColor(Palette& output, byte firstIndex, byte lastI
return output;
}
-Palette &Palette::saturatedAddColor(Palette& output, byte firstIndex, byte lastIndex, signed rSource, signed gSource, signed bSource, const Graphics::PixelFormat &sourceFormat) {
+Palette &Palette::saturatedAddColor(Palette& output, byte firstIndex, byte lastIndex, signed rSource, signed gSource, signed bSource, const Graphics::PixelFormat &sourceFormat) const {
// Convert the source color to the internal color format ensuring that no divide by zero will happen
const signed r = ((signed) _format.rMax()) * rSource / MAX<int>(sourceFormat.rMax(), 1);
const signed g = ((signed) _format.gMax()) * gSource / MAX<int>(sourceFormat.gMax(), 1);
@@ -241,7 +241,7 @@ Palette &Palette::saturatedAddColor(Palette& output, byte firstIndex, byte lastI
return saturatedAddColor(output, firstIndex, lastIndex, r, g, b);
}
-Palette &Palette::saturatedAddNormalizedGray(Palette& output, byte firstIndex, byte lastIndex, int grayDividend, int grayDenominator) {
+Palette &Palette::saturatedAddNormalizedGray(Palette& output, byte firstIndex, byte lastIndex, int grayDividend, int grayDenominator) const {
assert(grayDenominator != 0);
const signed r = ((signed) _format.rMax()) * grayDividend / grayDenominator;
const signed g = ((signed) _format.gMax()) * grayDividend / grayDenominator;
diff --git a/engines/cine/pal.h b/engines/cine/pal.h
index 60d39a0eae..d0621b4d9f 100644
--- a/engines/cine/pal.h
+++ b/engines/cine/pal.h
@@ -132,7 +132,7 @@ public:
* \param rotationAmount Amount to rotate the sub-palette to the right. Only values 0 and 1 are currently supported!
*/
Palette &rotateRight(byte firstIndex, byte lastIndex, signed rotationAmount = 1);
- Palette &saturatedAddColor(Palette& output, byte firstIndex, byte lastIndex, signed r, signed g, signed b);
+ Palette &saturatedAddColor(Palette& output, byte firstIndex, byte lastIndex, signed r, signed g, signed b) const;
/*! \brief Saturated add an RGB color in given color format to current palette's subset and save the modified colors in the given output palette.
* \param output The output palette (Only this palette is modified)
@@ -145,7 +145,7 @@ public:
* \note This function basically converts the given color to the palette's internal color format
* and adds that using the normal saturatedAddColor-function.
*/
- Palette &saturatedAddColor(Palette& output, byte firstIndex, byte lastIndex, signed rSource, signed gSource, signed bSource, const Graphics::PixelFormat &sourceFormat);
+ Palette &saturatedAddColor(Palette& output, byte firstIndex, byte lastIndex, signed rSource, signed gSource, signed bSource, const Graphics::PixelFormat &sourceFormat) const;
/*! \brief Saturated add a normalized gray value to current palette's subset and save the modified colors in the given output palette.
* \param output The output palette (Only this palette is modified)
@@ -156,7 +156,7 @@ public:
* \note The normalized gray value (i.e. in range [-1, +1]) is given as a fractional number
* (i.e. the normalized gray value is calculated by dividing grayDividend by grayDenominator).
*/
- Palette &saturatedAddNormalizedGray(Palette& output, byte firstIndex, byte lastIndex, signed grayDividend, signed grayDenominator);
+ Palette &saturatedAddNormalizedGray(Palette& output, byte firstIndex, byte lastIndex, signed grayDividend, signed grayDenominator) const;
bool empty() const;
uint colorCount() const;