diff options
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/smk_player.cpp | 30 | ||||
-rw-r--r-- | graphics/smk_player.h | 10 |
2 files changed, 35 insertions, 5 deletions
diff --git a/graphics/smk_player.cpp b/graphics/smk_player.cpp index 78de65f994..ef206e12d7 100644 --- a/graphics/smk_player.cpp +++ b/graphics/smk_player.cpp @@ -319,6 +319,36 @@ SMKPlayer::~SMKPlayer() { closeFile(); } +int SMKPlayer::getWidth() { + if (!_fileStream) + return 0; + return _header.width; +} + +int SMKPlayer::getHeight() { + if (!_fileStream) + return 0; + return (_header.flags ? 2 : 1) * _header.height; +} + +int32 SMKPlayer::getCurFrame() { + if (!_fileStream) + return -1; + return _currentSMKFrame; +} + +int32 SMKPlayer::getFrameCount() { + if (!_fileStream) + return 0; + return _framesCount; +} + +int32 SMKPlayer::getFrameRate() { + if (!_fileStream) + return 0; + return _header.frameRate; +} + bool SMKPlayer::loadFile(const char *fileName) { closeFile(); diff --git a/graphics/smk_player.h b/graphics/smk_player.h index e230a958bd..11caa25d43 100644 --- a/graphics/smk_player.h +++ b/graphics/smk_player.h @@ -58,31 +58,31 @@ public: * Returns the width of the video * @return the width of the video */ - uint getWidth() { return _header.width; } + int getWidth(); /** * Returns the height of the video * @return the height of the video */ - uint getHeight() { return (_header.flags ? 2 : 1) * _header.height; } + int getHeight(); /** * Returns the current frame number of the video * @return the current frame number of the video */ - uint32 getCurFrame() { return _currentSMKFrame; } + int32 getCurFrame(); /** * Returns the amount of frames in the video * @return the amount of frames in the video */ - uint32 getFrameCount() { return _framesCount; } + int32 getFrameCount(); /** * Returns the frame rate of the video * @return the frame rate of the video */ - int32 getFrameRate() { return _header.frameRate; } + int32 getFrameRate(); /** * Load an SMK encoded video file |