From f1a7ec711772d5582fc06c7f8209b406e5fb3717 Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Mon, 23 May 2011 12:12:26 +0200 Subject: SWORD25: Fix screenshot endianism issue --- engines/sword25/gfx/screenshot.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engines/sword25/gfx/screenshot.cpp') diff --git a/engines/sword25/gfx/screenshot.cpp b/engines/sword25/gfx/screenshot.cpp index 8306d9ce6f..11b79020fd 100644 --- a/engines/sword25/gfx/screenshot.cpp +++ b/engines/sword25/gfx/screenshot.cpp @@ -53,6 +53,8 @@ bool Screenshot::saveToFile(Graphics::Surface *data, Common::WriteStream *stream for (uint y = 0; y < data->h; y++) { for (uint x = 0; x < data->w; x++) { + // This is only called by createThumbnail below, which + // provides a fake 'surface' with LE data in it. uint32 srcPixel = READ_LE_UINT32(pSrc); pSrc += sizeof(uint32); stream->writeByte((srcPixel >> 16) & 0xff); // R @@ -93,7 +95,7 @@ Common::SeekableReadStream *Screenshot::createThumbnail(Graphics::Surface *data) for (int j = 0; j < 4; ++j) { const uint32 *srcP = (const uint32 *)data->getBasePtr(x * 4, y * 4 + j + 50); for (int i = 0; i < 4; ++i) { - uint32 pixel = READ_LE_UINT32(srcP + i); + uint32 pixel = READ_UINT32(srcP + i); alpha += (pixel >> 24); red += (pixel >> 16) & 0xff; green += (pixel >> 8) & 0xff; -- cgit v1.2.3