aboutsummaryrefslogtreecommitdiff
path: root/graphics/scaler
diff options
context:
space:
mode:
authorJohannes Schickel2011-04-17 16:24:52 +0200
committerJohannes Schickel2011-04-17 16:24:52 +0200
commit39b993fb02749a2a1988f64d3443580f2e1c03ef (patch)
tree582ee5e5230d2445fe8e63ba3fdcce4320cced34 /graphics/scaler
parent7ac3ae108a69587693e0820cde43a63c34a186ec (diff)
downloadscummvm-rg350-39b993fb02749a2a1988f64d3443580f2e1c03ef.tar.gz
scummvm-rg350-39b993fb02749a2a1988f64d3443580f2e1c03ef.tar.bz2
scummvm-rg350-39b993fb02749a2a1988f64d3443580f2e1c03ef.zip
GRAPHICS: Prefer Surface::create taking a PixelFormat over the one taking a byte depth.
Diffstat (limited to 'graphics/scaler')
-rw-r--r--graphics/scaler/thumbnail_intern.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/graphics/scaler/thumbnail_intern.cpp b/graphics/scaler/thumbnail_intern.cpp
index 5cee1c7a72..a3a98079d6 100644
--- a/graphics/scaler/thumbnail_intern.cpp
+++ b/graphics/scaler/thumbnail_intern.cpp
@@ -104,7 +104,7 @@ static bool grabScreen565(Graphics::Surface *surf) {
Graphics::PixelFormat screenFormat = g_system->getScreenFormat();
- surf->create(screen->w, screen->h, 2);
+ surf->create(screen->w, screen->h, Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0));
byte *palette = 0;
if (screenFormat.bytesPerPixel == 1) {
@@ -146,7 +146,7 @@ static bool createThumbnail(Graphics::Surface &out, Graphics::Surface &in) {
// center MM NES screen
Graphics::Surface newscreen;
- newscreen.create(width, in.h, in.bytesPerPixel);
+ newscreen.create(width, in.h, in.format);
uint8 *dst = (uint8 *)newscreen.getBasePtr((320 - in.w) / 2, 0);
const uint8 *src = (const uint8 *)in.getBasePtr(0, 0);
@@ -171,7 +171,7 @@ static bool createThumbnail(Graphics::Surface &out, Graphics::Surface &in) {
// cut off menu and so on..
Graphics::Surface newscreen;
- newscreen.create(width, 400, in.bytesPerPixel);
+ newscreen.create(width, 400, in.format);
uint8 *dst = (uint8 *)newscreen.getBasePtr(0, (400 - 240) / 2);
const uint8 *src = (const uint8 *)in.getBasePtr(41, 28);
@@ -190,7 +190,7 @@ static bool createThumbnail(Graphics::Surface &out, Graphics::Surface &in) {
inHeight = 480;
Graphics::Surface newscreen;
- newscreen.create(width, 480, in.bytesPerPixel);
+ newscreen.create(width, 480, in.format);
memcpy(newscreen.getBasePtr(0, 0), in.getBasePtr(0, 0), width * 440 * in.bytesPerPixel);
@@ -200,7 +200,7 @@ static bool createThumbnail(Graphics::Surface &out, Graphics::Surface &in) {
uint16 newHeight = !(inHeight % 240) ? kThumbnailHeight2 : kThumbnailHeight1;
- out.create(kThumbnailWidth, newHeight, sizeof(uint16));
+ out.create(kThumbnailWidth, newHeight, Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0));
createThumbnail((const uint8 *)in.pixels, width * sizeof(uint16), (uint8 *)out.pixels, out.pitch, width, inHeight);
in.free();
@@ -223,7 +223,7 @@ bool createThumbnail(Graphics::Surface *surf, const uint8 *pixels, int w, int h,
assert(surf);
Graphics::Surface screen;
- screen.create(w, h, 2);
+ screen.create(w, h, Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0));
for (uint y = 0; y < screen.h; ++y) {
for (uint x = 0; x < screen.w; ++x) {