diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2011-09-13 09:39:11 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-09-13 04:53:33 +0200 |
commit | 29993ff8e91715bdfbaf964c91e07a112f6d2a24 (patch) | |
tree | 46a7b25ba1091f1d6ada9decaa9bf9d77d3a8004 /src/declarative/particles/qsgparticleaffector.cpp | |
parent | 4dba5720e03542e0989adad2461358074c7d0dee (diff) |
Refactor SpriteEngine out of StochasticEngine
Also add ParticleGroups which use only StochasticStates
Simplistic change for now, just to focus the API for the
particle system. ParticleGroup elements replace the particleStates
property on the system, and the term "group" is now used more
consistently.
Change-Id: I6456f9c521b8166ccd94ea953275557bcfbf6423
Reviewed-on: http://codereview.qt-project.org/4699
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
Diffstat (limited to 'src/declarative/particles/qsgparticleaffector.cpp')
-rw-r--r-- | src/declarative/particles/qsgparticleaffector.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/declarative/particles/qsgparticleaffector.cpp b/src/declarative/particles/qsgparticleaffector.cpp index cff3c29444..7cb4869f3e 100644 --- a/src/declarative/particles/qsgparticleaffector.cpp +++ b/src/declarative/particles/qsgparticleaffector.cpp @@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE If the Affector is a direct child of a ParticleSystem, it will automatically be associated with it. */ /*! - \qmlproperty list<string> QtQuick.Particles2::Affector::particles + \qmlproperty list<string> QtQuick.Particles2::Affector::groups Which logical particle groups will be affected. If empty, it will affect all particles. @@ -100,9 +100,9 @@ QT_BEGIN_NAMESPACE x,y are the coordinates of the affected particle, relative to the ParticleSystem. */ -//TODO: Document particle 'type' + /*! - \qmlsignal QtQuick.Particles2::Affector::affectParticle(particle, dt) + \qmlsignal QtQuick.Particles2::Affector::affectParticle(particle particle, real dt) This handler is called when particles are selected to be affected. @@ -113,7 +113,7 @@ QT_BEGIN_NAMESPACE high-volume particle systems. */ /*! - \qmlsignal QtQuick.Particles2::Affector::affected(x, y) + \qmlsignal QtQuick.Particles2::Affector::affected(real x, real y) This handler is called when a particle is selected to be affected. It will only be called if signal is set to true. @@ -142,12 +142,12 @@ void QSGParticleAffector::componentComplete() bool QSGParticleAffector::activeGroup(int g) { if (m_updateIntSet){ - m_groups.clear(); - foreach (const QString &p, m_particles) - m_groups << m_system->m_groupIds[p];//###Can this occur before group ids are properly assigned? + m_groupIds.clear(); + foreach (const QString &p, m_groups) + m_groupIds << m_system->m_groupIds[p];//###Can this occur before group ids are properly assigned? m_updateIntSet = false; } - return m_groups.isEmpty() || m_groups.contains(g); + return m_groupIds.isEmpty() || m_groupIds.contains(g); } void QSGParticleAffector::affectSystem(qreal dt) @@ -195,7 +195,7 @@ bool QSGParticleAffector::affectParticle(QSGParticleData *, qreal ) 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) - if (m_groups.isEmpty() || m_groups.contains(pd->group)) + if (m_groups.isEmpty() || m_groupIds.contains(pd->group)) m_onceOffed.remove(qMakePair(pd->group, pd->index)); } |