diff options
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; |