diff options
author | Travis Howell | 2008-12-21 05:55:37 +0000 |
---|---|---|
committer | Travis Howell | 2008-12-21 05:55:37 +0000 |
commit | 587e70809a7579539e4666c46a13e0c40d3e9e7b (patch) | |
tree | ea41fca672ce17dd5251d237fe406aa5e60d29a8 /graphics | |
parent | 76624fc69c28bc422076740521e77f2ba83a2320 (diff) | |
download | scummvm-rg350-587e70809a7579539e4666c46a13e0c40d3e9e7b.tar.gz scummvm-rg350-587e70809a7579539e4666c46a13e0c40d3e9e7b.tar.bz2 scummvm-rg350-587e70809a7579539e4666c46a13e0c40d3e9e7b.zip |
Return exact frame rate in Smacker player, and minor cleanup.
svn-id: r35458
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/dxa_player.cpp | 13 | ||||
-rw-r--r-- | graphics/dxa_player.h | 12 | ||||
-rw-r--r-- | graphics/smk_player.cpp | 8 | ||||
-rw-r--r-- | graphics/smk_player.h | 3 |
4 files changed, 32 insertions, 4 deletions
diff --git a/graphics/dxa_player.cpp b/graphics/dxa_player.cpp index 7cc5f05eb7..e4601564aa 100644 --- a/graphics/dxa_player.cpp +++ b/graphics/dxa_player.cpp @@ -88,6 +88,19 @@ int DXAPlayer::getFrameCount() { return _framesCount; } +int DXAPlayer::getFrameRate() { + if (!_fileStream) + return 0; + return _framesPerSec; +} + +int32 DXAPlayer::getFrameDelay() { + if (!_fileStream) + return 0; + + return _frameTicks; +} + bool DXAPlayer::loadFile(const char *fileName) { uint32 tag; int32 frameRate; diff --git a/graphics/dxa_player.h b/graphics/dxa_player.h index 4b0a74fd94..73d6ac7ca4 100644 --- a/graphics/dxa_player.h +++ b/graphics/dxa_player.h @@ -85,6 +85,18 @@ public: int getFrameCount(); /** + * Returns the frame rate of the video + * @return the frame rate of the video + */ + int32 getFrameRate(); + + /** + * Returns the time to wait for each frame in 1/100 ms + * @return the time to wait for each frame in 1/100 ms + */ + int32 getFrameDelay(); + + /** * Load a DXA encoded video file * @param filename the filename to load */ diff --git a/graphics/smk_player.cpp b/graphics/smk_player.cpp index ea4fd45287..ccd366c7c0 100644 --- a/graphics/smk_player.cpp +++ b/graphics/smk_player.cpp @@ -348,7 +348,13 @@ int32 SMKPlayer::getFrameCount() { int32 SMKPlayer::getFrameRate() { if (!_fileStream) return 0; - return _header.frameRate; + + if (_header.frameRate > 0) + return 1000 / _header.frameRate; + else if (_header.frameRate < 0) + return 100000 / (-_header.frameRate); + else + return 10; } int32 SMKPlayer::getFrameDelay() { diff --git a/graphics/smk_player.h b/graphics/smk_player.h index 1b8976203d..b6513d1803 100644 --- a/graphics/smk_player.h +++ b/graphics/smk_player.h @@ -75,9 +75,6 @@ public: /** * Returns the frame rate of the video - * If > 0, fps are 1000 / FrameRate - * If < 0, fps are 100000 / (-FrameRate) - * If 0, fps are 10 * @return the frame rate of the video */ int32 getFrameRate(); |