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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Tue Sep 15 10:51:16 CEST 2009


Revision: 44100
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44100&view=rev
Author:   fingolfin
Date:     2009-09-15 08:51:16 +0000 (Tue, 15 Sep 2009)

Log Message:
-----------
CINE: Turn some methods into const methods

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-09-15 07:59:48 UTC (rev 44099)
+++ scummvm/trunk/engines/cine/pal.cpp	2009-09-15 08:51:16 UTC (rev 44100)
@@ -209,7 +209,7 @@
 }
 
 // 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 @@
 	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 @@
 	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;

Modified: scummvm/trunk/engines/cine/pal.h
===================================================================
--- scummvm/trunk/engines/cine/pal.h	2009-09-15 07:59:48 UTC (rev 44099)
+++ scummvm/trunk/engines/cine/pal.h	2009-09-15 08:51:16 UTC (rev 44100)
@@ -132,7 +132,7 @@
 	 * \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 @@
 	 * \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 @@
 	 * \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;


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