Use m_pleaseReset more consistently
authorAlan Alpert <alan.alpert@nokia.com>
Thu, 22 Sep 2011 07:29:47 +0000 (17:29 +1000)
committerQt by Nokia <qt-info@nokia.com>
Fri, 23 Sep 2011 01:50:16 +0000 (03:50 +0200)
Everyone had their own, and so they could conflict or be randomly
un-initialized.

Change-Id: Ife2c5d9972b881235e4d3a5e2a33979174de2fbc
Reviewed-on: http://codereview.qt-project.org/5370
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Martin Jones <martin.jones@nokia.com>

src/declarative/particles/qsgcustomparticle.cpp
src/declarative/particles/qsgcustomparticle_p.h
src/declarative/particles/qsgimageparticle.cpp
src/declarative/particles/qsgimageparticle_p.h
src/declarative/particles/qsgparticlepainter.cpp
src/declarative/particles/qsgparticlepainter_p.h

index 174942d..5d1c605 100644 (file)
@@ -130,7 +130,6 @@ struct PlainVertices {
 
 QSGCustomParticle::QSGCustomParticle(QSGItem* parent)
     : QSGParticlePainter(parent)
-    , m_pleaseReset(true)
     , m_dirtyData(true)
     , m_material(0)
     , m_rootNode(0)
index f51e576..db3a788 100644 (file)
@@ -98,8 +98,6 @@ protected:
 private:
     void buildData();
 
-
-    bool m_pleaseReset;
     bool m_dirtyData;
     QSGShaderEffectProgram m_source;
     struct SourceData
index 872624e..8579bfb 100644 (file)
@@ -634,7 +634,6 @@ void fillUniformArrayFromImage(float* array, const QImage& img, int size)
 
 QSGImageParticle::QSGImageParticle(QSGItem* parent)
     : QSGParticlePainter(parent)
-    , m_do_reset(false)
     , m_color_variation(0.0)
     , m_rootNode(0)
     , m_material(0)
index ccf5cf7..274ff42 100644 (file)
@@ -338,8 +338,6 @@ private slots:
     void createEngine(); //### method invoked by sprite list changing (in engine.h) - pretty nasty
 
 private:
-    bool m_do_reset;
-
     QUrl m_image_name;
     QUrl m_colortable_name;
     QUrl m_sizetable_name;
index 1b3453a..53f2421 100644 (file)
@@ -65,7 +65,7 @@ QT_BEGIN_NAMESPACE
 */
 QSGParticlePainter::QSGParticlePainter(QSGItem *parent) :
     QSGItem(parent),
-    m_system(0), m_count(0), m_sentinel(new QSGParticleData(0))
+    m_system(0), m_count(0), m_sentinel(new QSGParticleData(0)), m_pleaseReset(true)
 {
 }
 
@@ -73,8 +73,6 @@ void QSGParticlePainter::componentComplete()
 {
     if (!m_system && qobject_cast<QSGParticleSystem*>(parentItem()))
         setSystem(qobject_cast<QSGParticleSystem*>(parentItem()));
-    if (!m_system)
-        qWarning() << "ParticlePainter created without a particle system specified";//TODO: useful QML warnings, like line number?
     QSGItem::componentComplete();
 }
 
index 4b627e9..78e0127 100644 (file)
@@ -119,7 +119,7 @@ protected:
     QSGParticleSystem* m_system;
     friend class QSGParticleSystem;
     int m_count;
-    bool m_pleaseReset;
+    bool m_pleaseReset;//Used by subclasses, but it's a nice optimization to know when stuff isn't going to matter.
     QStringList m_groups;
     QPointF m_systemOffset;