aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2011-12-19 17:58:49 +1000
committerQt by Nokia <qt-info@nokia.com>2011-12-20 06:39:51 +0100
commitf3c7d8c357d8c119287cf8d520e48098170b47c5 (patch)
tree09b2d585b1071bc5ccaf5437e4d288832e8c411d /src
parent265fe7770778b85e174c39c33ecc9431d7f55b75 (diff)
Fix affector group caching
It was possible for the cache to be updated before groups were properly assigned, and it didn't update when they were. Change-Id: If6835e2aad4a2412d17eb727da5d2414e4c20d60 Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/quick/particles/qquickparticleaffector.cpp4
-rw-r--r--src/quick/particles/qquickparticlesystem.cpp3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/quick/particles/qquickparticleaffector.cpp b/src/quick/particles/qquickparticleaffector.cpp
index 5bfc699548..854ab3489e 100644
--- a/src/quick/particles/qquickparticleaffector.cpp
+++ b/src/quick/particles/qquickparticleaffector.cpp
@@ -159,10 +159,10 @@ void QQuickParticleAffector::componentComplete()
}
bool QQuickParticleAffector::activeGroup(int g) {
- if (m_updateIntSet){
+ if (m_updateIntSet){ //This can occur before group ids are properly assigned, but that resets the flag
m_groupIds.clear();
foreach (const QString &p, m_groups)
- m_groupIds << m_system->groupIds[p];//###Can this occur before group ids are properly assigned?
+ m_groupIds << m_system->groupIds[p];
m_updateIntSet = false;
}
return m_groupIds.isEmpty() || m_groupIds.contains(g);
diff --git a/src/quick/particles/qquickparticlesystem.cpp b/src/quick/particles/qquickparticlesystem.cpp
index cbb2605996..87a454c796 100644
--- a/src/quick/particles/qquickparticlesystem.cpp
+++ b/src/quick/particles/qquickparticlesystem.cpp
@@ -908,6 +908,9 @@ void QQuickParticleSystem::emittersChanged()
if (particleCount > bySysIdx.size())//New datum requests haven't updated it
bySysIdx.resize(particleCount);
+ foreach (QQuickParticleAffector *a, m_affectors)//Groups may have changed
+ a->m_updateIntSet = true;
+
foreach (QQuickParticlePainter *p, m_painters)
loadPainter(p);