aboutsummaryrefslogtreecommitdiff
path: root/engines/draci
diff options
context:
space:
mode:
authorDenis Kasak2009-07-29 00:46:36 +0000
committerDenis Kasak2009-07-29 00:46:36 +0000
commit33af83c65070458339a04d32db3e81260491641e (patch)
treeb596dd6e2f30709735829b9f549a6ea248b89ed1 /engines/draci
parent5a44af4433cb61607c39894d87291d33b2d4010c (diff)
downloadscummvm-rg350-33af83c65070458339a04d32db3e81260491641e.tar.gz
scummvm-rg350-33af83c65070458339a04d32db3e81260491641e.tar.bz2
scummvm-rg350-33af83c65070458339a04d32db3e81260491641e.zip
* Added method Animation::currentFrameNum()
* Renamed Animation::getFramesNum() to Animation::getFrameCount() for clarity. svn-id: r42873
Diffstat (limited to 'engines/draci')
-rw-r--r--engines/draci/animation.cpp14
-rw-r--r--engines/draci/animation.h3
2 files changed, 11 insertions, 6 deletions
diff --git a/engines/draci/animation.cpp b/engines/draci/animation.cpp
index 49a59b2b71..6cde72a9d2 100644
--- a/engines/draci/animation.cpp
+++ b/engines/draci/animation.cpp
@@ -85,7 +85,7 @@ void Animation::markDirtyRect(Surface *surface) {
void Animation::nextFrame(bool force) {
// If there's only one or no frames, or if the animation is not playing, return
- if (getFramesNum() < 2 || !_playing)
+ if (getFrameCount() < 2 || !_playing)
return;
Drawable *frame = _frames[_currentFrame];
@@ -94,7 +94,7 @@ void Animation::nextFrame(bool force) {
if (force || (_tick + frame->getDelay() <= _vm->_system->getMillis())) {
// If we are at the last frame and not looping, stop the animation
// The animation is also restarted to frame zero
- if ((_currentFrame == getFramesNum() - 1) && !_looping) {
+ if ((_currentFrame == getFrameCount() - 1) && !_looping) {
// When the animation reaches its end, stop it
_vm->_anims->stop(_id);
@@ -120,7 +120,7 @@ void Animation::nextFrame(bool force) {
uint Animation::nextFrameNum() {
- if ((_currentFrame == getFramesNum() - 1) && _looping)
+ if ((_currentFrame == getFrameCount() - 1) && _looping)
return 0;
else
return _currentFrame + 1;
@@ -249,10 +249,14 @@ Drawable *Animation::getFrame(int frameNum) {
}
}
-uint Animation::getFramesNum() {
+uint Animation::getFrameCount() {
return _frames.size();
}
+uint Animation::currentFrameNum() {
+ return _currentFrame;
+}
+
void Animation::deleteFrames() {
// If there are no frames to delete, return
@@ -262,7 +266,7 @@ void Animation::deleteFrames() {
markDirtyRect(_vm->_screen->getSurface());
- for (int i = getFramesNum() - 1; i >= 0; --i) {
+ for (int i = getFrameCount() - 1; i >= 0; --i) {
delete _frames[i];
_frames.pop_back();
}
diff --git a/engines/draci/animation.h b/engines/draci/animation.h
index 66b16647bd..6642107b25 100644
--- a/engines/draci/animation.h
+++ b/engines/draci/animation.h
@@ -67,7 +67,8 @@ public:
void addFrame(Drawable *frame);
Drawable *getFrame(int frameNum = kCurrentFrame);
- uint getFramesNum();
+ uint currentFrameNum();
+ uint getFrameCount();
void deleteFrames();
bool isPlaying();