aboutsummaryrefslogtreecommitdiff
path: root/engines/pegasus
diff options
context:
space:
mode:
Diffstat (limited to 'engines/pegasus')
-rwxr-xr-xengines/pegasus/movie.cpp13
-rwxr-xr-xengines/pegasus/movie.h3
2 files changed, 14 insertions, 2 deletions
diff --git a/engines/pegasus/movie.cpp b/engines/pegasus/movie.cpp
index 2bf852a496..e102c70272 100755
--- a/engines/pegasus/movie.cpp
+++ b/engines/pegasus/movie.cpp
@@ -67,6 +67,7 @@ void Movie::initFromMovieFile(const Common::String &fileName, bool transparent)
Common::Rect bounds(0, 0, _video->getWidth(), _video->getHeight());
allocateSurface(bounds);
setBounds(bounds);
+ _movieBox = bounds;
setStart(0, getScale());
setStop(_video->getDuration() * getScale() / 1000, getScale());
@@ -90,8 +91,12 @@ void Movie::redrawMovieWorld() {
getBounds(bounds);
g_system->copyRectToScreen((byte *)frame->pixels, frame->pitch, bounds.left, bounds.top, frame->w, frame->h);
} else {
- // Just copy to our surface
- _surface->copyFrom(*frame);
+ // Copy to the surface using _movieBox
+ uint16 width = MIN<int>(MIN<int>(frame->w, _movieBox.width()), _surface->w - _movieBox.left);
+ uint16 height = MIN<int>(MIN<int>(frame->h, _movieBox.height()), _surface->h - _movieBox.top);
+
+ for (uint16 y = 0; y < height; y++)
+ memcpy((byte *)_surface->getBasePtr(_movieBox.left, _movieBox.top + y), (const byte *)frame->getBasePtr(0, y), width * frame->format.bytesPerPixel);
}
triggerRedraw();
@@ -114,6 +119,10 @@ void Movie::draw(const Common::Rect &r) {
drawImage(r2, r1);
}
+void Movie::moveMovieBoxTo(const tCoordType h, const tCoordType v) {
+ _movieBox.moveTo(h, v);
+}
+
void Movie::setVolume(uint16 volume) {
// TODO
}
diff --git a/engines/pegasus/movie.h b/engines/pegasus/movie.h
index 54e57aeb30..a72491478f 100755
--- a/engines/pegasus/movie.h
+++ b/engines/pegasus/movie.h
@@ -61,6 +61,8 @@ public:
virtual void stop();
virtual void resume();
+ virtual void moveMovieBoxTo(const tCoordType, const tCoordType);
+
// *** HACK ALERT
Video::SeekableVideoDecoder *getMovie() { return _video; }
void setVolume(uint16);
@@ -70,6 +72,7 @@ public:
protected:
Video::SeekableVideoDecoder *_video;
bool _directDraw;
+ Common::Rect _movieBox;
};
} // End of namespace Pegasus