aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Hoops2011-09-28 20:16:50 -0400
committerMatthew Hoops2011-09-28 20:16:50 -0400
commitcd744aa60e21611c3d4135b9e5864bcba10dbe3a (patch)
tree8ea60408970c9614961f26a36f71ce7a75ae57b0
parent81eff30b8e5309a2dde8f6709f55a098acf27e48 (diff)
downloadscummvm-rg350-cd744aa60e21611c3d4135b9e5864bcba10dbe3a.tar.gz
scummvm-rg350-cd744aa60e21611c3d4135b9e5864bcba10dbe3a.tar.bz2
scummvm-rg350-cd744aa60e21611c3d4135b9e5864bcba10dbe3a.zip
PEGASUS: Fix the movie box code
-rwxr-xr-xengines/pegasus/movie.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/engines/pegasus/movie.cpp b/engines/pegasus/movie.cpp
index 586c2f5834..6dd44fcb01 100755
--- a/engines/pegasus/movie.cpp
+++ b/engines/pegasus/movie.cpp
@@ -65,10 +65,12 @@ void Movie::initFromMovieFile(const Common::String &fileName, bool transparent)
_video->pauseVideo(true);
Common::Rect bounds(0, 0, _video->getWidth(), _video->getHeight());
- allocateSurface(bounds);
- setBounds(bounds);
+ sizeElement(_video->getWidth(), _video->getHeight());
_movieBox = bounds;
+ if (!isSurfaceValid())
+ allocateSurface(bounds);
+
setStart(0, getScale());
setStop(_video->getDuration() * getScale() / 1000, getScale());
}
@@ -103,19 +105,16 @@ void Movie::redrawMovieWorld() {
}
}
-void Movie::draw(const Common::Rect &r) {
- Common::Rect surfaceBounds;
- getSurfaceBounds(surfaceBounds);
- Common::Rect r1 = r;
+void Movie::draw(const Common::Rect &r) {
+ Common::Rect worldBounds = _movieBox;
+ Common::Rect elementBounds;
+ getBounds(elementBounds);
- Common::Rect bounds;
- getBounds(bounds);
- surfaceBounds.moveTo(bounds.left, bounds.top);
- r1 = r1.findIntersectingRect(surfaceBounds);
- getSurfaceBounds(surfaceBounds);
+ worldBounds.moveTo(elementBounds.left, elementBounds.top);
+ Common::Rect r1 = r.findIntersectingRect(worldBounds);
Common::Rect r2 = r1;
- r2.translate(surfaceBounds.left - bounds.left, surfaceBounds.top - bounds.top);
+ r2.translate(_movieBox.left - elementBounds.left, _movieBox.top - elementBounds.top);
drawImage(r2, r1);
}