Adjust return values for HE games, when loading video file fails.

svn-id: r35374
This commit is contained in:
Travis Howell 2008-12-15 05:05:01 +00:00
parent 0eee801261
commit 1c9db8eebc
2 changed files with 35 additions and 5 deletions

View file

@ -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();

View file

@ -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