diff options
author | Erik Verbruggen <erik.verbruggen@digia.com> | 2016-03-08 10:13:15 +0100 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@theqtcompany.com> | 2016-03-08 09:37:21 +0000 |
commit | 350a74ec69b535df07ad7ca45415090749c75293 (patch) | |
tree | 911d3c17b0af4f733f5449c6796014cfc9ac0d04 /src/particles/qquickage.cpp | |
parent | 922e9d6b0c7ae1acdae4986e8000ad9a693b7469 (diff) |
Particles: Shrink QQuickParticleData by 2 pointers.
Samegame creates about 23,000 particles, so this reduces the memory by
~180kb on 32bit, so ~360kb on 64bit.
Change-Id: I0581524ab232b474c5d43abeabd7ebf6174e740f
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/particles/qquickage.cpp')
-rw-r--r-- | src/particles/qquickage.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/particles/qquickage.cpp b/src/particles/qquickage.cpp index 9867e7e0ed..e1eb714623 100644 --- a/src/particles/qquickage.cpp +++ b/src/particles/qquickage.cpp @@ -88,23 +88,23 @@ QQuickAgeAffector::QQuickAgeAffector(QQuickItem *parent) : bool QQuickAgeAffector::affectParticle(QQuickParticleData *d, qreal dt) { Q_UNUSED(dt); - if (d->stillAlive()){ + if (d->stillAlive(m_system)){ qreal curT = (qreal)m_system->timeInt/1000.0; qreal ttl = (qreal)m_lifeLeft/1000.0; if (!m_advancePosition && ttl > 0){ - qreal x = d->curX(); - qreal vx = d->curVX(); + qreal x = d->curX(m_system); + qreal vx = d->curVX(m_system); qreal ax = d->curAX(); - qreal y = d->curY(); - qreal vy = d->curVY(); + qreal y = d->curY(m_system); + qreal vy = d->curVY(m_system); qreal ay = d->curAY(); d->t = curT - (d->lifeSpan - ttl); - d->setInstantaneousX(x); - d->setInstantaneousVX(vx); - d->setInstantaneousAX(ax); - d->setInstantaneousY(y); - d->setInstantaneousVY(vy); - d->setInstantaneousAY(ay); + d->setInstantaneousX(x, m_system); + d->setInstantaneousVX(vx, m_system); + d->setInstantaneousAX(ax, m_system); + d->setInstantaneousY(y, m_system); + d->setInstantaneousVY(vy, m_system); + d->setInstantaneousAY(ay, m_system); } else { d->t = curT - (d->lifeSpan - ttl); } |