diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-04-13 03:36:00 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-04-13 03:36:00 +0300 |
commit | c978b7f0d9de1bb6bd84cd299ed80c27c5147927 (patch) | |
tree | 8f1edc2be0816693761ba58aa7c7c554040a7db6 /src/simpleanimation.cpp | |
parent | da1b2d8311ca78eccd3e9875598562ce6bf05cab (diff) | |
download | manaplus-c978b7f0d9de1bb6bd84cd299ed80c27c5147927.tar.gz manaplus-c978b7f0d9de1bb6bd84cd299ed80c27c5147927.tar.bz2 manaplus-c978b7f0d9de1bb6bd84cd299ed80c27c5147927.tar.xz manaplus-c978b7f0d9de1bb6bd84cd299ed80c27c5147927.zip |
Impliment new tags in sprites animations and random condition.
Tags: <label>, <goto>
Diffstat (limited to 'src/simpleanimation.cpp')
-rw-r--r-- | src/simpleanimation.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/simpleanimation.cpp b/src/simpleanimation.cpp index 9931f491c..8d86583eb 100644 --- a/src/simpleanimation.cpp +++ b/src/simpleanimation.cpp @@ -155,6 +155,7 @@ void SimpleAnimation::initializeAnimation(xmlNodePtr animationNode) int delay = XML::getProperty(frameNode, "delay", 0); int offsetX = XML::getProperty(frameNode, "offsetX", 0); int offsetY = XML::getProperty(frameNode, "offsetY", 0); + int rand = XML::getProperty(frameNode, "rand", 100); offsetY -= imageset->getHeight() - 32; offsetX -= imageset->getWidth() / 2 - 16; @@ -177,7 +178,7 @@ void SimpleAnimation::initializeAnimation(xmlNodePtr animationNode) } if (mAnimation) - mAnimation->addFrame(img, delay, offsetX, offsetY); + mAnimation->addFrame(img, delay, offsetX, offsetY, rand); } else if (xmlStrEqual(frameNode->name, BAD_CAST "sequence")) { @@ -201,14 +202,14 @@ void SimpleAnimation::initializeAnimation(xmlNodePtr animationNode) } if (mAnimation) - mAnimation->addFrame(img, delay, offsetX, offsetY); + mAnimation->addFrame(img, delay, offsetX, offsetY, rand); start++; } } else if (xmlStrEqual(frameNode->name, BAD_CAST "end")) { if (mAnimation) - mAnimation->addTerminator(); + mAnimation->addTerminator(rand); } } |