IMAGE: INDEO: Use the system pixel format for non-8bpp screen modes

This commit is contained in:
Cameron Cawley 2018-04-13 20:19:47 +01:00 committed by rsn8887
parent a38e16b963
commit a7bc08992e
2 changed files with 40 additions and 32 deletions

View file

@ -465,6 +465,9 @@ IVI45DecContext::IVI45DecContext() : _gb(nullptr), _frameNum(0), _frameType(0),
/*------------------------------------------------------------------------*/
IndeoDecoderBase::IndeoDecoderBase(uint16 width, uint16 height, uint bitsPerPixel) : Codec() {
_pixelFormat = g_system->getScreenFormat();
if (_pixelFormat.bytesPerPixel == 1) {
switch (bitsPerPixel) {
case 15:
_pixelFormat = Graphics::PixelFormat(2, 5, 5, 5, 0, 0, 5, 10, 0);
@ -482,6 +485,7 @@ IndeoDecoderBase::IndeoDecoderBase(uint16 width, uint16 height, uint bitsPerPixe
error("Invalid color depth");
break;
}
}
_surface.create(width, height, _pixelFormat);
_surface.fillRect(Common::Rect(0, 0, width, height), (bitsPerPixel == 32) ? 0xff : 0);

View file

@ -44,6 +44,9 @@ Indeo3Decoder::Indeo3Decoder(uint16 width, uint16 height, uint bitsPerPixel) : _
_iv_frame[0].the_buf = 0;
_iv_frame[1].the_buf = 0;
_pixelFormat = g_system->getScreenFormat();
if (_pixelFormat.bytesPerPixel == 1) {
switch (bitsPerPixel) {
case 15:
_pixelFormat = Graphics::PixelFormat(2, 5, 5, 5, 0, 0, 5, 10, 0);
@ -61,6 +64,7 @@ Indeo3Decoder::Indeo3Decoder(uint16 width, uint16 height, uint bitsPerPixel) : _
error("Invalid color depth");
break;
}
}
_surface = new Graphics::Surface;
_surface->create(width, height, _pixelFormat);