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 --- backends/graphics/surfacesdl/surfacesdl-graphics.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'backends/graphics/surfacesdl') diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp index 3e9aa9faab..dd334f3814 100644 --- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp +++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp @@ -1476,7 +1476,11 @@ bool SurfaceSdlGraphicsManager::saveScreenshot(const char *filename) { return false; } +#ifdef SCUMM_LITTLE_ENDIAN + const Graphics::PixelFormat format(3, 8, 8, 8, 0, 0, 8, 16, 0); +#else const Graphics::PixelFormat format(3, 8, 8, 8, 0, 16, 8, 0, 0); +#endif Graphics::Surface data; data.init(rgbScreen->w, rgbScreen->h, rgbScreen->pitch, rgbScreen->pixels, format); const bool success = Image::writePNG(out, data); -- cgit v1.2.3