diff options
author | Filippos Karapetis | 2014-12-23 00:07:17 +0200 |
---|---|---|
committer | Filippos Karapetis | 2014-12-23 00:07:45 +0200 |
commit | fb924089fc5f6968f5c86fc780131f67268e8de6 (patch) | |
tree | 172170205e09bc77e66ce36eed7410d1f5a11f2f /engines/zvision | |
parent | 3f36cc94e45d32dc4784c16ec91b6fc44dbf0ff7 (diff) | |
download | scummvm-rg350-fb924089fc5f6968f5c86fc780131f67268e8de6.tar.gz scummvm-rg350-fb924089fc5f6968f5c86fc780131f67268e8de6.tar.bz2 scummvm-rg350-fb924089fc5f6968f5c86fc780131f67268e8de6.zip |
ZVISION: Avoid using color masks for in-game animations
This fixes the transparency for some in-game animations. Since colors
can be truncated with color masks, and since accurate colors are
required for transparency, color masks can't be used. This fixes the
transparency of the in-game item examination interface in ZGI
Diffstat (limited to 'engines/zvision')
-rw-r--r-- | engines/zvision/video/rlf_decoder.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/engines/zvision/video/rlf_decoder.cpp b/engines/zvision/video/rlf_decoder.cpp index bdb5dc18bc..d51dee0c6a 100644 --- a/engines/zvision/video/rlf_decoder.cpp +++ b/engines/zvision/video/rlf_decoder.cpp @@ -30,8 +30,6 @@ #include "common/debug.h" #include "common/endian.h" -#include "graphics/colormasks.h" - namespace ZVision { RLFDecoder::~RLFDecoder() { @@ -62,7 +60,7 @@ RLFDecoder::RLFVideoTrack::RLFVideoTrack(Common::SeekableReadStream *stream) return; } - _currentFrameBuffer.create(_width, _height, Graphics::createPixelFormat<565>()); + _currentFrameBuffer.create(_width, _height, Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0)); _frameBufferByteSize = _width * _height * sizeof(uint16); _frames = new Frame[_frameCount]; @@ -243,8 +241,10 @@ void RLFDecoder::RLFVideoTrack::decodeMaskedRunLengthEncoding(int8 *source, int8 } byte 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); + // NOTE: Color masks can't be used here, since accurate colors + // are required to handle transparency correctly + Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0).colorToRGB(READ_LE_UINT16(source + sourceOffset), r, g, b); + uint16 destColor = Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0).RGBToColor(r, g, b); WRITE_UINT16(dest + destOffset, destColor); sourceOffset += 2; @@ -290,8 +290,10 @@ void RLFDecoder::RLFVideoTrack::decodeSimpleRunLengthEncoding(int8 *source, int8 } byte 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); + // NOTE: Color masks can't be used here, since accurate colors + // are required to handle transparency correctly + Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0).colorToRGB(READ_LE_UINT16(source + sourceOffset), r, g, b); + uint16 destColor = Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0).RGBToColor(r, g, b); WRITE_UINT16(dest + destOffset, destColor); sourceOffset += 2; @@ -307,8 +309,10 @@ void RLFDecoder::RLFVideoTrack::decodeSimpleRunLengthEncoding(int8 *source, int8 } byte 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); + // NOTE: Color masks can't be used here, since accurate colors + // are required to handle transparency correctly + Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0).colorToRGB(READ_LE_UINT16(source + sourceOffset), r, g, b); + uint16 sampleColor = Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0).RGBToColor(r, g, b); sourceOffset += 2; numberOfCopy = numberOfSamples + 2; |