[Scummvm-cvs-logs] scummvm master -> 3cca918ec745418bad4081b38211f82d47e1091e

m-kiewitz m_kiewitz at users.sourceforge.net
Fri Jun 12 13:25:11 CEST 2015


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:
3cca918ec7 SHERLOCK: 3DO: fix multiple frame decoding


Commit: 3cca918ec745418bad4081b38211f82d47e1091e
    https://github.com/scummvm/scummvm/commit/3cca918ec745418bad4081b38211f82d47e1091e
Author: Martin Kiewitz (m_kiewitz at users.sourceforge.net)
Date: 2015-06-12T13:25:08+02:00

Commit Message:
SHERLOCK: 3DO: fix multiple frame decoding

when multiple frames were decoded, all but the last one were
free()d

Changed paths:
    engines/sherlock/image_file.cpp
    engines/sherlock/scene.cpp



diff --git a/engines/sherlock/image_file.cpp b/engines/sherlock/image_file.cpp
index 265be52..d47f2c5 100644
--- a/engines/sherlock/image_file.cpp
+++ b/engines/sherlock/image_file.cpp
@@ -354,8 +354,6 @@ void ImageFile3DO::load3DOCelFile(Common::SeekableReadStream &stream) {
 	uint32 chunkSize = 0;
 	byte  *chunkDataPtr = NULL;
 
-	ImageFrame imageFrame;
-
 	// ANIM chunk (animation header for animation files)
 	bool   animFound = false;
 	uint32 animVersion = 0;
@@ -477,7 +475,7 @@ void ImageFile3DO::load3DOCelFile(Common::SeekableReadStream &stream) {
 			// Unknown contents, occurs right before PDAT
 			break;
 
-		case MKTAG('P', 'D', 'A', 'T'):
+		case MKTAG('P', 'D', 'A', 'T'): {
 			// pixel data for one frame
 			// may be compressed or uncompressed pixels
 
@@ -496,6 +494,8 @@ void ImageFile3DO::load3DOCelFile(Common::SeekableReadStream &stream) {
 			stream.read(chunkDataPtr, dataSize);
 
 			// Set up frame
+			ImageFrame imageFrame;
+
 			imageFrame._width = ccbWidth;
 			imageFrame._height = ccbHeight;
 			imageFrame._paletteBase = 0;
@@ -515,6 +515,7 @@ void ImageFile3DO::load3DOCelFile(Common::SeekableReadStream &stream) {
 
 			push_back(imageFrame);
 			break;
+		}
 
 		case MKTAG('O', 'F', 'S', 'T'): // 3DOSplash.cel
 			// unknown contents
@@ -534,8 +535,6 @@ void ImageFile3DO::load3DOCelRoomData(Common::SeekableReadStream &stream) {
 	int    streamSize = stream.size();
 	uint16 roomDataHeader_size = 0;
 
-	ImageFrame imageFrame;
-
 	// CCB chunk (cel control block)
 	uint32 ccbFlags = 0;
 	bool   ccbFlags_compressed = false;
@@ -551,8 +550,6 @@ void ImageFile3DO::load3DOCelRoomData(Common::SeekableReadStream &stream) {
 	byte  *celDataPtr = NULL;
 
 	while (stream.pos() < streamSize) {
-		ImageFrame frame;
-
 		// 3DO sherlock holmes room data header
 		stream.skip(4); // Possibly UINT16 width, UINT16 height?!?!
 		roomDataHeader_size = stream.readUint16BE();
@@ -593,20 +590,24 @@ void ImageFile3DO::load3DOCelRoomData(Common::SeekableReadStream &stream) {
 		stream.read(celDataPtr, celDataSize);
 		
 		// Set up frame
-		imageFrame._width = ccbWidth;
-		imageFrame._height = ccbHeight;
-		imageFrame._paletteBase = 0;
-		imageFrame._offset.x = 0;
-		imageFrame._offset.y = 0;
-		imageFrame._rleEncoded = ccbFlags_compressed;
-		imageFrame._size = 0;
+		{
+			ImageFrame imageFrame;
 
-		// Decompress/copy this frame
-		decompress3DOCelFrame(imageFrame, celDataPtr, celDataSize, ccbPRE0_bitsPerPixel, NULL);
+			imageFrame._width = ccbWidth;
+			imageFrame._height = ccbHeight;
+			imageFrame._paletteBase = 0;
+			imageFrame._offset.x = 0;
+			imageFrame._offset.y = 0;
+			imageFrame._rleEncoded = ccbFlags_compressed;
+			imageFrame._size = 0;
 
-		delete[] celDataPtr;
+			// Decompress/copy this frame
+			decompress3DOCelFrame(imageFrame, celDataPtr, celDataSize, ccbPRE0_bitsPerPixel, NULL);
+
+			delete[] celDataPtr;
 
-		push_back(imageFrame);
+			push_back(imageFrame);
+		}
 	}
 }
 
diff --git a/engines/sherlock/scene.cpp b/engines/sherlock/scene.cpp
index 385c751..609fd17 100644
--- a/engines/sherlock/scene.cpp
+++ b/engines/sherlock/scene.cpp
@@ -668,7 +668,6 @@ bool Scene::loadScene(const Common::String &filename) {
 
 		// === BGSHAPES === Set up the bgShapes
 		for (int idx = 0; idx < header3DO_numStructs; ++idx) {
-			warning("%d", _bgShapes[idx]._misc);
 			_bgShapes[idx]._images = _images[_bgShapes[idx]._misc]._images;
 			_bgShapes[idx]._imageFrame = !_bgShapes[idx]._images ? (ImageFrame *)nullptr :
 				&(*_bgShapes[idx]._images)[0];






More information about the Scummvm-git-logs mailing list