aboutsummaryrefslogtreecommitdiff
path: root/graphics/scaler
diff options
context:
space:
mode:
authorJohannes Schickel2011-02-13 14:45:14 +0100
committerJohannes Schickel2011-02-14 17:08:32 +0100
commitf53f1af062d4f0612b7e3f1055373f8c2fcb0bdd (patch)
tree7cfa8a760b032c44abeec2a672835d8d373d10aa /graphics/scaler
parent021ecca3b09778c2819e81dfb6c1a7a5c242397e (diff)
downloadscummvm-rg350-f53f1af062d4f0612b7e3f1055373f8c2fcb0bdd.tar.gz
scummvm-rg350-f53f1af062d4f0612b7e3f1055373f8c2fcb0bdd.tar.bz2
scummvm-rg350-f53f1af062d4f0612b7e3f1055373f8c2fcb0bdd.zip
GRAPHICS: Adapt thumbnail code to grabPalette RGBA->RGB change.
Diffstat (limited to 'graphics/scaler')
-rw-r--r--graphics/scaler/thumbnail_intern.cpp8
1 files changed, 4 insertions, 4 deletions
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);