aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorD G Turner2012-12-26 02:54:18 +0000
committerD G Turner2012-12-26 02:54:18 +0000
commit0b72bd2dea0cfea13ab03dc74361aea7ac95c997 (patch)
treec7c4553da8655ca9e98a7233eaba2660073d6c51 /graphics
parentb65b196e565b0a22a6ba0fbbabfa3349f98cf051 (diff)
downloadscummvm-rg350-0b72bd2dea0cfea13ab03dc74361aea7ac95c997.tar.gz
scummvm-rg350-0b72bd2dea0cfea13ab03dc74361aea7ac95c997.tar.bz2
scummvm-rg350-0b72bd2dea0cfea13ab03dc74361aea7ac95c997.zip
GRAPHICS: Add ability to override outputPitch to ILBM decoder.
This allows loading an image into a buffer of a larger width. Thanks to Tomaz^ for this patch.
Diffstat (limited to 'graphics')
-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