diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-08-26 18:50:34 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-08-26 18:50:34 +0000 |
commit | ef82a7df8aafb569f6db5e77ff2dd67fde860148 (patch) | |
tree | 202a461e6d9d426ef1d080ec554334a195fa709a /src/player.cpp | |
parent | c3a3b608b3f9a7b2edb3a7132af5dffde1a9e3c2 (diff) | |
download | mana-ef82a7df8aafb569f6db5e77ff2dd67fde860148.tar.gz mana-ef82a7df8aafb569f6db5e77ff2dd67fde860148.tar.bz2 mana-ef82a7df8aafb569f6db5e77ff2dd67fde860148.tar.xz mana-ef82a7df8aafb569f6db5e77ff2dd67fde860148.zip |
Applied patch by Bahamut81 which implements resetting of Animation, Action and
AnimatedSprite. This fixes the animation synchronization issues.
Diffstat (limited to 'src/player.cpp')
-rw-r--r-- | src/player.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/player.cpp b/src/player.cpp index 3fe608c7..1658840a 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -98,6 +98,7 @@ Player::setSex(Uint8 sex) mSprites[BASE_SPRITE] = new AnimatedSprite( "graphics/sprites/player_female_base.xml", 0); } + resetAnimations(); } Being::setSex(sex); } @@ -114,6 +115,7 @@ Player::setHairColor(Uint16 color) newHairSprite->setDirection(getSpriteDirection()); mSprites[HAIR_SPRITE] = newHairSprite; + resetAnimations(); setAction(mAction); } @@ -133,6 +135,7 @@ Player::setHairStyle(Uint16 style) newHairSprite->setDirection(getSpriteDirection()); mSprites[HAIR_SPRITE] = newHairSprite; + resetAnimations(); setAction(mAction); } @@ -170,6 +173,7 @@ Player::setVisibleEquipment(Uint8 slot, Uint8 id) equipmentSprite->setDirection(getSpriteDirection()); mSprites[position] = equipmentSprite; + resetAnimations(); setAction(mAction); } @@ -177,4 +181,14 @@ Player::setVisibleEquipment(Uint8 slot, Uint8 id) Being::setVisibleEquipment(slot, id); } - +void +Player::resetAnimations() +{ + for (int i = 0; i < VECTOREND_SPRITE; i++) + { + if (mSprites[i] != NULL) + { + mSprites[i]->reset(); + } + } +} |