From b3bc35c62abb3a3b707409e2eac61ac2d2978d91 Mon Sep 17 00:00:00 2001 From: md5 Date: Fri, 13 May 2011 19:19:58 +0300 Subject: SWORD25: Added a version field for savegame thumbnails --- engines/sword25/gfx/image/renderedimage.cpp | 1 + engines/sword25/gfx/screenshot.cpp | 3 +++ 2 files changed, 4 insertions(+) (limited to 'engines') diff --git a/engines/sword25/gfx/image/renderedimage.cpp b/engines/sword25/gfx/image/renderedimage.cpp index 44d32f03f7..23bf2623ad 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 bfe732a596..8306d9ce6f 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++) { -- cgit v1.2.3