Skip to content

Commit

Permalink
GOB: Take advantage of Surface::getPixels.
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Schickel committed Aug 3, 2013
1 parent acfdfd4 commit 63a2e47
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion engines/gob/surface.cpp
Expand Up @@ -821,7 +821,7 @@ bool Surface::loadIFF(Common::SeekableReadStream &stream) {
return false;

resize(decoder.getSurface()->w, decoder.getSurface()->h);
memcpy(_vidMem, decoder.getSurface()->getBasePtr(0, 0), decoder.getSurface()->w * decoder.getSurface()->h);
memcpy(_vidMem, decoder.getSurface()->getPixels(), decoder.getSurface()->w * decoder.getSurface()->h);

return true;
}
Expand Down
2 changes: 1 addition & 1 deletion engines/gob/videoplayer.cpp
Expand Up @@ -738,7 +738,7 @@ bool VideoPlayer::copyFrame(int slot, Surface &dest,
// 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->getBasePtr(0, 0)));
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;
Expand Down

0 comments on commit 63a2e47

Please sign in to comment.