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/opengl/opengl-graphics.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'backends/graphics/opengl') diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp index ad6094b9a1..6eb961a9d4 100644 --- a/backends/graphics/opengl/opengl-graphics.cpp +++ b/backends/graphics/opengl/opengl-graphics.cpp @@ -1214,7 +1214,11 @@ bool OpenGLGraphicsManager::saveScreenshot(const Common::String &filename) const pixels.resize(lineSize * height); GL_CALL(glReadPixels(0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, &pixels.front())); +#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(width, height, lineSize, &pixels.front(), format); #ifdef USE_PNG -- cgit v1.2.3