summaryrefslogtreecommitdiff
path: root/src/actorsprite.cpp
diff options
context:
space:
mode:
authorChuck Miller <shadowmil@gmail.com>2010-06-19 04:23:20 -0400
committerChuck Miller <shadowmil@gmail.com>2010-06-19 05:09:32 -0400
commitceab31510f4c419ba3d68b25633504890db483f6 (patch)
tree7c6ced85c1966b2a8ee0810dc7abfe817e2f8d1d /src/actorsprite.cpp
parente8bea8a6edf69e824a922adeb5e697111ceabe90 (diff)
downloadmana-client-ceab31510f4c419ba3d68b25633504890db483f6.tar.gz
mana-client-ceab31510f4c419ba3d68b25633504890db483f6.tar.bz2
mana-client-ceab31510f4c419ba3d68b25633504890db483f6.tar.xz
mana-client-ceab31510f4c419ba3d68b25633504890db483f6.zip
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
Diffstat (limited to 'src/actorsprite.cpp')
-rw-r--r--src/actorsprite.cpp15
1 files 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)));
}