aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorJohannes Schickel2013-08-03 02:42:32 +0200
committerJohannes Schickel2013-08-03 04:02:52 +0200
commit1550e9804b883afd4eb32eaea77cd81cbef75953 (patch)
tree977ecf0f8e3d925e81374d8bfc42356e060bc89b /engines
parent5f8bce839f1a463f0de0ba5e116d93d802fb8ad0 (diff)
downloadscummvm-rg350-1550e9804b883afd4eb32eaea77cd81cbef75953.tar.gz
scummvm-rg350-1550e9804b883afd4eb32eaea77cd81cbef75953.tar.bz2
scummvm-rg350-1550e9804b883afd4eb32eaea77cd81cbef75953.zip
SWORD25: Take advantage of Surface::getPixels.
Diffstat (limited to 'engines')
-rw-r--r--engines/sword25/fmv/movieplayer.cpp4
-rw-r--r--engines/sword25/gfx/image/imgloader.cpp2
-rw-r--r--engines/sword25/gfx/image/renderedimage.cpp2
-rw-r--r--engines/sword25/gfx/screenshot.cpp4
4 files changed, 6 insertions, 6 deletions
diff --git a/engines/sword25/fmv/movieplayer.cpp b/engines/sword25/fmv/movieplayer.cpp
index a95532ec65..3cdce1b493 100644
--- a/engines/sword25/fmv/movieplayer.cpp
+++ b/engines/sword25/fmv/movieplayer.cpp
@@ -130,10 +130,10 @@ void MoviePlayer::update() {
assert(s->format.bytesPerPixel == 4);
#ifdef THEORA_INDIRECT_RENDERING
- const byte *frameData = (const byte *)s->getBasePtr(0, 0);
+ const byte *frameData = (const byte *)s->getPixels();
_outputBitmap->setContent(frameData, s->pitch * s->h, 0, s->pitch);
#else
- g_system->copyRectToScreen(s->getBasePtr(0, 0), s->pitch, _outX, _outY, MIN(s->w, _backSurface->w), MIN(s->h, _backSurface->h));
+ g_system->copyRectToScreen(s->getPixels(), s->pitch, _outX, _outY, MIN(s->w, _backSurface->w), MIN(s->h, _backSurface->h));
g_system->updateScreen();
#endif
}
diff --git a/engines/sword25/gfx/image/imgloader.cpp b/engines/sword25/gfx/image/imgloader.cpp
index 6a458a0ae1..9006a596b4 100644
--- a/engines/sword25/gfx/image/imgloader.cpp
+++ b/engines/sword25/gfx/image/imgloader.cpp
@@ -50,7 +50,7 @@ bool ImgLoader::decodePNGImage(const byte *fileDataPtr, uint fileSize, byte *&un
width = pngSurface->w;
height = pngSurface->h;
uncompressedDataPtr = new byte[pngSurface->pitch * pngSurface->h];
- memcpy(uncompressedDataPtr, (byte *)pngSurface->getBasePtr(0, 0), pngSurface->pitch * pngSurface->h);
+ memcpy(uncompressedDataPtr, (byte *)pngSurface->getPixels(), pngSurface->pitch * pngSurface->h);
pngSurface->free();
delete pngSurface;
diff --git a/engines/sword25/gfx/image/renderedimage.cpp b/engines/sword25/gfx/image/renderedimage.cpp
index f8ed7a00b2..c0138c8fd3 100644
--- a/engines/sword25/gfx/image/renderedimage.cpp
+++ b/engines/sword25/gfx/image/renderedimage.cpp
@@ -287,7 +287,7 @@ bool RenderedImage::blit(int posX, int posY, int flipping, Common::Rect *pPartRe
if ((width != srcImage.w) || (height != srcImage.h)) {
// Scale the image
img = imgScaled = scale(srcImage, width, height);
- savedPixels = (byte *)img->getBasePtr(0, 0);
+ savedPixels = (byte *)img->getPixels();
} else {
img = &srcImage;
}
diff --git a/engines/sword25/gfx/screenshot.cpp b/engines/sword25/gfx/screenshot.cpp
index 73149ec119..7b56a6e9f3 100644
--- a/engines/sword25/gfx/screenshot.cpp
+++ b/engines/sword25/gfx/screenshot.cpp
@@ -40,7 +40,7 @@ namespace Sword25 {
bool Screenshot::saveToFile(Graphics::Surface *data, Common::WriteStream *stream) {
// Convert the RGBA data to RGB
- const byte *pSrc = (const byte *)data->getBasePtr(0, 0);
+ const byte *pSrc = (const byte *)data->getPixels();
// Write our own custom header
stream->writeUint32BE(MKTAG('S','C','R','N')); // SCRN, short for "Screenshot"
@@ -85,7 +85,7 @@ Common::SeekableReadStream *Screenshot::createThumbnail(Graphics::Surface *data)
uint x, y;
x = y = 0;
- for (byte *pDest = (byte *)thumbnail.getBasePtr(0, 0); pDest < ((byte *)thumbnail.getBasePtr(0, thumbnail.h)); ) {
+ for (byte *pDest = (byte *)thumbnail.getPixels(); pDest < ((byte *)thumbnail.getBasePtr(0, thumbnail.h)); ) {
// Get an average over a 4x4 pixel block in the source image
int alpha, red, green, blue;
alpha = red = green = blue = 0;