aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics/surfacesdl
diff options
context:
space:
mode:
authorCameron Cawley2019-03-01 18:43:17 +0000
committerBastien Bouclet2019-03-02 07:29:22 +0100
commit205df5dbdfc75d051d1d74e997dbd88208cbbdf1 (patch)
treea0f11f001c978053fd0e27f1bfc1ad501f6866c5 /backends/graphics/surfacesdl
parent8ae17b481a8f0a0c7d78e975a32e9e6df055b8df (diff)
downloadscummvm-rg350-205df5dbdfc75d051d1d74e997dbd88208cbbdf1.tar.gz
scummvm-rg350-205df5dbdfc75d051d1d74e997dbd88208cbbdf1.tar.bz2
scummvm-rg350-205df5dbdfc75d051d1d74e997dbd88208cbbdf1.zip
IMAGE: Fix taking screenshots on big endian systems
Diffstat (limited to 'backends/graphics/surfacesdl')
-rw-r--r--backends/graphics/surfacesdl/surfacesdl-graphics.cpp4
1 files changed, 4 insertions, 0 deletions
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);