aboutsummaryrefslogtreecommitdiff
path: root/image/codecs
diff options
context:
space:
mode:
Diffstat (limited to 'image/codecs')
-rw-r--r--image/codecs/codec.cpp2
-rw-r--r--image/codecs/indeo3.cpp17
-rw-r--r--image/codecs/indeo3.h2
3 files changed, 17 insertions, 4 deletions
diff --git a/image/codecs/codec.cpp b/image/codecs/codec.cpp
index 7d6d3cbe9b..048d52dc86 100644
--- a/image/codecs/codec.cpp
+++ b/image/codecs/codec.cpp
@@ -210,7 +210,7 @@ Codec *createBitmapCodec(uint32 tag, int width, int height, int bitsPerPixel) {
case MKTAG('c','v','i','d'):
return new CinepakDecoder(bitsPerPixel);
case MKTAG('I','V','3','2'):
- return new Indeo3Decoder(width, height);
+ return new Indeo3Decoder(width, height, bitsPerPixel);
case MKTAG('I', 'V', '4', '1'):
case MKTAG('I', 'V', '4', '2'):
return new Indeo4Decoder(width, height, bitsPerPixel);
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);
diff --git a/image/codecs/indeo3.h b/image/codecs/indeo3.h
index 0ff0265250..ad12bb7825 100644
--- a/image/codecs/indeo3.h
+++ b/image/codecs/indeo3.h
@@ -46,7 +46,7 @@ namespace Image {
*/
class Indeo3Decoder : public Codec {
public:
- Indeo3Decoder(uint16 width, uint16 height);
+ Indeo3Decoder(uint16 width, uint16 height, uint bitsPerPixel = 24);
~Indeo3Decoder();
const Graphics::Surface *decodeFrame(Common::SeekableReadStream &stream);