aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorColin Snover2016-07-31 20:22:19 -0500
committerColin Snover2016-08-19 13:57:40 -0500
commitd5bcef1e662e969d558414ef110aebd4c8e87720 (patch)
tree8f2e2c10a734c5861fa85e6edd30998a10f3f47b /engines/sci
parent89a82f5b55f95cd1b68374b670299ddc005fe1fb (diff)
downloadscummvm-rg350-d5bcef1e662e969d558414ef110aebd4c8e87720.tar.gz
scummvm-rg350-d5bcef1e662e969d558414ef110aebd4c8e87720.tar.bz2
scummvm-rg350-d5bcef1e662e969d558414ef110aebd4c8e87720.zip
SCI32: Hide cursors in 24bpp video playback mode
Drawing the cursor in this mode will result in a read overflow as it is 8bpp.
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/graphics/video32.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/engines/sci/graphics/video32.cpp b/engines/sci/graphics/video32.cpp
index f4aa7664d3..b9fc7061a7 100644
--- a/engines/sci/graphics/video32.cpp
+++ b/engines/sci/graphics/video32.cpp
@@ -269,6 +269,11 @@ void AVIPlayer::init() {
g_sci->_gfxFrameout->addScreenItem(*_screenItem);
g_sci->_gfxFrameout->frameOut(true);
} else {
+ // Attempting to draw a palettized cursor into a 24bpp surface will
+ // cause memory corruption, so hide the cursor in this mode (SCI did not
+ // have a 24bpp mode but just directed VFW to display videos instead)
+ g_sci->_gfxCursor32->hide();
+
const Buffer &currentBuffer = g_sci->_gfxFrameout->getCurrentBuffer();
const Graphics::PixelFormat format = _decoder->getPixelFormat();
initGraphics(currentBuffer.screenWidth, currentBuffer.screenHeight, g_sci->_gfxFrameout->_isHiRes, &format);
@@ -326,6 +331,7 @@ AVIPlayer::IOStatus AVIPlayer::close() {
const Buffer &currentBuffer = g_sci->_gfxFrameout->getCurrentBuffer();
const Graphics::PixelFormat format = Graphics::PixelFormat::createFormatCLUT8();
initGraphics(currentBuffer.screenWidth, currentBuffer.screenHeight, isHiRes, &format);
+ g_sci->_gfxCursor32->unhide();
}
_decoder->close();