diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-01-26 16:07:54 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-01-26 16:07:54 +0100 |
commit | 5afe88df2538274859a162ffd63ed52118e80c19 (patch) | |
tree | b610dfd58dc748fd63f49565b2a43eea2316714f /src/particle.cpp | |
parent | 73ba2a95f5bd4a0dd09af52d5864800be2b0a4c6 (diff) | |
download | mana-5afe88df2538274859a162ffd63ed52118e80c19.tar.gz mana-5afe88df2538274859a162ffd63ed52118e80c19.tar.bz2 mana-5afe88df2538274859a162ffd63ed52118e80c19.tar.xz mana-5afe88df2538274859a162ffd63ed52118e80c19.zip |
Apply C++11 fixits
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
Diffstat (limited to 'src/particle.cpp')
-rw-r--r-- | src/particle.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/particle.cpp b/src/particle.cpp index f84bb2ed..64f25999 100644 --- a/src/particle.cpp +++ b/src/particle.cpp @@ -70,7 +70,7 @@ Particle::Particle(Map *map): mRandomness(0), mBounce(0.0f), mFollow(false), - mTarget(NULL), + mTarget(nullptr), mAcceleration(0.0f), mInvDieDistance(-1.0f), mMomentum(1.0f) @@ -195,11 +195,11 @@ bool Particle::update() // Update child emitters if ((mLifetimePast-1)%Particle::emitterSkip == 0) { - for (EmitterIterator e = mChildEmitters.begin(); + for (auto e = mChildEmitters.begin(); e != mChildEmitters.end(); e++) { Particles newParticles = (*e)->createParticles(mLifetimePast); - for (ParticleIterator p = newParticles.begin(); + for (auto p = newParticles.begin(); p != newParticles.end(); p++) { (*p)->moveBy(mPos); @@ -224,7 +224,7 @@ bool Particle::update() // Update child particles - for (ParticleIterator p = mChildParticles.begin(); + for (auto p = mChildParticles.begin(); p != mChildParticles.end();) { //move particle with its parent if desired @@ -254,7 +254,7 @@ bool Particle::update() void Particle::moveBy(const Vector &change) { mPos += change; - for (ParticleIterator p = mChildParticles.begin(); + for (auto p = mChildParticles.begin(); p != mChildParticles.end(); p++) { if ((*p)->doesFollow()) @@ -271,7 +271,7 @@ void Particle::moveTo(float x, float y) Particle *Particle::createChild() { - Particle *newParticle = new Particle(mMap); + auto *newParticle = new Particle(mMap); mChildParticles.push_back(newParticle); return newParticle; } @@ -279,7 +279,7 @@ Particle *Particle::createChild() Particle *Particle::addEffect(const std::string &particleEffectFile, int pixelX, int pixelY, int rotation) { - Particle *newParticle = NULL; + Particle *newParticle = nullptr; std::string::size_type pos = particleEffectFile.find('|'); std::string dyePalettes; @@ -292,7 +292,7 @@ Particle *Particle::addEffect(const std::string &particleEffectFile, if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "effect")) { logger->log("Error loading particle: %s", particleEffectFile.c_str()); - return NULL; + return nullptr; } ResourceManager *resman = ResourceManager::getInstance(); @@ -432,7 +432,7 @@ void Particle::adjustEmitterSize(int w, int h) { if (mAllowSizeAdjust) { - for (EmitterIterator e = mChildEmitters.begin(); + for (auto e = mChildEmitters.begin(); e != mChildEmitters.end(); e++) { (*e)->adjustSize(w, h); |