diff options
-rw-r--r-- | engines/pegasus/neighborhood/neighborhood.cpp | 4 | ||||
-rwxr-xr-x | engines/pegasus/surface.cpp | 29 | ||||
-rwxr-xr-x | engines/pegasus/surface.h | 3 |
3 files changed, 34 insertions, 2 deletions
diff --git a/engines/pegasus/neighborhood/neighborhood.cpp b/engines/pegasus/neighborhood/neighborhood.cpp index d87a536d90..7c77381322 100644 --- a/engines/pegasus/neighborhood/neighborhood.cpp +++ b/engines/pegasus/neighborhood/neighborhood.cpp @@ -1023,8 +1023,7 @@ void Neighborhood::startTurnPush(const tTurnDirection turnDirection, const TimeV // will work. _navMovie.setSegment(0, _navMovie.getDuration()); - // TODO - //_pushIn.initFromMovieFrame(_navMovie.getMovie(), newView, kNoMask); + _pushIn.initFromMovieFrame(_navMovie.getMovie(), newView); _navMovie.hide(); @@ -1075,6 +1074,7 @@ void Neighborhood::startTurnPush(const tTurnDirection turnDirection, const TimeV _turnPush.continueFader(); do { + _vm->checkCallBacks(); _vm->refreshDisplay(); _vm->_system->delayMillis(10); } while (_turnPush.isFading()); diff --git a/engines/pegasus/surface.cpp b/engines/pegasus/surface.cpp index ebef03e79a..43cf90af28 100755 --- a/engines/pegasus/surface.cpp +++ b/engines/pegasus/surface.cpp @@ -131,6 +131,22 @@ void Surface::getImageFromPICTStream(Common::SeekableReadStream *stream) { _bounds = Common::Rect(0, 0, _surface->w, _surface->h); } +void Surface::getImageFromMovieFrame(Video::SeekableVideoDecoder *video, TimeValue time) { + video->seekToTime(Audio::Timestamp(0, time, 600)); + const Graphics::Surface *frame = video->decodeNextFrame(); + + if (frame) { + if (!_surface) + _surface = new Graphics::Surface(); + + _surface->copyFrom(*frame); + _ownsSurface = true; + _bounds = Common::Rect(0, 0, _surface->w, _surface->h); + } else { + deallocateSurface(); + } +} + void Surface::copyToCurrentPort() const { copyToCurrentPort(_bounds); } @@ -218,6 +234,11 @@ void Frame::initFromPICTResource(Common::MacResManager *resFork, uint16 id, bool _transparent = transparent; } +void Frame::initFromMovieFrame(Video::SeekableVideoDecoder *video, TimeValue time, bool transparent) { + getImageFromMovieFrame(video, time); + _transparent = transparent; +} + void Picture::draw(const Common::Rect &r) { Common::Rect surfaceBounds; getSurfaceBounds(surfaceBounds); @@ -250,4 +271,12 @@ void Picture::initFromPICTResource(Common::MacResManager *resFork, uint16 id, bo sizeElement(surfaceBounds.width(), surfaceBounds.height()); } +void Picture::initFromMovieFrame(Video::SeekableVideoDecoder *video, TimeValue time, bool transparent) { + Frame::initFromMovieFrame(video, time, transparent); + + Common::Rect surfaceBounds; + getSurfaceBounds(surfaceBounds); + sizeElement(surfaceBounds.width(), surfaceBounds.height()); +} + } // End of namespace Pegasus diff --git a/engines/pegasus/surface.h b/engines/pegasus/surface.h index 72d614f963..c94ccdf0fc 100755 --- a/engines/pegasus/surface.h +++ b/engines/pegasus/surface.h @@ -73,6 +73,7 @@ public: virtual void getImageFromPICTFile(const Common::String &fileName); virtual void getImageFromPICTResource(Common::MacResManager *resFork, uint16 id); + virtual void getImageFromMovieFrame(Video::SeekableVideoDecoder *, TimeValue); protected: bool _ownsSurface; @@ -103,6 +104,7 @@ public: virtual void initFromPICTFile(const Common::String &fileName, bool transparent = false); virtual void initFromPICTResource(Common::MacResManager *resFork, uint16 id, bool transparent = false); + virtual void initFromMovieFrame(Video::SeekableVideoDecoder *, TimeValue, bool transparent = false); }; class SpriteFrame : public Frame { @@ -122,6 +124,7 @@ public: virtual void initFromPICTFile(const Common::String &fileName, bool transparent = false); virtual void initFromPICTResource(Common::MacResManager *resFork, uint16 id, bool transparent = false); + virtual void initFromMovieFrame(Video::SeekableVideoDecoder *, TimeValue, bool transparent = false); virtual void draw(const Common::Rect &); }; |