diff options
Diffstat (limited to 'src/declarative/particles/qsgparticleaffector.cpp')
-rw-r--r-- | src/declarative/particles/qsgparticleaffector.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/declarative/particles/qsgparticleaffector.cpp b/src/declarative/particles/qsgparticleaffector.cpp index 96c5cfb25b..5b0936cc40 100644 --- a/src/declarative/particles/qsgparticleaffector.cpp +++ b/src/declarative/particles/qsgparticleaffector.cpp @@ -79,22 +79,22 @@ void QSGParticleAffector::affectSystem(qreal dt) m_groups << m_system->m_groupIds[p];//###Can this occur before group ids are properly assigned? m_updateIntSet = false; } - //foreach(ParticleData* d, m_system->m_data){ - for(int i=0; i<m_system->m_particle_count; i++){ - QSGParticleData* d = m_system->m_data[i]; - if(!d || (m_onceOff && m_onceOffed.contains(d->systemIndex))) - continue; - if(m_groups.isEmpty() || m_groups.contains(d->group)){ - //Need to have previous location for affected. if signal || shape might be faster? - QPointF curPos = QPointF(d->curX(), d->curY()); - if(width() == 0 || height() == 0 - || m_shape->contains(QRectF(m_offset.x(), m_offset.y(), width(), height()),curPos)){ - if(affectParticle(d, dt)){ - m_system->m_needsReset << d; - if(m_onceOff) - m_onceOffed << d->systemIndex; - if(m_signal) - emit affected(curPos.x(), curPos.y()); + foreach(QSGParticleGroupData* gd, m_system->m_groupData){ + foreach(QSGParticleData* d, gd->data){ + if(!d || (m_onceOff && m_onceOffed.contains(qMakePair(d->group, d->index)))) + continue; + if(m_groups.isEmpty() || m_groups.contains(d->group)){ + //Need to have previous location for affected. if signal || shape might be faster? + QPointF curPos = QPointF(d->curX(), d->curY()); + if(width() == 0 || height() == 0 + || m_shape->contains(QRectF(m_offset.x(), m_offset.y(), width(), height()),curPos)){ + if(affectParticle(d, dt)){ + m_system->m_needsReset << d; + if(m_onceOff) + m_onceOffed << qMakePair(d->group, d->index); + if(m_signal) + emit affected(curPos.x(), curPos.y()); + } } } } @@ -108,10 +108,10 @@ bool QSGParticleAffector::affectParticle(QSGParticleData *d, qreal dt) return false; } -void QSGParticleAffector::reset(int idx) +void QSGParticleAffector::reset(QSGParticleData* pd) {//TODO: This, among other ones, should be restructured so they don't all need to remember to call the superclass if(m_onceOff) - m_onceOffed.remove(idx); + m_onceOffed.remove(qMakePair(pd->group, pd->index)); } void QSGParticleAffector::updateOffsets() |