From be72fb26c2405c84878fd974c52f0950b4ec3478 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Tue, 3 Jan 2012 12:06:33 +1000 Subject: [PATCH] Initialize AnimIdx Otherwise any attempted reads later will get a stale value from a previous particle (only happens with custom affectors though) Change-Id: Iab3c7736d5c01218174ef8b331057df57b591209 Reviewed-by: Martin Jones --- src/quick/particles/qquickimageparticle.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/quick/particles/qquickimageparticle.cpp b/src/quick/particles/qquickimageparticle.cpp index 6b8df61..77fa3af 100644 --- a/src/quick/particles/qquickimageparticle.cpp +++ b/src/quick/particles/qquickimageparticle.cpp @@ -1536,6 +1536,7 @@ void QQuickImageParticle::initialize(int gIdx, int pIdx) m_spriteEngine->start(spriteIdx); writeTo->frameCount = m_spriteEngine->spriteFrames(spriteIdx); writeTo->frameDuration = m_spriteEngine->spriteDuration(spriteIdx); + writeTo->animIdx = 0;//Always starts at 0 writeTo->animX = m_spriteEngine->spriteX(spriteIdx); writeTo->animY = m_spriteEngine->spriteY(spriteIdx); writeTo->animWidth = m_spriteEngine->spriteWidth(spriteIdx); @@ -1546,6 +1547,7 @@ void QQuickImageParticle::initialize(int gIdx, int pIdx) writeTo->animT = datum->t; writeTo->frameCount = 1; writeTo->frameDuration = 60000000.0; + writeTo->animIdx = 0; writeTo->animT = 0; writeTo->animX = writeTo->animY = 0; writeTo->animWidth = getState(m_material)->animSheetSize.width(); -- 2.7.4