Skip to content

Commit

Permalink
Sprite minor fixes
Browse files Browse the repository at this point in the history
Spelling of "motivate", don't send out the message when they didn't set
duration themselves, and update TODO comment.

Change-Id: I4de055f07a1831b9d12798faeda658ff441920f4
Reviewed-by: Damian Jansen <damian.jansen@nokia.com>
  • Loading branch information
Alan Alpert authored and Qt by Nokia committed Mar 20, 2012
1 parent efe0c53 commit 760d0ac
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/quick/items/qquicksprite.cpp
Expand Up @@ -248,13 +248,15 @@ int QQuickSprite::variedDuration() const //Deals with precedence when multiple d
+ (m_frameDurationVariation * ((qreal)qrand()/RAND_MAX) * 2)
- m_frameDurationVariation;
return qMax(0, m_frames * mspf);
}
} else if (duration() >= 0) {
qWarning() << "Sprite::duration is changing meaning to the full animation duration.";
qWarning() << "Use Sprite::frameDuration for the old meaning, of per frame duration.";
qWarning() << "As an interim measure, duration/durationVariation means the same as frameDuration/frameDurationVariation, and you'll get this warning spewed out everywhere to movtivate you.";
qWarning() << "As an interim measure, duration/durationVariation means the same as frameDuration/frameDurationVariation, and you'll get this warning spewed out everywhere to motivate you.";
//Note that the spammyness is due to this being the best location to detect, but also called once each animation loop
return QQuickStochasticState::variedDuration() * m_frames;
}
return 1000; //When nothing set
}

void QQuickSprite::startImageLoading()
{
Expand Down
2 changes: 1 addition & 1 deletion src/quick/items/qquickspriteengine_p.h
Expand Up @@ -70,7 +70,7 @@ class Q_AUTOTEST_EXPORT QQuickStochasticState : public QObject //Currently for i
public:
QQuickStochasticState(QObject* parent = 0)
: QObject(parent)
, m_duration(1000)
, m_duration(-1)
, m_durationVariation(0)
, m_randomStart(false)
{
Expand Down
2 changes: 1 addition & 1 deletion src/quick/items/qquickspriteimage.cpp
Expand Up @@ -261,7 +261,7 @@ struct SpriteVertices {
The sprite or sprites to draw. Sprites will be scaled to the size of this element.
*/

//TODO: Implicitly size element to size of first sprite?
//TODO: Implicitly size element to size of first sprite? or currentSprite?
QQuickSpriteImage::QQuickSpriteImage(QQuickItem *parent) :
QQuickItem(parent)
, m_node(0)
Expand Down

0 comments on commit 760d0ac

Please sign in to comment.