From 49f965a547ddb4b71c2abc29d50592dabdb21447 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 7 Jan 2011 00:07:33 +0000 Subject: SCI2.1: Added a sanity check for VMD video positioning, for the demo of Lighthouse svn-id: r55137 --- engines/sci/engine/kvideo.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'engines/sci/engine/kvideo.cpp') diff --git a/engines/sci/engine/kvideo.cpp b/engines/sci/engine/kvideo.cpp index fddfa3ba86..f3cf8b68d0 100644 --- a/engines/sci/engine/kvideo.cpp +++ b/engines/sci/engine/kvideo.cpp @@ -61,9 +61,17 @@ void playVideo(Graphics::VideoDecoder *videoDecoder, VideoState videoState) { uint16 x, y; + // Sanity check... if (videoState.x > 0 && videoState.y > 0 && isVMD) { x = videoState.x; y = videoState.y; + + if (x + width > screenWidth || y + height > screenHeight) { + // Happens in the Lighthouse demo + warning("VMD video won't fit on screen, centering it instead"); + x = (screenWidth - width) / 2; + y = (screenHeight - height) / 2; + } } else { x = (screenWidth - width) / 2; y = (screenHeight - height) / 2; -- cgit v1.2.3