diff options
author | Filippos Karapetis | 2014-12-24 22:40:54 +0200 |
---|---|---|
committer | Filippos Karapetis | 2014-12-24 22:56:55 +0200 |
commit | e8e21fabe4dbe4effdfb3df05fd3fae75940f1c5 (patch) | |
tree | 7e135df3450bd88d6a792acfc758f5ed3150822a /engines/zvision/video/rlf_decoder.cpp | |
parent | 84341a889cfafc4c7ecef6cf7d6841df8353fe4b (diff) | |
download | scummvm-rg350-e8e21fabe4dbe4effdfb3df05fd3fae75940f1c5.tar.gz scummvm-rg350-e8e21fabe4dbe4effdfb3df05fd3fae75940f1c5.tar.bz2 scummvm-rg350-e8e21fabe4dbe4effdfb3df05fd3fae75940f1c5.zip |
ZVISION: Set all the internal graphics operations to use RGB555 (1/2)
This is the first part of the changes to make the engine use RGB555
internally again. This is done to simplify the rendering pipeline -
the engine will use RGB555 internally, but will output to RGB565.
The overall changes have been broken into two commits, thus this
first commit will break all the game colors
Diffstat (limited to 'engines/zvision/video/rlf_decoder.cpp')
-rw-r--r-- | engines/zvision/video/rlf_decoder.cpp | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/engines/zvision/video/rlf_decoder.cpp b/engines/zvision/video/rlf_decoder.cpp index f1ac10bf88..260f912ade 100644 --- a/engines/zvision/video/rlf_decoder.cpp +++ b/engines/zvision/video/rlf_decoder.cpp @@ -64,7 +64,7 @@ RLFDecoder::RLFVideoTrack::RLFVideoTrack(Common::SeekableReadStream *stream) return; } - _currentFrameBuffer.create(_width, _height, Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0)); + _currentFrameBuffer.create(_width, _height, getPixelFormat()); _frameBufferByteSize = _width * _height * sizeof(uint16); _frames = new Frame[_frameCount]; @@ -239,12 +239,7 @@ void RLFDecoder::RLFVideoTrack::decodeMaskedRunLengthEncoding(int8 *source, int8 return; } - byte 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); + WRITE_UINT16(dest + destOffset, READ_LE_UINT16(source + sourceOffset)); sourceOffset += 2; destOffset += 2; @@ -288,12 +283,7 @@ void RLFDecoder::RLFVideoTrack::decodeSimpleRunLengthEncoding(int8 *source, int8 return; } - byte 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); + WRITE_UINT16(dest + destOffset, READ_LE_UINT16(source + sourceOffset)); sourceOffset += 2; destOffset += 2; @@ -307,11 +297,7 @@ void RLFDecoder::RLFVideoTrack::decodeSimpleRunLengthEncoding(int8 *source, int8 return; } - byte 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); + uint16 sampleColor = READ_LE_UINT16(source + sourceOffset); sourceOffset += 2; numberOfCopy = numberOfSamples + 2; |