From f53f1af062d4f0612b7e3f1055373f8c2fcb0bdd Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 13 Feb 2011 14:45:14 +0100 Subject: GRAPHICS: Adapt thumbnail code to grabPalette RGBA->RGB change. --- graphics/scaler/thumbnail_intern.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'graphics/scaler') diff --git a/graphics/scaler/thumbnail_intern.cpp b/graphics/scaler/thumbnail_intern.cpp index bd325aca63..5cee1c7a72 100644 --- a/graphics/scaler/thumbnail_intern.cpp +++ b/graphics/scaler/thumbnail_intern.cpp @@ -108,7 +108,7 @@ static bool grabScreen565(Graphics::Surface *surf) { byte *palette = 0; if (screenFormat.bytesPerPixel == 1) { - palette = new byte[256 * 4]; + palette = new byte[256 * 3]; assert(palette); g_system->getPaletteManager()->grabPalette(palette, 0, 256); } @@ -118,9 +118,9 @@ static bool grabScreen565(Graphics::Surface *surf) { byte r = 0, g = 0, b = 0; if (screenFormat.bytesPerPixel == 1) { - r = palette[((uint8*)screen->pixels)[y * screen->pitch + x] * 4]; - g = palette[((uint8*)screen->pixels)[y * screen->pitch + x] * 4 + 1]; - b = palette[((uint8*)screen->pixels)[y * screen->pitch + x] * 4 + 2]; + r = palette[((uint8*)screen->pixels)[y * screen->pitch + x] * 3]; + g = palette[((uint8*)screen->pixels)[y * screen->pitch + x] * 3 + 1]; + b = palette[((uint8*)screen->pixels)[y * screen->pitch + x] * 3 + 2]; } else if (screenFormat.bytesPerPixel == 2) { uint16 col = READ_UINT16(screen->getBasePtr(x, y)); screenFormat.colorToRGB(col, r, g, b); -- cgit v1.2.3