aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/pegasus/movie.cpp13
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();
}
}