diff options
author | Sven Hesse | 2010-08-08 00:39:32 +0000 |
---|---|---|
committer | Sven Hesse | 2010-08-08 00:39:32 +0000 |
commit | aa113e5ab3b6e96ff6d2b56839b7ac08ec0617cc (patch) | |
tree | 8813dc4a979777aeef2ed59de97c422f7bd64aec /graphics/video | |
parent | f7363fdb10675bf27c1a1d37d23a25590bdc344c (diff) | |
download | scummvm-rg350-aa113e5ab3b6e96ff6d2b56839b7ac08ec0617cc.tar.gz scummvm-rg350-aa113e5ab3b6e96ff6d2b56839b7ac08ec0617cc.tar.bz2 scummvm-rg350-aa113e5ab3b6e96ff6d2b56839b7ac08ec0617cc.zip |
VIDEO: Add CoktelDecoder::setFrameRate().
Allows client code to overwrite the video's frame rate.
svn-id: r51860
Diffstat (limited to 'graphics/video')
-rw-r--r-- | graphics/video/coktel_decoder.cpp | 9 | ||||
-rw-r--r-- | graphics/video/coktel_decoder.h | 3 |
2 files changed, 11 insertions, 1 deletions
diff --git a/graphics/video/coktel_decoder.cpp b/graphics/video/coktel_decoder.cpp index a9a2e157a3..9e4fc1edc6 100644 --- a/graphics/video/coktel_decoder.cpp +++ b/graphics/video/coktel_decoder.cpp @@ -35,7 +35,7 @@ CoktelDecoder::State::State() : flags(0), speechId(0) { CoktelDecoder::CoktelDecoder(Audio::Mixer &mixer, Audio::Mixer::SoundType soundType) : _mixer(&mixer), _soundType(soundType), _width(0), _height(0), _x(0), _y(0), _frameCount(0), - _paletteDirty(false), _ownSurface(true) { + _paletteDirty(false), _ownSurface(true), _frameRate(12) { memset(_palette, 0, 768); } @@ -97,6 +97,10 @@ void CoktelDecoder::setXY(uint16 x, uint16 y) { _y = y; } +void CoktelDecoder::setFrameRate(Common::Rational frameRate) { + _frameRate = frameRate; +} + const Common::List<Common::Rect> &CoktelDecoder::getDirtyRects() const { return _dirtyRects; } @@ -235,6 +239,9 @@ Surface *PreIMDDecoder::decodeNextFrame() { _curFrame++; + if (_curFrame == 0) + _startTime = g_system->getMillis(); + return &_surface; } diff --git a/graphics/video/coktel_decoder.h b/graphics/video/coktel_decoder.h index ea405974d6..6a0ff28762 100644 --- a/graphics/video/coktel_decoder.h +++ b/graphics/video/coktel_decoder.h @@ -67,6 +67,9 @@ public: /** Draw the video starting at this position within the video memory. */ void setXY(uint16 x, uint16 y); + /** Override the video's frame rate. */ + void setFrameRate(Common::Rational frameRate); + /** Return a list of rectangles that changed in the last frame. */ const Common::List<Common::Rect> &getDirtyRects() const; |