From ceab31510f4c419ba3d68b25633504890db483f6 Mon Sep 17 00:00:00 2001 From: Chuck Miller Date: Sat, 19 Jun 2010 04:23:20 -0400 Subject: This fixes the animation for target cursors Also it should optimize it a bit since it only updates used target cursors instead of all target cursors. Reviewed-by: Freeyorp --- src/actorsprite.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/actorsprite.cpp b/src/actorsprite.cpp index 1104d810..13b7abf2 100644 --- a/src/actorsprite.cpp +++ b/src/actorsprite.cpp @@ -77,7 +77,11 @@ bool ActorSprite::draw(Graphics *graphics, int offsetX, int offsetY) const ((Net::getNetworkType() == ServerInfo::MANASERV) ? 15 : 32); if (mUsedTargetCursor) + { + mUsedTargetCursor->reset(); + mUsedTargetCursor->update(tick_time * MILLISECONDS_IN_A_TICK); mUsedTargetCursor->draw(graphics, px, py); + } return drawSpriteAt(graphics, px, py); } @@ -111,15 +115,6 @@ void ActorSprite::logic() void ActorSprite::actorLogic() { - // Update sprite animations - for (int size = TC_SMALL; size < NUM_TC; size++) - { - for (int type = TCT_NORMAL; type < NUM_TCT; type++) - { - if (targetCursor[type][size]) - targetCursor[type][size]->update(tick_time * MILLISECONDS_IN_A_TICK); - } - } } void ActorSprite::setMap(Map* map) @@ -441,7 +436,7 @@ void ActorSprite::loadTargetCursor(const std::string &filename, for (unsigned int i = 0; i < currentImageSet->size(); ++i) { - anim->addFrame(currentImageSet->get(i), 750, + anim->addFrame(currentImageSet->get(i), 75, (16 - (currentImageSet->getWidth() / 2)), (16 - (currentImageSet->getHeight() / 2))); } -- cgit v1.2.3-70-g09d2