diff options
Diffstat (limited to 'image/codecs/indeo3.cpp')
-rw-r--r-- | image/codecs/indeo3.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/image/codecs/indeo3.cpp b/image/codecs/indeo3.cpp index 560658d1f5..d862d5352b 100644 --- a/image/codecs/indeo3.cpp +++ b/image/codecs/indeo3.cpp @@ -40,11 +40,24 @@ namespace Image { -Indeo3Decoder::Indeo3Decoder(uint16 width, uint16 height) : _ModPred(0), _corrector_type(0) { +Indeo3Decoder::Indeo3Decoder(uint16 width, uint16 height, uint bitsPerPixel) : _ModPred(0), _corrector_type(0) { _iv_frame[0].the_buf = 0; _iv_frame[1].the_buf = 0; - _pixelFormat = g_system->getScreenFormat(); + switch (bitsPerPixel) { + 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 = new Graphics::Surface; _surface->create(width, height, _pixelFormat); |