AGOS: Fix regressions in the feeble demo

This commit is contained in:
Matthew Hoops 2012-08-17 23:31:26 -04:00
parent e24fd2ffe6
commit da9695ddc6

View File

@ -268,6 +268,10 @@ void MoviePlayerDXA::copyFrameToBuffer(byte *dst, uint x, uint y, uint pitch) {
uint w = getWidth();
const Graphics::Surface *surface = decodeNextFrame();
if (!surface)
return;
byte *src = (byte *)surface->pixels;
dst += y * pitch + x;
@ -289,6 +293,8 @@ void MoviePlayerDXA::playVideo() {
_vm->clearSurfaces();
}
start();
while (!endOfVideo() && !_skipMovie && !_vm->shouldQuit())
handleNextFrame();
}
@ -421,8 +427,6 @@ bool MoviePlayerSMK::load() {
if (!loadStream(videoStream))
error("Failed to load video stream from file %s", videoName.c_str());
start();
debug(0, "Playing video %s", videoName.c_str());
CursorMan.showMouse(false);
@ -435,6 +439,10 @@ void MoviePlayerSMK::copyFrameToBuffer(byte *dst, uint x, uint y, uint pitch) {
uint w = getWidth();
const Graphics::Surface *surface = decodeNextFrame();
if (!surface)
return;
byte *src = (byte *)surface->pixels;
dst += y * pitch + x;
@ -449,6 +457,8 @@ void MoviePlayerSMK::copyFrameToBuffer(byte *dst, uint x, uint y, uint pitch) {
}
void MoviePlayerSMK::playVideo() {
start();
while (!endOfVideo() && !_skipMovie && !_vm->shouldQuit())
handleNextFrame();
}
@ -491,7 +501,7 @@ bool MoviePlayerSMK::processFrame() {
uint32 waitTime = getTimeToNextFrame();
if (!waitTime) {
if (!waitTime && !endOfVideoTracks()) {
warning("dropped frame %i", getCurFrame());
return false;
}