[Scummvm-cvs-logs] scummvm master -> 070558c4c46d6be8898d77d9b2167d44a33f5a0f

peres peres at scummvm.org
Sat Oct 26 16:27:08 CEST 2013


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
69be9adf52 Revert "GRAPHICS: do not clear the internal state of IFFDecoder on loadStream()."
070558c4c4 GRAPHICS: do not reset the extra parameters of IFFDecoder on destroy().


Commit: 69be9adf52b643188c2a2e37aa7e4d79ecf2eae1
    https://github.com/scummvm/scummvm/commit/69be9adf52b643188c2a2e37aa7e4d79ecf2eae1
Author: peres (peres at scummvm.org)
Date: 2013-10-26T07:26:22-07:00

Commit Message:
Revert "GRAPHICS: do not clear the internal state of IFFDecoder on loadStream()."

This reverts commit 92c1ff31d6d8d78e58caa4d123ceb0fea43a48ed.

Changed paths:
    graphics/decoders/iff.cpp



diff --git a/graphics/decoders/iff.cpp b/graphics/decoders/iff.cpp
index 485b284..7b37969 100644
--- a/graphics/decoders/iff.cpp
+++ b/graphics/decoders/iff.cpp
@@ -59,8 +59,7 @@ void IFFDecoder::destroy() {
 }
 
 bool IFFDecoder::loadStream(Common::SeekableReadStream &stream) {
-	// NOTE: we cannot call destroy() here, like most other decoders do, otherwise the 
-	// settings (stored in _numRelevantPlanes and _pixelPacking) will be cleared.
+	destroy();
 
 	const uint32 form = stream.readUint32BE();
 


Commit: 070558c4c46d6be8898d77d9b2167d44a33f5a0f
    https://github.com/scummvm/scummvm/commit/070558c4c46d6be8898d77d9b2167d44a33f5a0f
Author: peres (peres at scummvm.org)
Date: 2013-10-26T07:26:22-07:00

Commit Message:
GRAPHICS: do not reset the extra parameters of IFFDecoder on destroy().

The two properties that control pixel packing and the size of the
surface need to be preserved for loadStream() to work correctly.
They are now under complete responsibility of the client.

Changed paths:
    graphics/decoders/iff.cpp
    graphics/decoders/iff.h



diff --git a/graphics/decoders/iff.cpp b/graphics/decoders/iff.cpp
index 7b37969..fe27258 100644
--- a/graphics/decoders/iff.cpp
+++ b/graphics/decoders/iff.cpp
@@ -30,6 +30,10 @@ namespace Graphics {
 IFFDecoder::IFFDecoder() {
 	_surface = 0;
 	_palette = 0;
+	
+	// these 2 properties are not reset by destroy(), so the default is set here.
+	_numRelevantPlanes = 8;
+	_pixelPacking = false;
 
 	destroy();
 }
@@ -54,8 +58,6 @@ void IFFDecoder::destroy() {
 	_paletteRanges.clear();
 	_type = TYPE_UNKNOWN;
 	_paletteColorCount = 0;
-	_numRelevantPlanes = 8;
-	_pixelPacking = false;
 }
 
 bool IFFDecoder::loadStream(Common::SeekableReadStream &stream) {
diff --git a/graphics/decoders/iff.h b/graphics/decoders/iff.h
index beac62e..37cb4b3 100644
--- a/graphics/decoders/iff.h
+++ b/graphics/decoders/iff.h
@@ -85,6 +85,8 @@ public:
 	/**
 	* The number of planes to decode, also determines the pixel packing if _packPixels is true.
 	* 8 == decode all planes, map 1 pixel in 1 byte. (default, no packing even if _packPixels is true)
+	*
+	* NOTE: this property must be reset manually, and is not reset by a call to destroy().
 	*/
 	void setNumRelevantPlanes(const uint8 numRelevantPlanes) { _numRelevantPlanes = numRelevantPlanes; }
 
@@ -94,6 +96,8 @@ public:
 	* 2 == decode first 2 planes, pack 4 pixels in 1 byte. This makes _surface->w 1/4th of _header.width
 	* 4 == decode first 4 planes, pack 2 pixels in 1 byte. This makes _surface->w half of _header.width
 	* Packed bitmaps won't have a proper surface format since there is no way to tell it to use 1, 2 or 4 bits per pixel
+	*
+	* NOTE: this property must be reset manually, and is not reset by a call to destroy().
 	*/
 	void setPixelPacking(const bool pixelPacking) { _pixelPacking = pixelPacking; }
 private:






More information about the Scummvm-git-logs mailing list