diff options
author | Sven Hesse | 2010-08-08 00:51:09 +0000 |
---|---|---|
committer | Sven Hesse | 2010-08-08 00:51:09 +0000 |
commit | 285ba14e233c20ad5753f779f6717f591ea0a83a (patch) | |
tree | 1a1710464a544d6d0a0d2e77b7d996421cd8760d /engines/gob/videoplayer.cpp | |
parent | 0cf837c1af4e55c32dff91ff88632cd0260858f5 (diff) | |
download | scummvm-rg350-285ba14e233c20ad5753f779f6717f591ea0a83a.tar.gz scummvm-rg350-285ba14e233c20ad5753f779f6717f591ea0a83a.tar.bz2 scummvm-rg350-285ba14e233c20ad5753f779f6717f591ea0a83a.zip |
GOB: Make the demoplayer use the new VideoPlayer interface
svn-id: r51885
Diffstat (limited to 'engines/gob/videoplayer.cpp')
-rw-r--r-- | engines/gob/videoplayer.cpp | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/engines/gob/videoplayer.cpp b/engines/gob/videoplayer.cpp index d0e61c84e3..35f423d2f4 100644 --- a/engines/gob/videoplayer.cpp +++ b/engines/gob/videoplayer.cpp @@ -40,7 +40,8 @@ namespace Gob { VideoPlayer::Properties::Properties() : type(kVideoTypeTry), sprite(Draw::kFrontSurface), x(-1), y(-1), width(-1), height(-1), flags(kFlagFrontSurface), startFrame(-1), lastFrame(-1), endFrame(-1), breakKey(kShortKeyEscape), - palCmd(8), palStart(0), palEnd(255), palFrame(-1), fade(false), canceled(false) { + palCmd(8), palStart(0), palEnd(255), palFrame(-1), + fade(false), waitEndFrame(true), canceled(false) { } @@ -241,8 +242,8 @@ bool VideoPlayer::play(int slot, Properties &properties) { properties.fade = false; } - if (!_noCursorSwitch) - _vm->_util->delay(video->decoder->getTimeToNextFrame()); + if (!_noCursorSwitch && properties.waitEndFrame) + waitEndFrame(slot); } evalBgShading(*video); @@ -250,6 +251,14 @@ bool VideoPlayer::play(int slot, Properties &properties) { return true; } +void VideoPlayer::waitEndFrame(int slot) { + Video *video = getVideoBySlot(slot); + if (!video) + return; + + _vm->_util->delay(video->decoder->getTimeToNextFrame()); +} + bool VideoPlayer::playFrame(int slot, Properties &properties) { Video *video = getVideoBySlot(slot); if (!video) @@ -353,7 +362,7 @@ bool VideoPlayer::playFrame(int slot, Properties &properties) { _vm->_palAnim->fade(_vm->_global->_pPaletteDesc, -2, 0); } - if (primary) + if (primary && properties.waitEndFrame) checkAbort(*video, properties); return true; @@ -445,6 +454,14 @@ uint16 VideoPlayer::getDefaultY(int slot) const { return video->decoder->getDefaultY(); } +const Common::List<Common::Rect> *VideoPlayer::getDirtyRects(int slot) const { + const Video *video = getVideoBySlot(slot); + if (!video) + return 0; + + return &video->decoder->getDirtyRects(); +} + bool VideoPlayer::hasEmbeddedFile(const Common::String &fileName, int slot) const { const Video *video = getVideoBySlot(slot); if (!video) |