aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--graphics/iff.cpp5
-rw-r--r--graphics/iff.h2
2 files changed, 4 insertions, 3 deletions
diff --git a/graphics/iff.cpp b/graphics/iff.cpp
index eea051fe1e..395d8d803b 100644
--- a/graphics/iff.cpp
+++ b/graphics/iff.cpp
@@ -47,7 +47,7 @@ void ILBMDecoder::loadHeader(Common::ReadStream *stream) {
_header.load(stream);
}
-void ILBMDecoder::loadBitmap(uint32 mode, byte *buffer, Common::ReadStream *stream) {
+void ILBMDecoder::loadBitmap(uint32 mode, byte *buffer, Common::ReadStream *stream, uint32 outPitch) {
assert(stream);
uint32 numPlanes = MIN(mode & ILBM_UNPACK_PLANES, (uint32)_header.depth);
assert(numPlanes >= 1 && numPlanes <= 8 && numPlanes != 7);
@@ -57,7 +57,8 @@ void ILBMDecoder::loadBitmap(uint32 mode, byte *buffer, Common::ReadStream *stre
packPixels = false;
}
- uint32 outPitch = _header.width;
+ if (outPitch == 0)
+ outPitch = _header.width;
if (packPixels) {
outPitch /= (8 / numPlanes);
}
diff --git a/graphics/iff.h b/graphics/iff.h
index 4d88148372..651867fa52 100644
--- a/graphics/iff.h
+++ b/graphics/iff.h
@@ -89,7 +89,7 @@ struct ILBMDecoder {
* The caller controls how data should be packed by choosing mode from
* the enum above.
*/
- void loadBitmap(uint32 mode, byte *buffer, Common::ReadStream *stream);
+ void loadBitmap(uint32 mode, byte *buffer, Common::ReadStream *stream, uint32 outPitch = 0);
/**
* Converts from bitplanar to chunky representation. Intended for internal