diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2011-10-14 13:06:41 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-10-17 05:46:06 +0200 |
commit | cec7b67ec38934560c19a4e4361d684c25143fa8 (patch) | |
tree | a9e7da0c6fdf813fc804c58e8806c88e853e7e9d /src | |
parent | 9470ce517d466606db0317f6af0800890c2c874d (diff) |
Initial particle system benchmark
Exposed another function on ParticleSystem in order to work.
Change-Id: I62acf524eb2c6491bc88fd687a0065866d7ce852
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/particles/qsgparticlesystem.cpp | 5 | ||||
-rw-r--r-- | src/declarative/particles/qsgparticlesystem_p.h | 13 |
2 files changed, 10 insertions, 8 deletions
diff --git a/src/declarative/particles/qsgparticlesystem.cpp b/src/declarative/particles/qsgparticlesystem.cpp index b7a2f845a4..fd4b75d7f9 100644 --- a/src/declarative/particles/qsgparticlesystem.cpp +++ b/src/declarative/particles/qsgparticlesystem.cpp @@ -786,14 +786,15 @@ void QSGParticleSystem::reset() } //### Do affectors need reset too? - - if (m_running) {//reset restarts animation (if running) + if (m_animation) {//Animation is explicitly disabled in benchmarks + //reset restarts animation (if running) if ((m_animation->state() == QAbstractAnimation::Running)) m_animation->stop(); m_animation->start(); if (m_paused) m_animation->pause(); } + initialized = true; } diff --git a/src/declarative/particles/qsgparticlesystem_p.h b/src/declarative/particles/qsgparticlesystem_p.h index e88aa491c3..0729727e43 100644 --- a/src/declarative/particles/qsgparticlesystem_p.h +++ b/src/declarative/particles/qsgparticlesystem_p.h @@ -284,7 +284,7 @@ private slots: public: //These can be called multiple times per frame, performance critical void emitParticle(QSGParticleData* p); - QSGParticleData* newDatum(int groupId, bool respectLimits = true, int sysIdx = -1);//TODO: implement respectLimits in emitters (which means interacting with maxCount?) + QSGParticleData* newDatum(int groupId, bool respectLimits = true, int sysIdx = -1); void finishNewDatum(QSGParticleData*); void moveGroups(QSGParticleData *d, int newGIdx); int nextSystemIndex(); @@ -292,13 +292,18 @@ public: //This one only once per painter per frame int systemSync(QSGParticlePainter* p); - //Data members here for ease of related class and auto-test usage. Not "public" API. + //Data members here for ease of related class and auto-test usage. Not "public" API. TODO: d_ptrize QSet<QSGParticleData*> needsReset; QVector<QSGParticleData*> bySysIdx; //Another reference to the data (data owned by group), but by sysIdx QHash<QString, int> groupIds; QHash<int, QSGParticleGroupData*> groupData; QSGStochasticEngine* stateEngine; + //Also only here for auto-test usage + void updateCurrentTime( int currentTime ); + QSGParticleSystemAnimation* m_animation; + bool m_running; + int timeInt; bool initialized; int particleCount; @@ -323,7 +328,6 @@ public: private: void initializeSystem(); void initGroups(); - bool m_running; QList<QPointer<QSGParticleEmitter> > m_emitters; QList<QPointer<QSGParticleAffector> > m_affectors; QList<QPointer<QSGParticlePainter> > m_painters; @@ -336,9 +340,6 @@ private: QSignalMapper m_painterMapper; QSignalMapper m_emitterMapper; - friend class QSGParticleSystemAnimation; - void updateCurrentTime( int currentTime ); - QSGParticleSystemAnimation* m_animation; bool m_paused; bool m_debugMode; bool m_allDead; |