Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alan Alpert authored and Qt by Nokia committed Dec 20, 2011
1 parent 265fe77 commit f3c7d8c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/quick/particles/qquickparticleaffector.cpp
Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions src/quick/particles/qquickparticlesystem.cpp
Expand Up @@ -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);

Expand Down

0 comments on commit f3c7d8c

Please sign in to comment.