diff options
Diffstat (limited to 'src/declarative/items/qsgsprite.cpp')
-rw-r--r-- | src/declarative/items/qsgsprite.cpp | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/src/declarative/items/qsgsprite.cpp b/src/declarative/items/qsgsprite.cpp index 806f7a9ad8..63d1951b7c 100644 --- a/src/declarative/items/qsgsprite.cpp +++ b/src/declarative/items/qsgsprite.cpp @@ -40,42 +40,17 @@ ****************************************************************************/ #include "qsgsprite_p.h" -//TODO: Split out particle system dependency -#include "qsgparticlesystem_p.h" #include <QDebug> QT_BEGIN_NAMESPACE QSGSprite::QSGSprite(QObject *parent) : - QObject(parent) + QSGStochasticState(parent) , m_generatedCount(0) , m_framesPerRow(0) - , m_frames(1) , m_frameHeight(0) , m_frameWidth(0) - , m_duration(1000) { } -void redirectError(QDeclarativeListProperty<QObject> *prop, QObject *value) -{ - qWarning() << "Could not add " << value << " to state" << prop->object << "as it is not associated with a particle system."; -} - -QDeclarativeListProperty<QObject> QSGSprite::particleChildren() -{ - QSGParticleSystem* system = qobject_cast<QSGParticleSystem*>(parent()); - if (system) - return QDeclarativeListProperty<QObject>(this, 0, &QSGParticleSystem::stateRedirect); - else - return QDeclarativeListProperty<QObject>(this, 0, &redirectError); -} - -int QSGSprite::variedDuration() const -{ - return m_duration - + (m_durationVariance * ((qreal)qrand()/RAND_MAX) * 2) - - m_durationVariance; -} - QT_END_NAMESPACE |