diff options
| author | RichieSams | 2013-10-01 17:44:29 -0500 | 
|---|---|---|
| committer | RichieSams | 2013-10-02 09:09:54 -0500 | 
| commit | 4172334b51a33c0b68ad81ceba2aaf1a6e70d8f2 (patch) | |
| tree | 774a3dcaa540ec0e439979084b9ff2ed4396e8e2 | |
| parent | ffaffa2bc4163fcc72c40416ba713076ba9e8a01 (diff) | |
| download | scummvm-rg350-4172334b51a33c0b68ad81ceba2aaf1a6e70d8f2.tar.gz scummvm-rg350-4172334b51a33c0b68ad81ceba2aaf1a6e70d8f2.tar.bz2 scummvm-rg350-4172334b51a33c0b68ad81ceba2aaf1a6e70d8f2.zip  | |
ZVISION: Remove global const variables
Instead, use ColorMasks
| -rw-r--r-- | engines/zvision/rlf_animation.cpp | 19 | ||||
| -rw-r--r-- | engines/zvision/rlf_animation.h | 3 | 
2 files changed, 9 insertions, 13 deletions
diff --git a/engines/zvision/rlf_animation.cpp b/engines/zvision/rlf_animation.cpp index d932fa7698..008a246267 100644 --- a/engines/zvision/rlf_animation.cpp +++ b/engines/zvision/rlf_animation.cpp @@ -28,14 +28,13 @@  #include "common/debug.h"  #include "common/endian.h" +#include "graphics/colormasks.h" +  #include "zvision/rlf_animation.h"  namespace ZVision { -const Graphics::PixelFormat RlfAnimation::_pixelFormat555 = Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0); -const Graphics::PixelFormat RlfAnimation::_pixelFormat565 = Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0); -  RlfAnimation::RlfAnimation(const Common::String &fileName, bool stream)   		: _stream(stream),  		  _lastFrameRead(0), @@ -56,7 +55,7 @@ RlfAnimation::RlfAnimation(const Common::String &fileName, bool stream)  		return;  	} -	_currentFrameBuffer.create(_width, _height, _pixelFormat565); +	_currentFrameBuffer.create(_width, _height, Graphics::createPixelFormat<565>());  	_frameBufferByteSize = _width * _height * sizeof(uint16);  	if (!stream) { @@ -247,8 +246,8 @@ void RlfAnimation::decodeMaskedRunLengthEncoding(int8 *source, int8 *dest, uint3  				}  				byte r, g, b; -				_pixelFormat555.colorToRGB(READ_LE_UINT16(source + sourceOffset), r, g, b); -				uint16 destColor = _pixelFormat565.RGBToColor(r, g, b); +				Graphics::colorToRGB<Graphics::ColorMasks<555>>(READ_LE_UINT16(source + sourceOffset), r, g, b); +				uint16 destColor = Graphics::RGBToColor<Graphics::ColorMasks<565>>(r, g, b);  				WRITE_UINT16(dest + destOffset, destColor);  				sourceOffset += 2; @@ -293,8 +292,8 @@ void RlfAnimation::decodeSimpleRunLengthEncoding(int8 *source, int8 *dest, uint3  				}  				byte r, g, b; -				_pixelFormat555.colorToRGB(READ_LE_UINT16(source + sourceOffset), r, g, b); -				uint16 destColor = _pixelFormat565.RGBToColor(r, g, b); +				Graphics::colorToRGB<Graphics::ColorMasks<555>>(READ_LE_UINT16(source + sourceOffset), r, g, b); +				uint16 destColor = Graphics::RGBToColor<Graphics::ColorMasks<565>>(r, g, b);  				WRITE_UINT16(dest + destOffset, destColor);  				sourceOffset += 2; @@ -310,8 +309,8 @@ void RlfAnimation::decodeSimpleRunLengthEncoding(int8 *source, int8 *dest, uint3  			}  			byte r, g, b; -			_pixelFormat555.colorToRGB(READ_LE_UINT16(source + sourceOffset), r, g, b); -			uint16 sampleColor = _pixelFormat565.RGBToColor(r, g, b); +			Graphics::colorToRGB<Graphics::ColorMasks<555>>(READ_LE_UINT16(source + sourceOffset), r, g, b); +			uint16 sampleColor = Graphics::RGBToColor<Graphics::ColorMasks<565>>(r, g, b);  			sourceOffset += 2;  			numberOfSamples += 2; diff --git a/engines/zvision/rlf_animation.h b/engines/zvision/rlf_animation.h index 3f205d9666..ca9004f8b6 100644 --- a/engines/zvision/rlf_animation.h +++ b/engines/zvision/rlf_animation.h @@ -52,9 +52,6 @@ private:  		uint32 encodedSize;  	}; -	const static Graphics::PixelFormat _pixelFormat555; -	const static Graphics::PixelFormat _pixelFormat565; -  private:  	Common::File _file;  	bool _stream;  | 
