[Scummvm-cvs-logs] scummvm master -> 0eb68f6c97a7b0bba860bc7f6cbcfffeda9ef3ce

digitall dgturner at iee.org
Wed Dec 26 01:54:36 CET 2012


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:
0eb68f6c97 GRAPHICS: Add support for ILBM files containing uncompressed data.


Commit: 0eb68f6c97a7b0bba860bc7f6cbcfffeda9ef3ce
    https://github.com/scummvm/scummvm/commit/0eb68f6c97a7b0bba860bc7f6cbcfffeda9ef3ce
Author: D G Turner (digitall at scummvm.org)
Date: 2012-12-25T16:52:30-08:00

Commit Message:
GRAPHICS: Add support for ILBM files containing uncompressed data.

Thanks to Tomaz^ for this patch.

Changed paths:
    graphics/iff.cpp



diff --git a/graphics/iff.cpp b/graphics/iff.cpp
index 4011126..4a74b63 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;
 	}
 }






More information about the Scummvm-git-logs mailing list