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/particleemitter.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/particleemitter.cpp')
-rw-r--r-- | src/particleemitter.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/particleemitter.cpp b/src/particleemitter.cpp index b3f8f40d7..1c3e63f30 100644 --- a/src/particleemitter.cpp +++ b/src/particleemitter.cpp @@ -215,6 +215,7 @@ ParticleEmitter::ParticleEmitter(xmlNodePtr emitterNode, Particle *target, 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); if (!imageset) { logger->log1("Error: no valid imageset"); @@ -242,7 +243,8 @@ ParticleEmitter::ParticleEmitter(xmlNodePtr emitterNode, Particle *target, continue; } - mParticleRotation.addFrame(img, delay, offsetX, offsetY); + mParticleRotation.addFrame(img, delay, + offsetX, offsetY, rand); } else if (xmlStrEqual(frameNode->name, BAD_CAST "sequence")) { @@ -266,13 +268,13 @@ ParticleEmitter::ParticleEmitter(xmlNodePtr emitterNode, Particle *target, } mParticleRotation.addFrame(img, delay, - offsetX, offsetY); + offsetX, offsetY, rand); start++; } } else if (xmlStrEqual(frameNode->name, BAD_CAST "end")) { - mParticleRotation.addTerminator(); + mParticleRotation.addTerminator(rand); } } // for frameNode } @@ -296,6 +298,7 @@ ParticleEmitter::ParticleEmitter(xmlNodePtr emitterNode, Particle *target, 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; @@ -317,7 +320,8 @@ ParticleEmitter::ParticleEmitter(xmlNodePtr emitterNode, Particle *target, continue; } - mParticleAnimation.addFrame(img, delay, offsetX, offsetY); + mParticleAnimation.addFrame(img, delay, + offsetX, offsetY, rand); } else if (xmlStrEqual(frameNode->name, BAD_CAST "sequence")) { @@ -341,13 +345,13 @@ ParticleEmitter::ParticleEmitter(xmlNodePtr emitterNode, Particle *target, } mParticleAnimation.addFrame(img, delay, - offsetX, offsetY); + offsetX, offsetY, rand); start++; } } else if (xmlStrEqual(frameNode->name, BAD_CAST "end")) { - mParticleAnimation.addTerminator(); + mParticleAnimation.addTerminator(rand); } } // for frameNode } |