[Scummvm-cvs-logs] SF.net SVN: scummvm:[55359] scummvm/trunk
drmccoy at users.sourceforge.net
drmccoy at users.sourceforge.net
Thu Jan 20 19:17:39 CET 2011
Revision: 55359
http://scummvm.svn.sourceforge.net/scummvm/?rev=55359&view=rev
Author: drmccoy
Date: 2011-01-20 18:17:39 +0000 (Thu, 20 Jan 2011)
Log Message:
-----------
GOB: Implement looping live videos
Needed for the buttons in the Playtoons series
Modified Paths:
--------------
scummvm/trunk/engines/gob/inter_v6.cpp
scummvm/trunk/engines/gob/videoplayer.cpp
scummvm/trunk/engines/gob/videoplayer.h
scummvm/trunk/graphics/video/coktel_decoder.cpp
Modified: scummvm/trunk/engines/gob/inter_v6.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_v6.cpp 2011-01-20 17:08:14 UTC (rev 55358)
+++ scummvm/trunk/engines/gob/inter_v6.cpp 2011-01-20 18:17:39 UTC (rev 55359)
@@ -153,8 +153,10 @@
} else if (props.lastFrame <= -10) {
_vm->_vidPlayer->closeVideo();
- if (props.lastFrame <= -100)
+ if (props.lastFrame <= -100) {
+ props.loop = true;
props.lastFrame += 100;
+ }
if (((-props.lastFrame) % 10 == 3) && (props.lastFrame <= -20))
_vm->_sound->bgPlay(fileName, SOUND_WAV);
Modified: scummvm/trunk/engines/gob/videoplayer.cpp
===================================================================
--- scummvm/trunk/engines/gob/videoplayer.cpp 2011-01-20 17:08:14 UTC (rev 55358)
+++ scummvm/trunk/engines/gob/videoplayer.cpp 2011-01-20 18:17:39 UTC (rev 55359)
@@ -40,7 +40,7 @@
x(-1), y(-1), width(-1), height(-1), flags(kFlagFrontSurface), switchColorMode(false),
startFrame(-1), lastFrame(-1), endFrame(-1), forceSeek(false),
breakKey(kShortKeyEscape), palCmd(8), palStart(0), palEnd(255), palFrame(-1),
- fade(false), waitEndFrame(true), canceled(false) {
+ loop(false), fade(false), waitEndFrame(true), canceled(false) {
}
@@ -313,11 +313,16 @@
if (_liveProperties.startFrame >= (int32)(video->decoder->getFrameCount() - 1)) {
// Video ended
- WRITE_VAR_OFFSET(212, (uint32)-1);
- if (video->surface == _vm->_draw->_frontSurface)
- _vm->_draw->forceBlit(true);
- _vm->_vidPlayer->closeVideo();
- return;
+ if (!_liveProperties.loop) {
+ WRITE_VAR_OFFSET(212, (uint32)-1);
+ if (video->surface == _vm->_draw->_frontSurface)
+ _vm->_draw->forceBlit(true);
+ _vm->_vidPlayer->closeVideo();
+ return;
+ } else {
+ video->decoder->seek(0, SEEK_SET, true);
+ _liveProperties.startFrame = -1;
+ }
}
if (_liveProperties.startFrame == _liveProperties.lastFrame)
Modified: scummvm/trunk/engines/gob/videoplayer.h
===================================================================
--- scummvm/trunk/engines/gob/videoplayer.h 2011-01-20 17:08:14 UTC (rev 55358)
+++ scummvm/trunk/engines/gob/videoplayer.h 2011-01-20 18:17:39 UTC (rev 55359)
@@ -90,6 +90,7 @@
int16 palEnd; ///< Palette entry to end at.
int32 palFrame; ///< Frame to apply the palette command at.
+ bool loop; ///< Loop the video?
bool fade; ///< Fade in?
bool waitEndFrame; ///< Wait for the frame's time to run out?
Modified: scummvm/trunk/graphics/video/coktel_decoder.cpp
===================================================================
--- scummvm/trunk/graphics/video/coktel_decoder.cpp 2011-01-20 17:08:14 UTC (rev 55358)
+++ scummvm/trunk/graphics/video/coktel_decoder.cpp 2011-01-20 18:17:39 UTC (rev 55359)
@@ -1562,6 +1562,7 @@
// Seek
_stream->seek(_frames[frame + 1].offset);
_curFrame = frame;
+ _startTime = g_system->getMillis() - ((frame + 2) * getStaticTimeToNextFrame());
_subtitle = -1;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list