diff options
author | Johannes Schickel | 2013-08-07 12:24:59 -0700 |
---|---|---|
committer | Johannes Schickel | 2013-08-07 12:24:59 -0700 |
commit | 7f8308e0eb50c4e13ec0684619b5474983a93a66 (patch) | |
tree | 0a057f01385a11d99add1e294f70891a8e8bf6c9 /engines/gob | |
parent | 6e9390feb8166d5f9d6c6fdfe00a336b4f71de4c (diff) | |
parent | e5f0c42a65f38611272542a144228753e0496493 (diff) | |
download | scummvm-rg350-7f8308e0eb50c4e13ec0684619b5474983a93a66.tar.gz scummvm-rg350-7f8308e0eb50c4e13ec0684619b5474983a93a66.tar.bz2 scummvm-rg350-7f8308e0eb50c4e13ec0684619b5474983a93a66.zip |
Merge pull request #365 from lordhoto/protected-pixels
Make Graphics::Surface::pixels protected.
Diffstat (limited to 'engines/gob')
-rw-r--r-- | engines/gob/surface.cpp | 2 | ||||
-rw-r--r-- | engines/gob/videoplayer.cpp | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/engines/gob/surface.cpp b/engines/gob/surface.cpp index 839378a412..870b0f15b3 100644 --- a/engines/gob/surface.cpp +++ b/engines/gob/surface.cpp @@ -821,7 +821,7 @@ bool Surface::loadIFF(Common::SeekableReadStream &stream) { return false; resize(decoder.getSurface()->w, decoder.getSurface()->h); - memcpy(_vidMem, decoder.getSurface()->pixels, decoder.getSurface()->w * decoder.getSurface()->h); + memcpy(_vidMem, decoder.getSurface()->getPixels(), decoder.getSurface()->w * decoder.getSurface()->h); return true; } diff --git a/engines/gob/videoplayer.cpp b/engines/gob/videoplayer.cpp index a478492ccc..155989ccee 100644 --- a/engines/gob/videoplayer.cpp +++ b/engines/gob/videoplayer.cpp @@ -734,7 +734,11 @@ bool VideoPlayer::copyFrame(int slot, Surface &dest, if (!surface) return false; - Surface src(surface->w, surface->h, surface->format.bytesPerPixel, (byte *)surface->pixels); + // FIXME? This currently casts away const from the pixel data. However, it + // is only used read-only in this case (as far as I can tell). Not casting + // the const qualifier away will lead to an additional allocation and copy + // of the frame data which is undesirable. + Surface src(surface->w, surface->h, surface->format.bytesPerPixel, (byte *)const_cast<void *>(surface->getPixels())); dest.blit(src, left, top, left + width - 1, top + height - 1, x, y, transp); return true; |