aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk
diff options
context:
space:
mode:
authorMatthew Hoops2012-06-11 23:06:28 -0400
committerMatthew Hoops2012-06-11 23:14:26 -0400
commit3324aef8d0972d713f4fcfe09b2ada65dca365a8 (patch)
tree6cc9fb47ef5ca4757116c5209d83132389a36cf8 /engines/mohawk
parent13f93494578818b5a1272d793f7412b6810f3321 (diff)
downloadscummvm-rg350-3324aef8d0972d713f4fcfe09b2ada65dca365a8.tar.gz
scummvm-rg350-3324aef8d0972d713f4fcfe09b2ada65dca365a8.tar.bz2
scummvm-rg350-3324aef8d0972d713f4fcfe09b2ada65dca365a8.zip
MOHAWK: Make sure we convert video surfaces if they're not in the screen format
Diffstat (limited to 'engines/mohawk')
-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)