diff options
author | D G Turner | 2012-12-26 00:52:30 +0000 |
---|---|---|
committer | D G Turner | 2012-12-26 00:52:30 +0000 |
commit | 0eb68f6c97a7b0bba860bc7f6cbcfffeda9ef3ce (patch) | |
tree | d2197015735c6cb88cd8d6a5fd6395bd8c4fd580 /graphics | |
parent | d9e555afd5932c458f559034c6dca1df346ead4b (diff) | |
download | scummvm-rg350-0eb68f6c97a7b0bba860bc7f6cbcfffeda9ef3ce.tar.gz scummvm-rg350-0eb68f6c97a7b0bba860bc7f6cbcfffeda9ef3ce.tar.bz2 scummvm-rg350-0eb68f6c97a7b0bba860bc7f6cbcfffeda9ef3ce.zip |
GRAPHICS: Add support for ILBM files containing uncompressed data.
Thanks to Tomaz^ for this patch.
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/iff.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/graphics/iff.cpp b/graphics/iff.cpp index 4011126bd3..4a74b63693 100644 --- a/graphics/iff.cpp +++ b/graphics/iff.cpp @@ -64,6 +64,26 @@ void ILBMDecoder::loadBitmap(uint32 mode, byte *buffer, Common::ReadStream *stre byte *out = buffer; switch (_header.pack) { + case 0: { // non-compressed bitmap + // setup a buffer to hold enough data to build a line in the output + uint32 scanlineWidth = ((_header.width + 15) / 16) << 1; + byte *scanline = new byte[scanlineWidth * _header.depth]; + + for (uint i = 0; i < _header.height; ++i) { + byte *s = scanline; + for (uint32 j = 0; j < _header.depth; ++j) { + stream->read(s, scanlineWidth); + s += scanlineWidth; + } + + planarToChunky(out, outPitch, scanline, scanlineWidth, numPlanes, packPixels); + out += outPitch; + } + + delete[] scanline; + break; + } + case 1: { // PackBits compressed bitmap Graphics::PackBitsReadStream packStream(*stream); @@ -88,7 +108,7 @@ void ILBMDecoder::loadBitmap(uint32 mode, byte *buffer, Common::ReadStream *stre default: // implement other compression types here! - error("only RLE compressed ILBM files are supported"); + error("only uncompressed and RLE compressed ILBM files are supported"); break; } } |