aboutsummaryrefslogtreecommitdiffstats
path: root/src/particles/qquickturbulence.cpp
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@digia.com>2016-03-08 10:13:15 +0100
committerErik Verbruggen <erik.verbruggen@theqtcompany.com>2016-03-08 09:37:21 +0000
commit350a74ec69b535df07ad7ca45415090749c75293 (patch)
tree911d3c17b0af4f733f5449c6796014cfc9ac0d04 /src/particles/qquickturbulence.cpp
parent922e9d6b0c7ae1acdae4986e8000ad9a693b7469 (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/qquickturbulence.cpp')
-rw-r--r--src/particles/qquickturbulence.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/particles/qquickturbulence.cpp b/src/particles/qquickturbulence.cpp
index eed8604438..74558413a6 100644
--- a/src/particles/qquickturbulence.cpp
+++ b/src/particles/qquickturbulence.cpp
@@ -186,7 +186,7 @@ void QQuickTurbulenceAffector::affectSystem(qreal dt)
foreach (QQuickParticleData *d, gd->data){
if (!shouldAffect(d))
continue;
- QPoint pos = (QPointF(d->curX(), d->curY()) - m_offset).toPoint();
+ QPoint pos = (QPointF(d->curX(m_system), d->curY(m_system)) - m_offset).toPoint();
if (!boundsRect.contains(pos,true))//Need to redo bounds checking due to quantization.
continue;
qreal fx = 0.0;
@@ -194,8 +194,8 @@ void QQuickTurbulenceAffector::affectSystem(qreal dt)
fx += m_vectorField[pos.x()][pos.y()].x() * m_strength;
fy += m_vectorField[pos.x()][pos.y()].y() * m_strength;
if (fx || fy){
- d->setInstantaneousVX(d->curVX()+ fx * dt);
- d->setInstantaneousVY(d->curVY()+ fy * dt);
+ d->setInstantaneousVX(d->curVX(m_system)+ fx * dt, m_system);
+ d->setInstantaneousVY(d->curVY(m_system)+ fy * dt, m_system);
postAffect(d);
}
}