aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2011-01-07 00:07:33 +0000
committerFilippos Karapetis2011-01-07 00:07:33 +0000
commit49f965a547ddb4b71c2abc29d50592dabdb21447 (patch)
tree63c5803716e662ec6acc388b095b4407c1e31b4e
parenta6994413ea3084914c4035298f4644e1dc9dbfe5 (diff)
downloadscummvm-rg350-49f965a547ddb4b71c2abc29d50592dabdb21447.tar.gz
scummvm-rg350-49f965a547ddb4b71c2abc29d50592dabdb21447.tar.bz2
scummvm-rg350-49f965a547ddb4b71c2abc29d50592dabdb21447.zip
SCI2.1: Added a sanity check for VMD video positioning, for the demo of Lighthouse
svn-id: r55137
-rw-r--r--engines/sci/engine/kvideo.cpp8
1 files changed, 8 insertions, 0 deletions
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;