[Scummvm-cvs-logs] SF.net SVN: scummvm:[39339] scummvm/trunk/engines/cine
buddha_ at users.sourceforge.net
buddha_ at users.sourceforge.net
Wed Mar 11 22:11:52 CET 2009
Revision: 39339
http://scummvm.svn.sourceforge.net/scummvm/?rev=39339&view=rev
Author: buddha_
Date: 2009-03-11 21:11:52 +0000 (Wed, 11 Mar 2009)
Log Message:
-----------
Cine::Palette: Move color format setting to setColorFormat-method.
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-03-11 21:05:21 UTC (rev 39338)
+++ scummvm/trunk/engines/cine/pal.cpp 2009-03-11 21:11:52 UTC (rev 39339)
@@ -184,6 +184,18 @@
return _format;
}
+void Palette::setColorFormat(const Graphics::PixelFormat format) {
+ _format = format;
+
+ _rBits = (8 - format.rLoss);
+ _gBits = (8 - format.gLoss);
+ _bBits = (8 - format.bLoss);
+
+ _rMax = (1 << _rBits) - 1;
+ _gMax = (1 << _gBits) - 1;
+ _bMax = (1 << _bBits) - 1;
+}
+
// a.k.a. transformPaletteRange
Palette &Palette::saturatedAddColor(byte firstIndex, byte lastIndex, signed r, signed g, signed b) {
assert(firstIndex < colorCount() && lastIndex < colorCount());
@@ -218,16 +230,8 @@
assert(format.gShift / 8 == (format.gShift + MAX<int>(0, 8 - format.gLoss - 1)) / 8); // G must be inside one byte
assert(format.bShift / 8 == (format.bShift + MAX<int>(0, 8 - format.bLoss - 1)) / 8); // B must be inside one byte
- _format = format;
+ setColorFormat(format);
- _rBits = (8 - format.rLoss);
- _gBits = (8 - format.gLoss);
- _bBits = (8 - format.bLoss);
-
- _rMax = (1 << _rBits) - 1;
- _gMax = (1 << _gBits) - 1;
- _bMax = (1 << _bBits) - 1;
-
_colors.clear();
_colors.resize(numColors);
Modified: scummvm/trunk/engines/cine/pal.h
===================================================================
--- scummvm/trunk/engines/cine/pal.h 2009-03-11 21:05:21 UTC (rev 39338)
+++ scummvm/trunk/engines/cine/pal.h 2009-03-11 21:11:52 UTC (rev 39339)
@@ -70,6 +70,7 @@
Graphics::PixelFormat colorFormat() const;
private:
+ void setColorFormat(const Graphics::PixelFormat format);
void saturatedAddColor(byte index, signed r, signed g, signed b);
private:
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