SCI2.1: Added a sanity check for VMD video positioning, for the demo of Lighthouse

svn-id: r55137
This commit is contained in:
Filippos Karapetis 2011-01-07 00:07:33 +00:00
parent a6994413ea
commit 49f965a547

View File

@ -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;