diff options
author | Cameron Cawley | 2018-04-13 20:19:47 +0100 |
---|---|---|
committer | rsn8887 | 2018-04-15 08:05:24 -0500 |
commit | a7bc08992e2acd361c485179d2142bc9121cda65 (patch) | |
tree | 9285a88647986f4f8f455986c8871de5ec243dc5 /image/codecs/indeo | |
parent | a38e16b9638aa0d35ec42220ab6825e6925b23b2 (diff) | |
download | scummvm-rg350-a7bc08992e2acd361c485179d2142bc9121cda65.tar.gz scummvm-rg350-a7bc08992e2acd361c485179d2142bc9121cda65.tar.bz2 scummvm-rg350-a7bc08992e2acd361c485179d2142bc9121cda65.zip |
IMAGE: INDEO: Use the system pixel format for non-8bpp screen modes
Diffstat (limited to 'image/codecs/indeo')
-rw-r--r-- | image/codecs/indeo/indeo.cpp | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/image/codecs/indeo/indeo.cpp b/image/codecs/indeo/indeo.cpp index 4826137358..80b424fb90 100644 --- a/image/codecs/indeo/indeo.cpp +++ b/image/codecs/indeo/indeo.cpp @@ -465,22 +465,26 @@ IVI45DecContext::IVI45DecContext() : _gb(nullptr), _frameNum(0), _frameType(0), /*------------------------------------------------------------------------*/ IndeoDecoderBase::IndeoDecoderBase(uint16 width, uint16 height, uint bitsPerPixel) : Codec() { - switch (bitsPerPixel) { - case 15: - _pixelFormat = Graphics::PixelFormat(2, 5, 5, 5, 0, 0, 5, 10, 0); - break; - case 16: - _pixelFormat = Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0); - break; - case 24: - _pixelFormat = Graphics::PixelFormat(4, 8, 8, 8, 0, 16, 8, 0, 0); - break; - case 32: - _pixelFormat = Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0); - break; - default: - error("Invalid color depth"); - break; + _pixelFormat = g_system->getScreenFormat(); + + if (_pixelFormat.bytesPerPixel == 1) { + switch (bitsPerPixel) { + case 15: + _pixelFormat = Graphics::PixelFormat(2, 5, 5, 5, 0, 0, 5, 10, 0); + break; + case 16: + _pixelFormat = Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0); + break; + case 24: + _pixelFormat = Graphics::PixelFormat(4, 8, 8, 8, 0, 16, 8, 0, 0); + break; + case 32: + _pixelFormat = Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0); + break; + default: + error("Invalid color depth"); + break; + } } _surface.create(width, height, _pixelFormat); |