[Scummvm-cvs-logs] scummvm master -> b3bc35c62abb3a3b707409e2eac61ac2d2978d91

bluegr md5 at scummvm.org
Fri May 13 18:22:24 CEST 2011


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:
b3bc35c62a SWORD25: Added a version field for savegame thumbnails


Commit: b3bc35c62abb3a3b707409e2eac61ac2d2978d91
    https://github.com/scummvm/scummvm/commit/b3bc35c62abb3a3b707409e2eac61ac2d2978d91
Author: md5 (md5 at scummvm.org)
Date: 2011-05-13T09:19:58-07:00

Commit Message:
SWORD25: Added a version field for savegame thumbnails

Changed paths:
    engines/sword25/gfx/image/renderedimage.cpp
    engines/sword25/gfx/screenshot.cpp



diff --git a/engines/sword25/gfx/image/renderedimage.cpp b/engines/sword25/gfx/image/renderedimage.cpp
index 44d32f0..23bf262 100644
--- a/engines/sword25/gfx/image/renderedimage.cpp
+++ b/engines/sword25/gfx/image/renderedimage.cpp
@@ -105,6 +105,7 @@ static bool decodeThumbnail(const byte *pFileData, uint fileSize, byte *&pUncomp
 	const byte *src = pFileData + 4;	// skip header
 	width = READ_LE_UINT16(src); src += 2;
 	height = READ_LE_UINT16(src); src += 2;
+	src++;	// version, ignored for now
 	pitch = width * 4;
 
 	uint32 totalSize = pitch * height;
diff --git a/engines/sword25/gfx/screenshot.cpp b/engines/sword25/gfx/screenshot.cpp
index bfe732a..8306d9c 100644
--- a/engines/sword25/gfx/screenshot.cpp
+++ b/engines/sword25/gfx/screenshot.cpp
@@ -39,6 +39,8 @@
 
 namespace Sword25 {
 
+#define THUMBNAIL_VERSION 1
+
 bool Screenshot::saveToFile(Graphics::Surface *data, Common::WriteStream *stream) {
 	// Convert the RGBA data to RGB
 	const byte *pSrc = (const byte *)data->getBasePtr(0, 0);
@@ -47,6 +49,7 @@ bool Screenshot::saveToFile(Graphics::Surface *data, Common::WriteStream *stream
 	stream->writeUint32BE(MKTAG('S','C','R','N'));	// SCRN, short for "Screenshot"
 	stream->writeUint16LE(data->w);
 	stream->writeUint16LE(data->h);
+	stream->writeByte(THUMBNAIL_VERSION);
 
 	for (uint y = 0; y < data->h; y++) {
 		for (uint x = 0; x < data->w; x++) {






More information about the Scummvm-git-logs mailing list