diff options
author | Matthew Hoops | 2012-06-16 01:47:36 -0400 |
---|---|---|
committer | Matthew Hoops | 2012-06-16 01:47:36 -0400 |
commit | b5238756e26ea3460b315af5737636db09fe30da (patch) | |
tree | ca10a571dbd88788f6f12087bd4e86dee3a084e6 | |
parent | 625f6cc71657e95e0361edefa333a38910c1aca5 (diff) | |
download | scummvm-rg350-b5238756e26ea3460b315af5737636db09fe30da.tar.gz scummvm-rg350-b5238756e26ea3460b315af5737636db09fe30da.tar.bz2 scummvm-rg350-b5238756e26ea3460b315af5737636db09fe30da.zip |
PEGASUS: Make sure we check the pixel format of video frames
-rw-r--r-- | engines/pegasus/movie.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/engines/pegasus/movie.cpp b/engines/pegasus/movie.cpp index b7c025a89b..5d393de492 100644 --- a/engines/pegasus/movie.cpp +++ b/engines/pegasus/movie.cpp @@ -93,6 +93,14 @@ void Movie::redrawMovieWorld() { if (!frame) return; + // Make sure we have a surface in the current pixel format + Graphics::Surface *convertedFrame = 0; + + if (frame->format != g_system->getScreenFormat()) { + convertedFrame = frame->convertTo(g_system->getScreenFormat()); + frame = convertedFrame; + } + // Copy to the surface using _movieBox uint16 width = MIN<int>(frame->w, _movieBox.width()); uint16 height = MIN<int>(frame->h, _movieBox.height()); @@ -100,6 +108,11 @@ void Movie::redrawMovieWorld() { for (uint16 y = 0; y < height; y++) memcpy((byte *)_surface->getBasePtr(_movieBox.left, _movieBox.top + y), (const byte *)frame->getBasePtr(0, y), width * frame->format.bytesPerPixel); + if (convertedFrame) { + convertedFrame->free(); + delete convertedFrame; + } + triggerRedraw(); } } |