Do not call OSystem::grabPalette() for 16bit modes, when the result is not used anyway for those modes.
svn-id: r48733
This commit is contained in:
parent
001bca2d6c
commit
64cba2878a
1 changed files with 9 additions and 3 deletions
|
@ -102,12 +102,16 @@ static bool grabScreen565(Graphics::Surface *surf) {
|
||||||
assert(screen->bytesPerPixel == 1 || screen->bytesPerPixel == 2);
|
assert(screen->bytesPerPixel == 1 || screen->bytesPerPixel == 2);
|
||||||
assert(screen->pixels != 0);
|
assert(screen->pixels != 0);
|
||||||
|
|
||||||
byte palette[256 * 4];
|
Graphics::PixelFormat screenFormat = g_system->getScreenFormat();
|
||||||
g_system->grabPalette(&palette[0], 0, 256);
|
|
||||||
|
|
||||||
surf->create(screen->w, screen->h, 2);
|
surf->create(screen->w, screen->h, 2);
|
||||||
|
|
||||||
Graphics::PixelFormat screenFormat = g_system->getScreenFormat();
|
byte *palette = 0;
|
||||||
|
if (screenFormat.bytesPerPixel == 1) {
|
||||||
|
palette = new byte[256 * 4];
|
||||||
|
assert(palette);
|
||||||
|
g_system->grabPalette(&palette[0], 0, 256);
|
||||||
|
}
|
||||||
|
|
||||||
for (uint y = 0; y < screen->h; ++y) {
|
for (uint y = 0; y < screen->h; ++y) {
|
||||||
for (uint x = 0; x < screen->w; ++x) {
|
for (uint x = 0; x < screen->w; ++x) {
|
||||||
|
@ -126,6 +130,8 @@ static bool grabScreen565(Graphics::Surface *surf) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delete[] palette;
|
||||||
|
|
||||||
g_system->unlockScreen();
|
g_system->unlockScreen();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue