From: Alan Alpert Date: Thu, 22 Sep 2011 07:29:47 +0000 (+1000) Subject: Use m_pleaseReset more consistently X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=100c9cec71b5f751acd202d5181bdef3a80eb140;p=konrad%2Fqtdeclarative.git Use m_pleaseReset more consistently 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 Reviewed-by: Martin Jones --- diff --git a/src/declarative/particles/qsgcustomparticle.cpp b/src/declarative/particles/qsgcustomparticle.cpp index 174942d..5d1c605 100644 --- a/src/declarative/particles/qsgcustomparticle.cpp +++ b/src/declarative/particles/qsgcustomparticle.cpp @@ -130,7 +130,6 @@ struct PlainVertices { QSGCustomParticle::QSGCustomParticle(QSGItem* parent) : QSGParticlePainter(parent) - , m_pleaseReset(true) , m_dirtyData(true) , m_material(0) , m_rootNode(0) diff --git a/src/declarative/particles/qsgcustomparticle_p.h b/src/declarative/particles/qsgcustomparticle_p.h index f51e576..db3a788 100644 --- a/src/declarative/particles/qsgcustomparticle_p.h +++ b/src/declarative/particles/qsgcustomparticle_p.h @@ -98,8 +98,6 @@ protected: private: void buildData(); - - bool m_pleaseReset; bool m_dirtyData; QSGShaderEffectProgram m_source; struct SourceData diff --git a/src/declarative/particles/qsgimageparticle.cpp b/src/declarative/particles/qsgimageparticle.cpp index 872624e..8579bfb 100644 --- a/src/declarative/particles/qsgimageparticle.cpp +++ b/src/declarative/particles/qsgimageparticle.cpp @@ -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) diff --git a/src/declarative/particles/qsgimageparticle_p.h b/src/declarative/particles/qsgimageparticle_p.h index ccf5cf7..274ff42 100644 --- a/src/declarative/particles/qsgimageparticle_p.h +++ b/src/declarative/particles/qsgimageparticle_p.h @@ -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; diff --git a/src/declarative/particles/qsgparticlepainter.cpp b/src/declarative/particles/qsgparticlepainter.cpp index 1b3453a..53f2421 100644 --- a/src/declarative/particles/qsgparticlepainter.cpp +++ b/src/declarative/particles/qsgparticlepainter.cpp @@ -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(parentItem())) setSystem(qobject_cast(parentItem())); - if (!m_system) - qWarning() << "ParticlePainter created without a particle system specified";//TODO: useful QML warnings, like line number? QSGItem::componentComplete(); } diff --git a/src/declarative/particles/qsgparticlepainter_p.h b/src/declarative/particles/qsgparticlepainter_p.h index 4b627e9..78e0127 100644 --- a/src/declarative/particles/qsgparticlepainter_p.h +++ b/src/declarative/particles/qsgparticlepainter_p.h @@ -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;