From aa113e5ab3b6e96ff6d2b56839b7ac08ec0617cc Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Sun, 8 Aug 2010 00:39:32 +0000 Subject: VIDEO: Add CoktelDecoder::setFrameRate(). Allows client code to overwrite the video's frame rate. svn-id: r51860 --- graphics/video/coktel_decoder.cpp | 9 ++++++++- graphics/video/coktel_decoder.h | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'graphics/video') 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 &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 &getDirtyRects() const; -- cgit v1.2.3