aboutsummaryrefslogtreecommitdiff
path: root/graphics/scaler/thumbnail_intern.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2013-08-03 02:35:31 +0200
committerJohannes Schickel2013-08-03 04:02:49 +0200
commit5111746911958bd35422e9614b0961a6b911ea06 (patch)
tree0b166db3132da17f7a49a40b8914aa1b94e03c05 /graphics/scaler/thumbnail_intern.cpp
parentf03dc05847a77661c2978619099ab18c82bb94f7 (diff)
downloadscummvm-rg350-5111746911958bd35422e9614b0961a6b911ea06.tar.gz
scummvm-rg350-5111746911958bd35422e9614b0961a6b911ea06.tar.bz2
scummvm-rg350-5111746911958bd35422e9614b0961a6b911ea06.zip
GRAPHICS: Take advantage of Surface::getPixels.
Diffstat (limited to 'graphics/scaler/thumbnail_intern.cpp')
-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 675328db6d..e6e4a1a298 100644
--- a/graphics/scaler/thumbnail_intern.cpp
+++ b/graphics/scaler/thumbnail_intern.cpp
@@ -77,13 +77,13 @@ void createThumbnail_4(const uint8 *src, uint32 srcPitch, uint8 *dstPtr, uint32
static void scaleThumbnail(Graphics::Surface &in, Graphics::Surface &out) {
while (in.w / out.w >= 4 || in.h / out.h >= 4) {
- createThumbnail_4<565>((const uint8 *)in.getBasePtr(0, 0), in.pitch, (uint8 *)in.getBasePtr(0, 0), in.pitch, in.w, in.h);
+ createThumbnail_4<565>((const uint8 *)in.getPixels(), in.pitch, (uint8 *)in.getPixels(), in.pitch, in.w, in.h);
in.w /= 4;
in.h /= 4;
}
while (in.w / out.w >= 2 || in.h / out.h >= 2) {
- createThumbnail_2<565>((const uint8 *)in.getBasePtr(0, 0), in.pitch, (uint8 *)in.getBasePtr(0, 0), in.pitch, in.w, in.h);
+ createThumbnail_2<565>((const uint8 *)in.getPixels(), in.pitch, (uint8 *)in.getPixels(), in.pitch, in.w, in.h);
in.w /= 2;
in.h /= 2;
}
@@ -91,7 +91,7 @@ static void scaleThumbnail(Graphics::Surface &in, Graphics::Surface &out) {
if ((in.w == out.w && in.h < out.h) || (in.w < out.w && in.h == out.h)) {
// In this case we simply center the input surface in the output
uint8 *dst = (uint8 *)out.getBasePtr((out.w - in.w) / 2, (out.h - in.h) / 2);
- const uint8 *src = (const uint8 *)in.getBasePtr(0, 0);
+ const uint8 *src = (const uint8 *)in.getPixels();
for (int y = 0; y < in.h; ++y) {
memcpy(dst, src, in.w * in.format.bytesPerPixel);
@@ -172,7 +172,7 @@ static bool grabScreen565(Graphics::Surface *surf) {
return false;
assert(screen->format.bytesPerPixel == 1 || screen->format.bytesPerPixel == 2);
- assert(screen->getBasePtr(0, 0) != 0);
+ assert(screen->getPixels() != 0);
Graphics::PixelFormat screenFormat = g_system->getScreenFormat();