mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-13 12:39:56 +00:00
SWORD25: Properly use endOfVideo()
This commit is contained in:
parent
affb6a38a1
commit
14e1cc728f
@ -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);
|
||||
|
||||
#ifdef THEORA_INDIRECT_RENDERING
|
||||
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();
|
||||
#endif
|
||||
} else {
|
||||
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);
|
||||
#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();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user