diff options
author | Torbjörn Andersson | 2007-01-18 22:08:02 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2007-01-18 22:08:02 +0000 |
commit | 37f94f7cba8135a8ee28a0ce1fe18337f8b764b6 (patch) | |
tree | 3a07e0ba81d19e95627de8aede26bc41210a80a1 /engines/scumm/smush/smush_player.cpp | |
parent | 2ac841f18bbffa8ce8f05ce19c78e1d27c7a2296 (diff) | |
download | scummvm-rg350-37f94f7cba8135a8ee28a0ce1fe18337f8b764b6.tar.gz scummvm-rg350-37f94f7cba8135a8ee28a0ce1fe18337f8b764b6.tar.bz2 scummvm-rg350-37f94f7cba8135a8ee28a0ce1fe18337f8b764b6.zip |
Hopefully fixed the SAN seeking (used by Full Throttle's bike fighting) that I
accidentally broke when removing the timer callback from the SMUSH player.
svn-id: r25120
Diffstat (limited to 'engines/scumm/smush/smush_player.cpp')
-rw-r--r-- | engines/scumm/smush/smush_player.cpp | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/engines/scumm/smush/smush_player.cpp b/engines/scumm/smush/smush_player.cpp index bd4261d60c..dbcde31597 100644 --- a/engines/scumm/smush/smush_player.cpp +++ b/engines/scumm/smush/smush_player.cpp @@ -1101,6 +1101,8 @@ void SmushPlayer::parseNextFrame() { _base->seek(_seekPos, SEEK_SET); _frame = _seekFrame; + _startFrame = _frame; + _startTime = _vm->_system->getMillis(); _seekPos = -1; } @@ -1307,18 +1309,24 @@ void SmushPlayer::play(const char *filename, int32 speed, int32 offset, int32 st setupAnim(filename); init(speed); - uint32 startTime = _vm->_system->getMillis(); + _startTime = _vm->_system->getMillis(); + _startFrame = startFrame; + _frame = startFrame; _pauseTime = 0; - uint frameNo = 0; int skipped = 0; for (;;) { - uint32 elapsed; + uint32 now, elapsed; bool skipFrame = false; - if (_vm->_mixer->isSoundHandleActive(_compressedFileSoundHandle)) { + if (_insanity) { + // Seeking makes a mess of trying to sync the audio to + // the sound. Synt to time instead. + now = _vm->_system->getMillis() - _pauseTime; + elapsed = now - _startTime; + } else if (_vm->_mixer->isSoundHandleActive(_compressedFileSoundHandle)) { // Compressed SMUSH files. elapsed = _vm->_mixer->getSoundElapsedTime(_compressedFileSoundHandle); } else if (_vm->_mixer->isSoundHandleActive(_IACTchannel)) { @@ -1328,12 +1336,12 @@ void SmushPlayer::play(const char *filename, int32 speed, int32 offset, int32 st // For other SMUSH files, we don't necessarily have any // one channel to sync against, so we have to use // elapsed real time. - uint32 now = _vm->_system->getMillis() - _pauseTime; - elapsed = now - startTime; + now = _vm->_system->getMillis() - _pauseTime; + elapsed = now - _startTime; } - if (elapsed >= (frameNo * 1000) / _speed) { - if (elapsed >= ((frameNo + 1) * 1000) / _speed) + if (elapsed >= ((_frame - _startFrame) * 1000) / _speed) { + if (elapsed >= ((_frame + 1) * 1000) / _speed) skipFrame = true; else skipFrame = false; @@ -1392,7 +1400,6 @@ void SmushPlayer::play(const char *filename, int32 speed, int32 offset, int32 st _inTimer = false; _inTimerCount = 0; #endif - frameNo++; } if (_endOfFile) break; |