aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Hoops2012-08-17 23:31:26 -0400
committerMatthew Hoops2012-08-17 23:31:26 -0400
commitda9695ddc6a46c709753026055d6060746006c2c (patch)
treea43b089c44365614a86f82fe7353a04c98f57e36
parente24fd2ffe66f17e0b5e3f58871ca22586cad757e (diff)
downloadscummvm-rg350-da9695ddc6a46c709753026055d6060746006c2c.tar.gz
scummvm-rg350-da9695ddc6a46c709753026055d6060746006c2c.tar.bz2
scummvm-rg350-da9695ddc6a46c709753026055d6060746006c2c.zip
AGOS: Fix regressions in the feeble demo
-rw-r--r--engines/agos/animation.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/engines/agos/animation.cpp b/engines/agos/animation.cpp
index 10f274b37f..cf12ee120a 100644
--- a/engines/agos/animation.cpp
+++ b/engines/agos/animation.cpp
@@ -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;
}