From 220b264acc6bf1823bd06f99ebdbee352ff57e3a Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Tue, 20 Dec 2011 20:08:33 +1000 Subject: [PATCH] Clear pending commits on reset They will be caught when the nodes are rebuilt, if they're still valid. Change-Id: Iac6e790b604a7deaba98a50dd07754459e9f5e14 Reviewed-by: Martin Jones --- src/quick/particles/qquickimageparticle.cpp | 4 ++-- src/quick/particles/qquickparticlepainter.cpp | 2 ++ src/quick/particles/qquickparticlepainter_p.h | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/quick/particles/qquickimageparticle.cpp b/src/quick/particles/qquickimageparticle.cpp index 1566e7e..6b8df61 100644 --- a/src/quick/particles/qquickimageparticle.cpp +++ b/src/quick/particles/qquickimageparticle.cpp @@ -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); diff --git a/src/quick/particles/qquickparticlepainter.cpp b/src/quick/particles/qquickparticlepainter.cpp index 812c4b8..248bf24 100644 --- a/src/quick/particles/qquickparticlepainter.cpp +++ b/src/quick/particles/qquickparticlepainter.cpp @@ -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 diff --git a/src/quick/particles/qquickparticlepainter_p.h b/src/quick/particles/qquickparticlepainter_p.h index 44aac34..03f7abd 100644 --- a/src/quick/particles/qquickparticlepainter_p.h +++ b/src/quick/particles/qquickparticlepainter_p.h @@ -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); } } -- 2.7.4