From e9bfbbd470d2550f42b3f01100cb31bfc618f8d1 Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sun, 27 Mar 2016 14:47:23 +0200 Subject: GRAPHICS: Allow saving thumbnails of 32 bits screens Fixes saving in Myst ME when using the OpenGL output --- graphics/scaler/thumbnail_intern.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'graphics') diff --git a/graphics/scaler/thumbnail_intern.cpp b/graphics/scaler/thumbnail_intern.cpp index 65e327f9c2..78fb7828d7 100644 --- a/graphics/scaler/thumbnail_intern.cpp +++ b/graphics/scaler/thumbnail_intern.cpp @@ -171,7 +171,8 @@ static bool grabScreen565(Graphics::Surface *surf) { if (!screen) return false; - assert(screen->format.bytesPerPixel == 1 || screen->format.bytesPerPixel == 2); + assert(screen->format.bytesPerPixel == 1 || screen->format.bytesPerPixel == 2 + || screen->format.bytesPerPixel == 4); assert(screen->getPixels() != 0); Graphics::PixelFormat screenFormat = g_system->getScreenFormat(); @@ -197,6 +198,9 @@ static bool grabScreen565(Graphics::Surface *surf) { } else if (screenFormat.bytesPerPixel == 2) { uint16 col = READ_UINT16(screen->getBasePtr(x, y)); screenFormat.colorToRGB(col, r, g, b); + } else if (screenFormat.bytesPerPixel == 4) { + uint32 col = READ_UINT32(screen->getBasePtr(x, y)); + screenFormat.colorToRGB(col, r, g, b); } *((uint16 *)surf->getBasePtr(x, y)) = Graphics::RGBToColor >(r, g, b); -- cgit v1.2.3