[Scummvm-cvs-logs] scummvm master -> 0b72bd2dea0cfea13ab03dc74361aea7ac95c997
digitall
dgturner at iee.org
Wed Dec 26 04:00:23 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:
0b72bd2dea GRAPHICS: Add ability to override outputPitch to ILBM decoder.
Commit: 0b72bd2dea0cfea13ab03dc74361aea7ac95c997
https://github.com/scummvm/scummvm/commit/0b72bd2dea0cfea13ab03dc74361aea7ac95c997
Author: D G Turner (digitall at scummvm.org)
Date: 2012-12-25T18:54:18-08:00
Commit Message:
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.
Changed paths:
graphics/iff.cpp
graphics/iff.h
diff --git a/graphics/iff.cpp b/graphics/iff.cpp
index eea051f..395d8d8 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 4d88148..651867f 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
More information about the Scummvm-git-logs
mailing list