diff options
author | Max Horn | 2007-06-19 22:39:59 +0000 |
---|---|---|
committer | Max Horn | 2007-06-19 22:39:59 +0000 |
commit | b51f2f3212ae8a5abbdce4d947ec2d1cad1a0b6f (patch) | |
tree | 45a838924ce55038021cd3c3d8760e80ff630f38 /graphics/scaler | |
parent | ab9b9a1bf362e68f5f6a69462ef2b7c146e6e08f (diff) | |
download | scummvm-rg350-b51f2f3212ae8a5abbdce4d947ec2d1cad1a0b6f.tar.gz scummvm-rg350-b51f2f3212ae8a5abbdce4d947ec2d1cad1a0b6f.tar.bz2 scummvm-rg350-b51f2f3212ae8a5abbdce4d947ec2d1cad1a0b6f.zip |
Implemented the OSystem framebuffer API, as discussed on scummvm-devel. All changes are just fine, and won't cause any compile problems or regressions, despite the fact that I can't test most of the non-SDL backend changes, at an improbability level of two to the power of two hundred and seventy-six thousand to one against - possibly much higher. Anything you still can't cope with is therefore your own problem. Please relax.
svn-id: r27548
Diffstat (limited to 'graphics/scaler')
-rw-r--r-- | graphics/scaler/thumbnail.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/graphics/scaler/thumbnail.cpp b/graphics/scaler/thumbnail.cpp index a6575f3ea3..40d0cba156 100644 --- a/graphics/scaler/thumbnail.cpp +++ b/graphics/scaler/thumbnail.cpp @@ -97,32 +97,32 @@ void createThumbnail(const uint8* src, uint32 srcPitch, uint8* dstPtr, uint32 ds * Copies the current screen contents to a new surface, using RGB565 format. * WARNING: surf->free() must be called by the user to avoid leaking. * - * @param surf the surfce to store the data in it + * @param surf the surface to store the data in it */ static bool grabScreen565(Graphics::Surface *surf) { - Graphics::Surface screen; - if (!g_system->grabRawScreen(&screen)) + Graphics::Surface *screen = g_system->lockScreen(); + if (!screen) return false; - assert(screen.bytesPerPixel == 1 && screen.pixels != 0); + assert(screen->bytesPerPixel == 1 && screen->pixels != 0); byte palette[256 * 4]; g_system->grabPalette(&palette[0], 0, 256); - surf->create(screen.w, screen.h, 2); + surf->create(screen->w, screen->h, 2); - for (uint y = 0; y < screen.h; ++y) { - for (uint x = 0; x < screen.w; ++x) { + for (uint y = 0; y < screen->h; ++y) { + for (uint x = 0; x < screen->w; ++x) { byte r, g, b; - 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] * 4]; + g = palette[((uint8*)screen->pixels)[y * screen->pitch + x] * 4 + 1]; + b = palette[((uint8*)screen->pixels)[y * screen->pitch + x] * 4 + 2]; ((uint16*)surf->pixels)[y * surf->w + x] = (((r >> 3) & 0x1F) << 11) | (((g >> 2) & 0x3F) << 5) | ((b >> 3) & 0x1F); } } - screen.free(); + g_system->unlockScreen(); return true; } |