aboutsummaryrefslogtreecommitdiffstats
path: root/src/particles/qquickwander.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/qquickwander.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/qquickwander.cpp')
-rw-r--r--src/particles/qquickwander.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/particles/qquickwander.cpp b/src/particles/qquickwander.cpp
index 862c796dac..09d36ab2e8 100644
--- a/src/particles/qquickwander.cpp
+++ b/src/particles/qquickwander.cpp
@@ -151,29 +151,29 @@ bool QQuickWanderAffector::affectParticle(QQuickParticleData* data, qreal dt)
qreal newX, newY;
switch (m_affectedParameter){
case Position:
- newX = data->curX() + dx;
+ newX = data->curX(m_system) + dx;
if (m_xVariance > qAbs(newX) )
data->x += dx;
- newY = data->curY() + dy;
+ newY = data->curY(m_system) + dy;
if (m_yVariance > qAbs(newY) )
data->y += dy;
break;
default:
case Velocity:
- newX = data->curVX() + dx;
- if (m_xVariance > qAbs(newX) )
- data->setInstantaneousVX(newX);
- newY = data->curVY() + dy;
- if (m_yVariance > qAbs(newY) )
- data->setInstantaneousVY(newY);
+ newX = data->curVX(m_system) + dx;
+ if (m_xVariance > qAbs(newX))
+ data->setInstantaneousVX(newX, m_system);
+ newY = data->curVY(m_system) + dy;
+ if (m_yVariance > qAbs(newY))
+ data->setInstantaneousVY(newY, m_system);
break;
case Acceleration:
newX = data->ax + dx;
- if (m_xVariance > qAbs(newX) )
- data->setInstantaneousAX(newX);
+ if (m_xVariance > qAbs(newX))
+ data->setInstantaneousAX(newX, m_system);
newY = data->ay + dy;
- if (m_yVariance > qAbs(newY) )
- data->setInstantaneousAY(newY);
+ if (m_yVariance > qAbs(newY))
+ data->setInstantaneousAY(newY, m_system);
break;
}
return true;