mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-25 22:07:34 +00:00
GRAPHICS: Adapt thumbnail code to grabPalette RGBA->RGB change.
This commit is contained in:
parent
021ecca3b0
commit
f53f1af062
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user