diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-04-12 18:39:00 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-04-12 18:39:00 +0300 |
commit | 351821c1f18f9285be58df0a05339936311f6490 (patch) | |
tree | 47a60cad4f61f63c5ac2faf98dcae24760d7fe11 /src/particle.cpp | |
parent | e50632a83a3c679cffd372656277a304d5d853f8 (diff) | |
download | plus-351821c1f18f9285be58df0a05339936311f6490.tar.gz plus-351821c1f18f9285be58df0a05339936311f6490.tar.bz2 plus-351821c1f18f9285be58df0a05339936311f6490.tar.xz plus-351821c1f18f9285be58df0a05339936311f6490.zip |
first part of style fixed after cpplint checks.
Diffstat (limited to 'src/particle.cpp')
-rw-r--r-- | src/particle.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/particle.cpp b/src/particle.cpp index a0a01a09a..50b41018e 100644 --- a/src/particle.cpp +++ b/src/particle.cpp @@ -85,7 +85,6 @@ Particle::~Particle() { // Delete child emitters and child particles clear(); - //update particle count Particle::particleCount--; } @@ -118,7 +117,7 @@ bool Particle::update() if (mAlive == ALIVE) { - //calculate particle movement + // calculate particle movement if (mMomentum != 1.0f) mVelocity *= mMomentum; @@ -238,11 +237,11 @@ bool Particle::update() p2 = mChildParticles.end(); p != p2; ) { Particle *const particle = *p; - //move particle with its parent if desired + // move particle with its parent if desired if (particle->doesFollow()) particle->moveBy(change); - //update particle + // update particle if (particle->update()) { ++p; @@ -347,7 +346,7 @@ Particle *Particle::addEffect(const std::string &particleEffectFile, effectChildNode, "position-y", 0)); const float offsetZ = static_cast<float>(XML::getFloatProperty( effectChildNode, "position-z", 0)); - const Vector position (mPos.x + static_cast<float>(pixelX) + offsetX, + const Vector position(mPos.x + static_cast<float>(pixelX) + offsetX, mPos.y + static_cast<float>(pixelY) + offsetY, mPos.z + offsetZ); newParticle->moveTo(position); @@ -420,9 +419,9 @@ Particle *Particle::addTextSplashEffect(const std::string &text, mMap, text, color, font, outline); newParticle->moveTo(static_cast<float>(x), static_cast<float>(y)); newParticle->setVelocity( - static_cast<float>((rand() % 100) - 50) / 200.0f, // X - static_cast<float>((rand() % 100) - 50) / 200.0f, // Y - (static_cast<float>((rand() % 100)) / 200.0f) + 4.0f); // Z + static_cast<float>((rand() % 100) - 50) / 200.0f, // X + static_cast<float>((rand() % 100) - 50) / 200.0f, // Y + (static_cast<float>((rand() % 100)) / 200.0f) + 4.0f); // Z newParticle->setGravity(0.1f); newParticle->setBounce(0.5f); |