aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorSven Hesse2011-01-20 03:22:43 +0000
committerSven Hesse2011-01-20 03:22:43 +0000
commitd77899e158e2ae2076d7d8185a92c544b4a06351 (patch)
treecf39a6aab4bbccce79d0f4952f33ea1122468fe9 /engines
parent024b7758c5122bae99f1a92fc38fce3ad231d1f6 (diff)
downloadscummvm-rg350-d77899e158e2ae2076d7d8185a92c544b4a06351.tar.gz
scummvm-rg350-d77899e158e2ae2076d7d8185a92c544b4a06351.tar.bz2
scummvm-rg350-d77899e158e2ae2076d7d8185a92c544b4a06351.zip
GOB: Make Urban Runner's "3D view" work again
svn-id: r55340
Diffstat (limited to 'engines')
-rw-r--r--engines/gob/videoplayer.cpp22
-rw-r--r--engines/gob/videoplayer.h2
2 files changed, 17 insertions, 7 deletions
diff --git a/engines/gob/videoplayer.cpp b/engines/gob/videoplayer.cpp
index c22a67ac16..8ac4c47202 100644
--- a/engines/gob/videoplayer.cpp
+++ b/engines/gob/videoplayer.cpp
@@ -246,6 +246,7 @@ bool VideoPlayer::play(int slot, Properties &properties) {
video->live = true;
properties.waitEndFrame = false;
_liveProperties = properties;
+ updateLive(true);
return true;
}
@@ -279,24 +280,33 @@ void VideoPlayer::waitEndFrame(int slot, bool onlySound) {
if (!video)
return;
- if (!onlySound || video->decoder->hasSound())
- _vm->_util->delay(video->decoder->getTimeToNextFrame());
+ if (!onlySound || video->decoder->hasSound()) {
+ uint32 waitTime = video->decoder->getTimeToNextFrame();
+ if (!video->decoder->hasSound())
+ waitTime = video->decoder->getStaticTimeToNextFrame();;
+
+ _vm->_util->delay(waitTime);
+ }
}
-void VideoPlayer::updateLive() {
+void VideoPlayer::updateLive(bool force) {
Video *video = getVideoBySlot(0);
if (!video || !video->live)
return;
- if ((_liveProperties.startFrame == _liveProperties.lastFrame) ||
- (_liveProperties.startFrame >= (int32)(video->decoder->getFrameCount() - 1))) {
+ if (_liveProperties.startFrame >= (int32)(video->decoder->getFrameCount() - 1)) {
+ // Video ended
WRITE_VAR_OFFSET(212, (uint32)-1);
_vm->_vidPlayer->closeVideo();
return;
}
- if (video->decoder->getTimeToNextFrame() > 0)
+ if (_liveProperties.startFrame == _liveProperties.lastFrame)
+ // Current video sequence ended
+ return;
+
+ if (!force && (video->decoder->getTimeToNextFrame() > 0))
return;
WRITE_VAR_OFFSET(212, _liveProperties.startFrame + 1);
diff --git a/engines/gob/videoplayer.h b/engines/gob/videoplayer.h
index 9b68d4a5af..2708ee1c56 100644
--- a/engines/gob/videoplayer.h
+++ b/engines/gob/videoplayer.h
@@ -110,7 +110,7 @@ public:
bool play(int slot, Properties &properties);
void waitEndFrame(int slot, bool onlySound = false);
- void updateLive();
+ void updateLive(bool force = false);
bool slotIsOpen(int slot = 0) const;