aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMatthew Hoops2011-05-18 09:56:59 -0400
committerMatthew Hoops2011-05-18 10:05:14 -0400
commit14e1cc728f0e7233dfecce6c58ebfa319512152b (patch)
treec4a37788d59e31cf14fc85ddedd9932fcd1a44b0 /engines
parentaffb6a38a198d410922492026e5277794a310279 (diff)
downloadscummvm-rg350-14e1cc728f0e7233dfecce6c58ebfa319512152b.tar.gz
scummvm-rg350-14e1cc728f0e7233dfecce6c58ebfa319512152b.tar.bz2
scummvm-rg350-14e1cc728f0e7233dfecce6c58ebfa319512152b.zip
SWORD25: Properly use endOfVideo()
Diffstat (limited to 'engines')
-rw-r--r--engines/sword25/fmv/movieplayer.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/engines/sword25/fmv/movieplayer.cpp b/engines/sword25/fmv/movieplayer.cpp
index c60f5d4cbf..d267506ae2 100644
--- a/engines/sword25/fmv/movieplayer.cpp
+++ b/engines/sword25/fmv/movieplayer.cpp
@@ -119,21 +119,23 @@ bool MoviePlayer::pause() {
void MoviePlayer::update() {
if (_decoder.isVideoLoaded()) {
- const Graphics::Surface *s = _decoder.decodeNextFrame();
- if (s) {
- // Transfer the next frame
- assert(s->format.bytesPerPixel == 4);
+ if (_decoder.endOfVideo()) {
+ // Movie complete, so unload the movie
+ unloadMovie();
+ } else {
+ const Graphics::Surface *s = _decoder.decodeNextFrame();
+ if (s) {
+ // Transfer the next frame
+ assert(s->format.bytesPerPixel == 4);
#ifdef THEORA_INDIRECT_RENDERING
- byte *frameData = (byte *)s->getBasePtr(0, 0);
- _outputBitmap->setContent(frameData, s->pitch * s->h, 0, s->pitch);
+ byte *frameData = (byte *)s->getBasePtr(0, 0);
+ _outputBitmap->setContent(frameData, s->pitch * s->h, 0, s->pitch);
#else
- g_system->copyRectToScreen((byte *)s->getBasePtr(0, 0), s->pitch, _outX, _outY, MIN(s->w, _backSurface->w), MIN(s->h, _backSurface->h));
- g_system->updateScreen();
+ g_system->copyRectToScreen((byte *)s->getBasePtr(0, 0), s->pitch, _outX, _outY, MIN(s->w, _backSurface->w), MIN(s->h, _backSurface->h));
+ g_system->updateScreen();
#endif
- } else {
- // Movie complete, so unload the movie
- unloadMovie();
+ }
}
}
}