aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/videoplayer.cpp
diff options
context:
space:
mode:
authorSven Hesse2011-01-22 19:28:23 +0000
committerSven Hesse2011-01-22 19:28:23 +0000
commit0722df94721e6e356bd126bdb97f51b9a4a0ef1e (patch)
treeb2b83f9fb9e31995d9db2cdea589de161e988b34 /engines/gob/videoplayer.cpp
parent66a715ea99f0c6afccf3e95bdbd058cdd958c15d (diff)
downloadscummvm-rg350-0722df94721e6e356bd126bdb97f51b9a4a0ef1e.tar.gz
scummvm-rg350-0722df94721e6e356bd126bdb97f51b9a4a0ef1e.tar.bz2
scummvm-rg350-0722df94721e6e356bd126bdb97f51b9a4a0ef1e.zip
GOB: Hacking in multiple live videos
Needed for Bambou. The narrator voice and the "Do you want to quit?" voices are live videos that should continue while the live video buttons are playing. svn-id: r55443
Diffstat (limited to 'engines/gob/videoplayer.cpp')
-rw-r--r--engines/gob/videoplayer.cpp57
1 files changed, 41 insertions, 16 deletions
diff --git a/engines/gob/videoplayer.cpp b/engines/gob/videoplayer.cpp
index 7233b7fe95..f279cb9744 100644
--- a/engines/gob/videoplayer.cpp
+++ b/engines/gob/videoplayer.cpp
@@ -222,6 +222,22 @@ bool VideoPlayer::closeVideo(int slot) {
return true;
}
+void VideoPlayer::closeLiveSound() {
+ for (int i = 1; i < kVideoSlotCount; i++) {
+ Video *video = getVideoBySlot(i);
+ if (!video)
+ continue;
+
+ if (video->live)
+ closeVideo(i);
+ }
+}
+
+void VideoPlayer::closeAll() {
+ for (int i = 0; i < kVideoSlotCount; i++)
+ closeVideo(i);
+}
+
bool VideoPlayer::play(int slot, Properties &properties) {
Video *video = getVideoBySlot(slot);
if (!video)
@@ -253,11 +269,13 @@ bool VideoPlayer::play(int slot, Properties &properties) {
properties.canceled = false;
- if (primary && properties.noBlock) {
- video->live = true;
+ if (properties.noBlock) {
properties.waitEndFrame = false;
- _liveProperties = properties;
- updateLive(true);
+
+ video->live = true;
+ video->properties = properties;
+
+ updateLive(slot, true);
return true;
}
@@ -311,40 +329,47 @@ bool VideoPlayer::isPlayingLive() const {
}
void VideoPlayer::updateLive(bool force) {
- Video *video = getVideoBySlot(0);
+ for (int i = 0; i < kVideoSlotCount; i++)
+ updateLive(i, force);
+}
+
+void VideoPlayer::updateLive(int slot, bool force) {
+ Video *video = getVideoBySlot(slot);
if (!video || !video->live)
return;
- if (_liveProperties.startFrame >= (int32)(video->decoder->getFrameCount() - 1)) {
+ if (video->properties.startFrame >= (int32)(video->decoder->getFrameCount() - 1)) {
// Video ended
- if (!_liveProperties.loop) {
- WRITE_VAR_OFFSET(212, (uint32)-1);
+ if (!video->properties.loop) {
+ if (!(video->properties.flags & kFlagNoVideo))
+ WRITE_VAR_OFFSET(212, (uint32)-1);
_vm->_vidPlayer->closeVideo();
return;
} else {
video->decoder->seek(0, SEEK_SET, true);
- _liveProperties.startFrame = -1;
+ video->properties.startFrame = -1;
}
}
- if (_liveProperties.startFrame == _liveProperties.lastFrame)
+ if (video->properties.startFrame == video->properties.lastFrame)
// Current video sequence ended
return;
if (!force && (video->decoder->getTimeToNextFrame() > 0))
return;
- WRITE_VAR_OFFSET(212, _liveProperties.startFrame + 1);
+ if (!(video->properties.flags & kFlagNoVideo))
+ WRITE_VAR_OFFSET(212, video->properties.startFrame + 1);
- bool backwards = _liveProperties.startFrame > _liveProperties.lastFrame;
- playFrame(0, _liveProperties);
+ bool backwards = video->properties.startFrame > video->properties.lastFrame;
+ playFrame(slot, video->properties);
- _liveProperties.startFrame += backwards ? -1 : 1;
+ video->properties.startFrame += backwards ? -1 : 1;
- if (_liveProperties.fade) {
+ if (video->properties.fade) {
_vm->_palAnim->fade(_vm->_global->_pPaletteDesc, -2, 0);
- _liveProperties.fade = false;
+ video->properties.fade = false;
}
}