mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-16 15:08:59 +00:00
PEGASUS: Allow getting frames from videos
This commit is contained in:
parent
de5849b102
commit
8bc240124a
@ -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());
|
||||
|
@ -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
|
||||
|
@ -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 &);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user