aboutsummaryrefslogtreecommitdiff
path: root/engines/sword2
diff options
context:
space:
mode:
authorTorbjörn Andersson2007-04-14 14:07:11 +0000
committerTorbjörn Andersson2007-04-14 14:07:11 +0000
commit4b4d7dec8ef1483c81221027ffb6d3a5c2f8ee9f (patch)
tree0882b810fab56f933d0d86a9ff0328f04f5e6350 /engines/sword2
parent2d2b3d0ed21ec800a8a87f9fde8d27206a0dc9c7 (diff)
downloadscummvm-rg350-4b4d7dec8ef1483c81221027ffb6d3a5c2f8ee9f.tar.gz
scummvm-rg350-4b4d7dec8ef1483c81221027ffb6d3a5c2f8ee9f.tar.bz2
scummvm-rg350-4b4d7dec8ef1483c81221027ffb6d3a5c2f8ee9f.zip
I must have accidentally broken frame skipping when I added DXA playback. Made
frame skipping actually skip the updateScreen() call. svn-id: r26469
Diffstat (limited to 'engines/sword2')
-rw-r--r--engines/sword2/animation.cpp19
-rw-r--r--engines/sword2/animation.h4
2 files changed, 13 insertions, 10 deletions
diff --git a/engines/sword2/animation.cpp b/engines/sword2/animation.cpp
index 3afd8b8748..8424e9c768 100644
--- a/engines/sword2/animation.cpp
+++ b/engines/sword2/animation.cpp
@@ -169,12 +169,12 @@ bool MoviePlayer::checkSkipFrame() {
return true;
}
-void MoviePlayer::syncFrame() {
+bool MoviePlayer::syncFrame() {
_ticks += 83;
if (checkSkipFrame()) {
warning("Skipped frame %d", _currentFrame);
- return;
+ return false;
}
if (_bgSoundStream) {
@@ -192,6 +192,8 @@ void MoviePlayer::syncFrame() {
_system->delayMillis(10);
}
}
+
+ return true;
}
void MoviePlayer::drawFrame() {
@@ -403,9 +405,10 @@ void MoviePlayer::play(SequenceTextInfo *textList, uint32 numLines, int32 leadIn
_vm->_sound->playMovieSound(leadOut, kLeadOutSound);
}
- syncFrame();
- drawFrame();
- updateScreen();
+ if (syncFrame()) {
+ drawFrame();
+ updateScreen();
+ }
Common::Event event;
@@ -809,13 +812,13 @@ bool MoviePlayerDummy::decodeFrame() {
return true;
}
-void MoviePlayerDummy::syncFrame() {
+bool MoviePlayerDummy::syncFrame() {
if (_numSpeechLines == 0 || _currentFrame < _firstSpeechFrame) {
_ticks = _system->getMillis();
- return;
+ return false;
}
- MoviePlayer::syncFrame();
+ return MoviePlayer::syncFrame();
}
void MoviePlayerDummy::drawFrame() {
diff --git a/engines/sword2/animation.h b/engines/sword2/animation.h
index 5c1715a08f..4d3660026d 100644
--- a/engines/sword2/animation.h
+++ b/engines/sword2/animation.h
@@ -106,7 +106,7 @@ protected:
virtual void clearFrame();
virtual void updateScreen();
virtual bool decodeFrame() = 0;
- virtual void syncFrame();
+ virtual bool syncFrame();
virtual void drawFrame();
virtual void drawTextObject();
virtual void undrawTextObject();
@@ -123,7 +123,7 @@ public:
class MoviePlayerDummy : public MoviePlayer {
protected:
bool decodeFrame();
- void syncFrame();
+ bool syncFrame();
void drawFrame();
void drawTextObject();
void undrawTextObject();