summaryrefslogtreecommitdiff
path: root/src/particle.cpp
diff options
context:
space:
mode:
authorPhilipp Sehmisch <crush@themanaworld.org>2008-12-14 04:47:18 +0100
committerIra Rice <irarice@gmail.com>2008-12-14 09:15:39 -0700
commit86f666f90322f5d39aa5d0f0ad973e1df8f744d3 (patch)
tree4e6cf7068960ad6bf33665ed687a36d375afc4eb /src/particle.cpp
parent712744c5c985a906891a41679adbe6468e82649b (diff)
downloadmana-client-86f666f90322f5d39aa5d0f0ad973e1df8f744d3.tar.gz
mana-client-86f666f90322f5d39aa5d0f0ad973e1df8f744d3.tar.bz2
mana-client-86f666f90322f5d39aa5d0f0ad973e1df8f744d3.tar.xz
mana-client-86f666f90322f5d39aa5d0f0ad973e1df8f744d3.zip
Some systactical sugar for 864e33
Diffstat (limited to 'src/particle.cpp')
-rw-r--r--src/particle.cpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/particle.cpp b/src/particle.cpp
index adc4aa5b..f73bd222 100644
--- a/src/particle.cpp
+++ b/src/particle.cpp
@@ -247,11 +247,7 @@ void Particle::moveBy(Vector change)
void Particle::moveTo(float x, float y)
{
- Vector pos;
- pos.x = x;
- pos.y = y;
- pos.z = mPos.z;
- moveTo(pos);
+ moveTo(Vector(x, y, mPos.z));
}
Particle* Particle::addEffect(const std::string &particleEffectFile,
@@ -301,16 +297,13 @@ Particle* Particle::addEffect(const std::string &particleEffectFile,
// Read and set the basic properties of the particle
float offsetX = XML::getFloatProperty(effectChildNode, "position-x", 0);
float offsetY = XML::getFloatProperty(effectChildNode, "position-y", 0);
- float offsetZ = XML::getFloatProperty(effectChildNode, "position-z", 0);
+ float offsetZ = XML::getFloatProperty(effectChildNode, "position-z", 0);
+ Vector position (mPos.x + (float)pixelX + offsetX,
+ mPos.y + (float)pixelY + offsetY,
+ mPos.z + offsetZ);
+ newParticle->moveTo(position);
- Vector position;
- position.x = mPos.x + (float)pixelX + offsetX;
- position.y = mPos.y + (float)pixelY + offsetY;
- position.z = mPos.z + offsetZ;
-
int lifetime = XML::getProperty(effectChildNode, "lifetime", -1);
-
- newParticle->moveTo(position);
newParticle->setLifetime(lifetime);
// Look for additional emitters for this particle