diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2012-01-13 13:54:29 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-23 07:38:34 +0100 |
commit | 379e388568f5d5408b4be13ce6a1faba0b74be6b (patch) | |
tree | 55d6684817c566dad5939ff5e8ad652215fef7a2 /src/quick/items/qquicksprite.cpp | |
parent | 69920f4ddeaa5dbdee555e0a607fd21eb42e2bbc (diff) |
Per-frame Sprites patch one
To allow for sprites to be advanced by the rendering framerate, two
minor redesigns were needed.
A) Sprite texture location is now calculated on the CPU and passed to
the GPU per frame.
B) Stochastic State engine now supports states that do not advance on a
timer, and states can be advanced manually.
This patch implements B and A for ImageParticle. A for SpriteImage will
be done in a separate patch.
Task-number: QTBUG-22236
Change-Id: If1c54a6a03fa48b95bb1e672283292859656457b
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
Diffstat (limited to 'src/quick/items/qquicksprite.cpp')
-rw-r--r-- | src/quick/items/qquicksprite.cpp | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/quick/items/qquicksprite.cpp b/src/quick/items/qquicksprite.cpp index 61e443db84..4c7dafafbb 100644 --- a/src/quick/items/qquicksprite.cpp +++ b/src/quick/items/qquicksprite.cpp @@ -53,12 +53,13 @@ QT_BEGIN_NAMESPACE /*! \qmlproperty int QtQuick2::Sprite::duration - Time between frames. + Time between frames. Use -1 to indicate one sprite frame per rendered frame. */ /*! \qmlproperty int QtQuick2::Sprite::durationVariation - The time between frames can vary by up to this amount. + The time between frames can vary by up to this amount. Variation will never decrease the time + between frames to less than 0. Default is 0. */ @@ -105,17 +106,6 @@ QT_BEGIN_NAMESPACE If frameHeight and frameWidth are not specified, it is assumed to be a single long row of square frames. Otherwise, it can be multiple contiguous rows or rectangluar frames, when one row runs out the next will be used. */ - Q_PROPERTY(int duration READ duration WRITE setDuration NOTIFY durationChanged) - Q_PROPERTY(int durationVariation READ durationVariance WRITE setDurationVariance NOTIFY durationVarianceChanged) - Q_PROPERTY(QVariantMap to READ to WRITE setTo NOTIFY toChanged) - Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) - Q_PROPERTY(qreal speedModifiesDuration READ speedModifer WRITE setSpeedModifier NOTIFY speedModifierChanged) - Q_PROPERTY(int frames READ frames WRITE setFrames NOTIFY framesChanged) - Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged) - //If frame height or width is not specified, it is assumed to be a single long row of square frames. - //Otherwise, it can be multiple contiguous rows, when one row runs out the next will be used. - Q_PROPERTY(int frameHeight READ frameHeight WRITE setFrameHeight NOTIFY frameHeightChanged) - Q_PROPERTY(int frameWidth READ frameWidth WRITE setFrameWidth NOTIFY frameWidthChanged) QQuickSprite::QQuickSprite(QObject *parent) : QQuickStochasticState(parent) |