From eed81bda805e05ea7bbd486ab7d198f7ca45d2ed Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Tue, 17 Jan 2012 20:02:30 +1000 Subject: Per-frame Sprites patch three interpolation bools work with the new sprite rendering approach. Giant sprite images that get split into multiple rows now work with the new sprite rendering approach (or even at all). Change-Id: I7f3e09684622f523564802c7634361b6fe363676 Reviewed-by: Alan Alpert --- src/quick/items/qquickspriteimage.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/quick/items/qquickspriteimage.cpp') diff --git a/src/quick/items/qquickspriteimage.cpp b/src/quick/items/qquickspriteimage.cpp index 692e6820d3..1819decf10 100644 --- a/src/quick/items/qquickspriteimage.cpp +++ b/src/quick/items/qquickspriteimage.cpp @@ -435,8 +435,8 @@ void QQuickSpriteImage::prepareNextFrame() //Advance Sprite qreal animT = m_spriteEngine->spriteStart()/1000.0; - qreal frameDuration = m_spriteEngine->spriteDuration(); qreal frameCount = m_spriteEngine->spriteFrames(); + qreal frameDuration = m_spriteEngine->spriteDuration()/frameCount; double frameAt; qreal progress; if (frameDuration > 0) { @@ -467,7 +467,7 @@ void QQuickSpriteImage::prepareNextFrame() m_material->animY2 = y; m_material->animW = w; m_material->animH = h; - m_material->animT = progress; + m_material->animT = m_interpolate ? progress : 0.0; } QT_END_NAMESPACE -- cgit v1.2.3