diff options
-rw-r--r-- | engines/tucker/sequences.cpp | 8 | ||||
-rw-r--r-- | graphics/video/flic_player.cpp | 2 | ||||
-rw-r--r-- | graphics/video/flic_player.h | 40 |
3 files changed, 41 insertions, 9 deletions
diff --git a/engines/tucker/sequences.cpp b/engines/tucker/sequences.cpp index edcb60c312..8fb06403c4 100644 --- a/engines/tucker/sequences.cpp +++ b/engines/tucker/sequences.cpp @@ -896,7 +896,7 @@ void AnimationSequencePlayer::openAnimation(int index, const char *fileName) { _seqNum = 1; return; } - _flicPlayer[index].decodeFrame(); + _flicPlayer[index].decodeNextFrame(); if (index == 0) { memcpy(_animationPalette, _flicPlayer[index].getPalette(), 1024); memcpy(_offscreenBuffer, _flicPlayer[index].getOffscreen(), kScreenWidth * kScreenHeight); @@ -904,7 +904,7 @@ void AnimationSequencePlayer::openAnimation(int index, const char *fileName) { } void AnimationSequencePlayer::decodeNextAnimationFrame(int index) { - _flicPlayer[index].decodeFrame(); + _flicPlayer[index].decodeNextFrame(); memcpy(_offscreenBuffer, _flicPlayer[index].getOffscreen(), kScreenWidth * kScreenHeight); if (index == 0) { if (_flicPlayer[index].isPaletteDirty()) { @@ -940,12 +940,12 @@ void AnimationSequencePlayer::introSeq19_20() { _newSeq = false; } if (_flicPlayer[0].getCurFrame() >= 116) { - _flicPlayer[1].decodeFrame(); + _flicPlayer[1].decodeNextFrame(); if (_flicPlayer[1].isLastFrame()) { _flicPlayer[1].reset(); } } - _flicPlayer[0].decodeFrame(); + _flicPlayer[0].decodeNextFrame(); const uint8 *t = _flicPlayer[1].getOffscreen(); for (int i = 0; i < 64000; ++i) { const uint8 color = _flicPlayer[0].getOffscreen()[i]; diff --git a/graphics/video/flic_player.cpp b/graphics/video/flic_player.cpp index d4a8ede4f8..e07c815390 100644 --- a/graphics/video/flic_player.cpp +++ b/graphics/video/flic_player.cpp @@ -190,7 +190,7 @@ void FlicPlayer::decodeDeltaFLC(uint8 *data) { #define PSTAMP 18 #define FRAME_TYPE 0xF1FA -void FlicPlayer::decodeFrame() { +void FlicPlayer::decodeNextFrame() { FrameTypeChunkHeader frameHeader; // Read chunk diff --git a/graphics/video/flic_player.h b/graphics/video/flic_player.h index ef2b6d67ba..c453bf91c5 100644 --- a/graphics/video/flic_player.h +++ b/graphics/video/flic_player.h @@ -63,14 +63,46 @@ public: FlicPlayer(); ~FlicPlayer(); - bool loadFile(const char *fileName); - void closeFile(); - void decodeFrame(); + /** + * Returns the width of the video + * @return the width of the video + */ int getWidth() const { return _flicInfo.width; } + + /** + * Returns the height of the video + * @return the height of the video + */ int getHeight() const { return _flicInfo.height; } - bool hasFrames() const { return _flicInfo.numFrames > 0; } + + /** + * Returns the current frame number of the video + * @return the current frame number of the video + */ int getCurFrame() const { return _currFrame; } + + /** + * Returns the amount of frames in the video + * @return the amount of frames in the video + */ int getFrameCount() const { return _flicInfo.numFrames; } + + /** + * Load a FLIC encoded video file + * @param filename the filename to load + */ + bool loadFile(const char *fileName); + + /** + * Close a FLIC encoded video file + */ + void closeFile(); + + /** + * Decode the next frame + */ + void decodeNextFrame(); + bool isLastFrame() const { return _currFrame == _flicInfo.numFrames; } uint32 getSpeed() const { return _flicInfo.speed; } bool isPaletteDirty() const { return _paletteDirty; } |