sparkling

This commit is contained in:
Attila BODY 2018-12-16 18:36:42 +01:00
parent 087af69592
commit 8eb06c8eab
2 changed files with 23 additions and 26 deletions

View file

@ -26,9 +26,9 @@ bool Sparkle::Step()
Pixel_t current = *m_target;
uint8_t remaining = 3;
if(current.b > m_fadeSpeed.r )current.r -= m_fadeSpeed.r;
if(current.r > m_fadeSpeed.r )current.r -= m_fadeSpeed.r;
else {
current.b = 0;
current.r = 0;
--remaining;
}
@ -43,7 +43,10 @@ bool Sparkle::Step()
current.b = 0;
--remaining;
}
*m_target = current;
return remaining != 0;
if(remaining) return true;
m_target = nullptr;
return false;
}