mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 13:50:13 +00:00
SWORD25: Added a version field for savegame thumbnails
This commit is contained in:
parent
7543c3ba5f
commit
b3bc35c62a
@ -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;
|
||||
|
@ -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++) {
|
||||
|
Loading…
Reference in New Issue
Block a user