Clear pending commits on reset
authorAlan Alpert <alan.alpert@nokia.com>
Tue, 20 Dec 2011 10:08:33 +0000 (20:08 +1000)
committerQt by Nokia <qt-info@nokia.com>
Thu, 22 Dec 2011 05:55:20 +0000 (06:55 +0100)
They will be caught when the nodes are rebuilt, if they're still valid.

Change-Id: Iac6e790b604a7deaba98a50dd07754459e9f5e14
Reviewed-by: Martin Jones <martin.jones@nokia.com>
src/quick/particles/qquickimageparticle.cpp
src/quick/particles/qquickparticlepainter.cpp
src/quick/particles/qquickparticlepainter_p.h

index 1566e7e..6b8df61 100644 (file)
@@ -1434,8 +1434,6 @@ void QQuickImageParticle::prepareNextFrame()
 {
     if (m_rootNode == 0){//TODO: Staggered loading (as emitted)
         m_rootNode = buildParticleNodes();
-        if (m_rootNode == 0)
-            return;
         if (m_debugMode) {
             qDebug() << "QQuickImageParticle Feature level: " << perfLevel;
             qDebug() << "QQuickImageParticle Nodes: ";
@@ -1446,6 +1444,8 @@ void QQuickImageParticle::prepareNextFrame()
             }
             qDebug() << "Total count: " << count;
         }
+        if (m_rootNode == 0)
+            return;
     }
     qint64 timeStamp = m_system->systemSync(this);
 
index 812c4b8..248bf24 100644 (file)
@@ -106,6 +106,8 @@ void QQuickParticlePainter::reload(QQuickParticleData* d)
 
 void QQuickParticlePainter::reset()
 {
+    m_pendingCommits.clear();
+    m_pleaseReset = true;
 }
 
 void QQuickParticlePainter::setCount(int c)//### TODO: some resizeing so that particles can reallocate on size change instead of recreate
index 44aac34..03f7abd 100644 (file)
@@ -89,6 +89,7 @@ public slots:
     {
         if (m_groups != arg) {
             m_groups = arg;
+            //Note: The system watches this as it has to recalc things when groups change. It will request a reset if necessary
             emit groupsChanged(arg);
         }
     }