summaryrefslogtreecommitdiff
path: root/src/simpleanimation.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-04-13 03:36:00 +0300
committerAndrei Karas <akaras@inbox.ru>2011-04-13 03:36:00 +0300
commitc978b7f0d9de1bb6bd84cd299ed80c27c5147927 (patch)
tree8f1edc2be0816693761ba58aa7c7c554040a7db6 /src/simpleanimation.cpp
parentda1b2d8311ca78eccd3e9875598562ce6bf05cab (diff)
downloadplus-c978b7f0d9de1bb6bd84cd299ed80c27c5147927.tar.gz
plus-c978b7f0d9de1bb6bd84cd299ed80c27c5147927.tar.bz2
plus-c978b7f0d9de1bb6bd84cd299ed80c27c5147927.tar.xz
plus-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.cpp7
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);
}
}