diff options
author | Travis Howell | 2006-04-23 02:44:46 +0000 |
---|---|---|
committer | Travis Howell | 2006-04-23 02:44:46 +0000 |
commit | 0de7374c4c6a7ecd2cdcb29de5606f1ce9c61d69 (patch) | |
tree | cdd17d30b45cbd0706237aac494e969bd56027df /engines/simon | |
parent | f1a318ce150f4c7657278c4827a1e822549919f8 (diff) | |
download | scummvm-rg350-0de7374c4c6a7ecd2cdcb29de5606f1ce9c61d69.tar.gz scummvm-rg350-0de7374c4c6a7ecd2cdcb29de5606f1ce9c61d69.tar.bz2 scummvm-rg350-0de7374c4c6a7ecd2cdcb29de5606f1ce9c61d69.zip |
Read and use frame rate setting for videos
svn-id: r22089
Diffstat (limited to 'engines/simon')
-rw-r--r-- | engines/simon/animation.cpp | 20 | ||||
-rw-r--r-- | engines/simon/animation.h | 1 |
2 files changed, 12 insertions, 9 deletions
diff --git a/engines/simon/animation.cpp b/engines/simon/animation.cpp index 9714958f57..8145fcf045 100644 --- a/engines/simon/animation.cpp +++ b/engines/simon/animation.cpp @@ -65,13 +65,16 @@ bool MoviePlayer::load(const char *filename) { _fd.readByte(); _framesCount = _fd.readUint16BE(); - _frameTicks = _fd.readUint32BE(); - if (_frameTicks > 100) { + _frameRate = _frameTicks = _fd.readUint32BE(); + + if (_frameRate >= 0x80000000) + _frameRate = -_frameRate / 1000; + if (_frameTicks > 100) _frameTicks = 100; - } + _width = _fd.readUint16BE(); _height = _fd.readUint16BE(); - debug(0, "frames_count %d width %d height %d ticks %d", _framesCount, _width, _height, _frameTicks); + debug(0, "frames_count %d width %d height %d rate %d ticks %d", _framesCount, _width, _height, _frameRate, _frameTicks); _frameSize = _width * _height; _frameBuffer1 = (uint8 *)malloc(_frameSize); _frameBuffer2 = (uint8 *)malloc(_frameSize); @@ -243,16 +246,15 @@ void MoviePlayer::processFrame() { else g_system->copyRectToScreen(_frameBuffer1, _width, 128, 100, _width, _height); - // TODO Remove set frame rate, were video files use different rate. - if ((_bgSoundStream == NULL) || ((_mixer->getSoundElapsedTime(_bgSound) * 10) / 1000 < _frameNum + 1) || - _frameSkipped > 10) { - if (_frameSkipped > 10) { + if ((_bgSoundStream == NULL) || ((_mixer->getSoundElapsedTime(_bgSound) * _frameRate) / 1000 < _frameNum + 1) || + _frameSkipped > _frameRate) { + if (_frameSkipped > _frameRate) { warning("force frame %i redraw", _frameNum); _frameSkipped = 0; } if (_bgSoundStream && _mixer->isSoundHandleActive(_bgSound)) { - while (_mixer->isSoundHandleActive(_bgSound) && (_mixer->getSoundElapsedTime(_bgSound) * 10) / 1000 < _frameNum) { + while (_mixer->isSoundHandleActive(_bgSound) && (_mixer->getSoundElapsedTime(_bgSound) * _frameRate) / 1000 < _frameNum) { g_system->delayMillis(10); } // In case the background sound ends prematurely, update diff --git a/engines/simon/animation.h b/engines/simon/animation.h index 78a9ea9974..530c95eaf6 100644 --- a/engines/simon/animation.h +++ b/engines/simon/animation.h @@ -51,6 +51,7 @@ class MoviePlayer { uint32 _frameSize; uint16 _framesCount; uint16 _frameNum; + uint32 _frameRate; uint32 _frameTicks; uint _frameSkipped; uint32 _ticks; |