diff options
author | Travis Howell | 2008-12-15 05:05:01 +0000 |
---|---|---|
committer | Travis Howell | 2008-12-15 05:05:01 +0000 |
commit | 1c9db8eebc9901aabbd07df714e236d3a09836f3 (patch) | |
tree | 14db510effd61949a286ef19bd772c863b56cfeb /graphics | |
parent | 0eee8012616e3128dfbbe50d3f29330bc8ab00e3 (diff) | |
download | scummvm-rg350-1c9db8eebc9901aabbd07df714e236d3a09836f3.tar.gz scummvm-rg350-1c9db8eebc9901aabbd07df714e236d3a09836f3.tar.bz2 scummvm-rg350-1c9db8eebc9901aabbd07df714e236d3a09836f3.zip |
Adjust return values for HE games, when loading video file fails.
svn-id: r35374
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 |