aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/mohawk/video.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/engines/mohawk/video.cpp b/engines/mohawk/video.cpp
index c10b986c60..15103b2021 100644
--- a/engines/mohawk/video.cpp
+++ b/engines/mohawk/video.cpp
@@ -227,17 +227,19 @@ bool VideoManager::updateMovies() {
Graphics::Surface *convertedFrame = 0;
if (frame && _videoStreams[i].enabled) {
- // Convert from 8bpp to the current screen format if necessary
Graphics::PixelFormat pixelFormat = _vm->_system->getScreenFormat();
- if (frame->format.bytesPerPixel == 1) {
- if (pixelFormat.bytesPerPixel == 1) {
- if (_videoStreams[i]->hasDirtyPalette())
- _videoStreams[i]->setSystemPalette();
- } else {
- convertedFrame = frame->convertTo(pixelFormat, _videoStreams[i]->getPalette());
- frame = convertedFrame;
- }
+ if (frame->format != pixelFormat) {
+ // We don't support downconverting to 8bpp
+ if (pixelFormat.bytesPerPixel == 1)
+ error("Cannot convert high color video frame to 8bpp");
+
+ // Convert to the current screen format
+ convertedFrame = frame->convertTo(pixelFormat, _videoStreams[i]->getPalette());
+ frame = convertedFrame;
+ } else if (pixelFormat.bytesPerPixel == 1 && _videoStreams[i]->hasDirtyPalette()) {
+ // Set the palette when running in 8bpp mode only
+ _videoStreams[i]->setSystemPalette();
}
// Clip the width/height to make sure we stay on the screen (Myst does this a few times)