From 205df5dbdfc75d051d1d74e997dbd88208cbbdf1 Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Fri, 1 Mar 2019 18:43:17 +0000 Subject: IMAGE: Fix taking screenshots on big endian systems --- image/png.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'image/png.cpp') diff --git a/image/png.cpp b/image/png.cpp index 86d33b6952..50a53b0a46 100644 --- a/image/png.cpp +++ b/image/png.cpp @@ -244,8 +244,13 @@ bool PNGDecoder::loadStream(Common::SeekableReadStream &stream) { bool writePNG(Common::WriteStream &out, const Graphics::Surface &input, const bool bottomUp) { #ifdef USE_PNG - const Graphics::PixelFormat requiredFormat_3byte(3, 8, 8, 8, 0, 16, 8, 0, 0); +#ifdef SCUMM_LITTLE_ENDIAN + const Graphics::PixelFormat requiredFormat_3byte(3, 8, 8, 8, 0, 0, 8, 16, 0); const Graphics::PixelFormat requiredFormat_4byte(4, 8, 8, 8, 8, 0, 8, 16, 24); +#else + const Graphics::PixelFormat requiredFormat_3byte(3, 8, 8, 8, 0, 16, 8, 0, 0); + const Graphics::PixelFormat requiredFormat_4byte(4, 8, 8, 8, 8, 24, 16, 8, 0); +#endif if (input.format.bytesPerPixel == 3) { if (input.format != requiredFormat_3byte) { -- cgit v1.2.3