[Scummvm-git-logs] scummvm master -> a7bc08992e2acd361c485179d2142bc9121cda65
rsn8887
rsn8887 at users.noreply.github.com
Sun Apr 15 15:06:19 CEST 2018
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
a7bc08992e IMAGE: INDEO: Use the system pixel format for non-8bpp screen modes
Commit: a7bc08992e2acd361c485179d2142bc9121cda65
https://github.com/scummvm/scummvm/commit/a7bc08992e2acd361c485179d2142bc9121cda65
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2018-04-15T08:05:24-05:00
Commit Message:
IMAGE: INDEO: Use the system pixel format for non-8bpp screen modes
Changed paths:
image/codecs/indeo/indeo.cpp
image/codecs/indeo3.cpp
diff --git a/image/codecs/indeo/indeo.cpp b/image/codecs/indeo/indeo.cpp
index 4826137..80b424f 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);
diff --git a/image/codecs/indeo3.cpp b/image/codecs/indeo3.cpp
index 1aa1ef7..2b681c9 100644
--- a/image/codecs/indeo3.cpp
+++ b/image/codecs/indeo3.cpp
@@ -44,22 +44,26 @@ Indeo3Decoder::Indeo3Decoder(uint16 width, uint16 height, uint bitsPerPixel) : _
_iv_frame[0].the_buf = 0;
_iv_frame[1].the_buf = 0;
- 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 = new Graphics::Surface;
More information about the Scummvm-git-logs
mailing list