diff options
author | Robert Špalek | 2009-10-30 01:56:52 +0000 |
---|---|---|
committer | Robert Špalek | 2009-10-30 01:56:52 +0000 |
commit | d662c4aa20342e74ed5d82a14e3fc8e62a45ca8c (patch) | |
tree | f75bfb0465e398fac23955f526207ee9b50fec13 /engines/draci/animation.cpp | |
parent | c778efaca5b9d20f73e9d12cc8404d8948f8e522 (diff) | |
download | scummvm-rg350-d662c4aa20342e74ed5d82a14e3fc8e62a45ca8c.tar.gz scummvm-rg350-d662c4aa20342e74ed5d82a14e3fc8e62a45ca8c.tar.bz2 scummvm-rg350-d662c4aa20342e74ed5d82a14e3fc8e62a45ca8c.zip |
Remove the last 2 default parameter values.
They usually just add unnecessary confusion and this is definitely such
an example. Removal will clarify the code.
svn-id: r45512
Diffstat (limited to 'engines/draci/animation.cpp')
-rw-r--r-- | engines/draci/animation.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/engines/draci/animation.cpp b/engines/draci/animation.cpp index 0c1718c1d7..1c729e9c85 100644 --- a/engines/draci/animation.cpp +++ b/engines/draci/animation.cpp @@ -219,18 +219,14 @@ void Animation::setIndex(int index) { _index = index; } -Drawable *Animation::getFrame(int frameNum) { +Drawable *Animation::getCurrentFrame() { // If there are no frames stored, return NULL - if (_frames.size() == 0) { - return NULL; - } + return _frames.size() > 0 ? _frames[_currentFrame] : NULL; +} - // If no argument is passed, return the current frame - if (frameNum == kCurrentFrame) { - return _frames[_currentFrame]; - } else { - return _frames[frameNum]; - } +Drawable *Animation::getFrame(int frameNum) { + // If there are no frames stored, return NULL + return _frames.size() > 0 ? _frames[frameNum] : NULL; } uint Animation::getFrameCount() const { @@ -417,7 +413,7 @@ void AnimationManager::drawScene(Surface *surf) { continue; } - (*it)->nextFrame(); + (*it)->nextFrame(false); (*it)->drawFrame(surf); } } @@ -559,7 +555,7 @@ int AnimationManager::getTopAnimationID(int x, int y) const { continue; } - const Drawable *frame = anim->getFrame(); + const Drawable *frame = anim->getCurrentFrame(); if (frame == NULL) { continue; |