aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/items/qsgspriteengine_p.h
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2011-07-04 18:15:28 +1000
committerQt by Nokia <qt-info@nokia.com>2011-07-06 10:09:09 +0200
commit29c4b643272a43022081cce063394bac823ab529 (patch)
tree10e4fe15bdf68dec90edac0d67b949a92d9204d5 /src/declarative/items/qsgspriteengine_p.h
parent87822d24df32311a50dc87ded55ad4d17e8226f0 (diff)
Squashed Particle System Stateful Rewrite
Add TargetAffector Fix for ParticlePainter offsets Adds a particleStates property to ParticleSystem Augment SpriteGoal to change system states as well Also add 'collidingParticles' list to affector. Particle Stochastic States Now actually working, and you can put emitters, affectors and painters inside their targeted state. Fireworks example uses states instead of delegates. Replaced the delegate example with a text thing. The examples launcher now also contains all the custom examples. Adds CumulativeDirection and working null Affector (for affected signal). Add spaces after all flow control keywords. Change-Id: I77b7e3044a9800dbfff6db833914d63127602cf5 Reviewed-on: http://codereview.qt.nokia.com/968 Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
Diffstat (limited to 'src/declarative/items/qsgspriteengine_p.h')
-rw-r--r--src/declarative/items/qsgspriteengine_p.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/declarative/items/qsgspriteengine_p.h b/src/declarative/items/qsgspriteengine_p.h
index 8ab6e3a30a..33d6e82bd4 100644
--- a/src/declarative/items/qsgspriteengine_p.h
+++ b/src/declarative/items/qsgspriteengine_p.h
@@ -92,7 +92,8 @@ public:
void setGoal(int state, int sprite=0, bool jump=false);
QImage assembledImage();
- void startSprite(int index=0);
+ void startSprite(int index=0, int state=0);
+ void stopSprite(int index=0);
private://Nothing outside should use this?
friend class QSGSpriteGoalAffector;//XXX: Fix interface
@@ -102,6 +103,7 @@ private://Nothing outside should use this?
signals:
void globalGoalChanged(QString arg);
+ void stateChanged(int idx);
public slots:
void setGlobalGoal(QString arg)
@@ -115,6 +117,7 @@ public slots:
uint updateSprites(uint time);
private:
+ friend class QSGParticleSystem;
void restartSprite(int sprite);
void addToUpdateList(uint t, int idx);
int goalSeek(int curState, int spriteIdx, int dist=-1);
@@ -122,7 +125,7 @@ private:
QVector<int> m_sprites;//int is the index in m_states of the current state
QVector<int> m_goals;
QVector<int> m_startTimes;
- QList<QPair<uint, QList<int> > > m_stateUpdates;//### This could be done faster
+ QList<QPair<uint, QList<int> > > m_stateUpdates;//### This could be done faster - priority queue?
QTime m_advanceTime;
uint m_timeOffset;