From c676f4b880ed0abd644085e587e98e3f6ba1c16b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 13 Jul 2016 18:04:01 +0300 Subject: Show particles amount in being popup. --- src/particle/particlelist.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/particle/particlelist.cpp') diff --git a/src/particle/particlelist.cpp b/src/particle/particlelist.cpp index 5e3dc4b5b..0d2a2f195 100644 --- a/src/particle/particlelist.cpp +++ b/src/particle/particlelist.cpp @@ -32,7 +32,8 @@ typedef std::list::const_iterator ParticleListCIter; ParticleList::ParticleList(ParticleContainer *const parent, const bool delParent) : ParticleContainer(parent, delParent), - mElements() + mElements(), + mSize(0U) {} ParticleList::~ParticleList() @@ -46,6 +47,7 @@ void ParticleList::addLocally(Particle *const particle) // The effect may not die without the beings permission or we segfault particle->disableAutoDelete(); mElements.push_back(particle); + mSize ++; } } @@ -60,6 +62,7 @@ void ParticleList::removeLocally(const Particle *const particle) p->kill(); p->prepareToDie(); it = mElements.erase(it); + mSize --; } else { @@ -74,6 +77,7 @@ void ParticleList::clearLocally() (*it)->kill(); mElements.clear(); + mSize = 0U; } void ParticleList::moveTo(const float x, const float y) @@ -89,6 +93,7 @@ void ParticleList::moveTo(const float x, const float y) { p->kill(); it = mElements.erase(it); + mSize --; } else { -- cgit v1.2.3-60-g2f50